Skip to content

Commit

Permalink
Merge pull request #56 from neutron-org/chore/optional-pcl-migration-…
Browse files Browse the repository at this point in the history
…status

chore: make PCL migration status optional for lockdrop and vesting lp base
  • Loading branch information
pr0n00gler authored Sep 21, 2023
2 parents 410d560 + 482d09e commit c5d4667
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions contracts/lockdrop/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ pub fn instantiate(
/// * **ExecuteMsg::ClaimOwnership {}** Claims contract ownership.
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn execute(deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg) -> StdResult<Response> {
let migration_state: MigrationState = MIGRATION_STATUS.load(deps.storage)?;
if migration_state != MigrationState::Completed {
let migration_state = MIGRATION_STATUS.may_load(deps.storage)?;
if migration_state.unwrap_or(MigrationState::Completed) != MigrationState::Completed {
match msg {
ExecuteMsg::MigrateFromXykToCl(..) => {}
ExecuteMsg::Callback(..) => {}
Expand Down Expand Up @@ -400,8 +400,8 @@ fn _handle_callback(
/// }** Returns a total amount of LP tokens for the specified pool at a specific height.
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<Binary> {
let migration_state: MigrationState = MIGRATION_STATUS.load(deps.storage)?;
if migration_state != MigrationState::Completed {
let migration_state = MIGRATION_STATUS.may_load(deps.storage)?;
if migration_state.unwrap_or(MigrationState::Completed) != MigrationState::Completed {
match msg {
QueryMsg::QueryUserLockupTotalAtHeight { .. }
| QueryMsg::QueryLockupTotalAtHeight { .. } => {
Expand Down
8 changes: 4 additions & 4 deletions packages/vesting-base-lp/src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ pub fn execute(
info: MessageInfo,
msg: ExecuteMsg,
) -> Result<Response, ContractError> {
let migration_state: MigrationState = MIGRATION_STATUS.load(deps.storage)?;
if migration_state != MigrationState::Completed {
let migration_state = MIGRATION_STATUS.may_load(deps.storage)?;
if migration_state.unwrap_or(MigrationState::Completed) != MigrationState::Completed {
match msg {
ExecuteMsg::MigrateLiquidity {
slippage_tolerance: _,
Expand Down Expand Up @@ -610,8 +610,8 @@ fn post_migration_vesting_reschedule_callback(

/// Exposes all the queries available in the contract.
pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<Binary> {
let migration_state: MigrationState = MIGRATION_STATUS.load(deps.storage)?;
if migration_state != MigrationState::Completed {
let migration_state = MIGRATION_STATUS.may_load(deps.storage)?;
if migration_state.unwrap_or(MigrationState::Completed) != MigrationState::Completed {
return Err(ContractError::MigrationIncomplete {}.into());
}

Expand Down

0 comments on commit c5d4667

Please sign in to comment.