Skip to content

Commit

Permalink
Fixes after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
albertandrejev committed Oct 24, 2024
1 parent 4388486 commit 8658e85
Show file tree
Hide file tree
Showing 7 changed files with 542 additions and 1,043 deletions.
24 changes: 6 additions & 18 deletions contracts/core/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ use cosmwasm_std::{
};
use cw_storage_plus::Bound;
use drop_helpers::answer::response;
use drop_helpers::pause::{is_paused, pause_guard, set_pause, unpause, PauseInfoResponse};
use drop_puppeteer_base::msg::TransferReadyBatchesMsg;
use drop_puppeteer_base::peripheral_hook::IBCTransferReason;
use drop_staking_base::msg::core::{BondCallback, BondHook};
use drop_staking_base::state::core::{BOND_HOOKS, BOND_PROVIDERS, BOND_PROVIDER_REPLY_ID};
use drop_puppeteer_base::{msg::TransferReadyBatchesMsg, peripheral_hook::IBCTransferReason};
use drop_staking_base::{
error::core::{ContractError, ContractResult},
msg::{
core::{
ExecuteMsg, FailedBatchResponse, InstantiateMsg, LastPuppeteerResponse, MigrateMsg,
QueryMsg,
BondCallback, BondHook, ExecuteMsg, FailedBatchResponse, InstantiateMsg,
LastPuppeteerResponse, MigrateMsg, QueryMsg,
},
token::{
ConfigResponse as TokenConfigResponse, ExecuteMsg as TokenExecuteMsg,
Expand All @@ -28,8 +24,9 @@ use drop_staking_base::{
core::{
unbond_batches_map, Config, ConfigOptional, ContractState, Pause, UnbondBatch,
UnbondBatchStatus, UnbondBatchStatusTimestamps, UnbondBatchesResponse, BONDED_AMOUNT,
CONFIG, EXCHANGE_RATE, FAILED_BATCH_ID, FSM, LAST_ICA_CHANGE_HEIGHT, LAST_IDLE_CALL,
LAST_PUPPETEER_RESPONSE, LD_DENOM, UNBOND_BATCH_ID,
BOND_HOOKS, BOND_PROVIDERS, BOND_PROVIDER_REPLY_ID, CONFIG, EXCHANGE_RATE,
FAILED_BATCH_ID, FSM, LAST_ICA_CHANGE_HEIGHT, LAST_IDLE_CALL, LAST_PUPPETEER_RESPONSE,
LD_DENOM, PAUSE, UNBOND_BATCH_ID,
},
validatorset::ValidatorInfo,
withdrawal_voucher::{Metadata, Trait},
Expand Down Expand Up @@ -124,14 +121,6 @@ pub fn query(deps: Deps<NeutronQuery>, _env: Env, msg: QueryMsg) -> ContractResu
})
}

fn query_pause_info(deps: Deps<NeutronQuery>) -> ContractResult<Binary> {
if is_paused(deps.storage)? {
to_json_binary(&PauseInfoResponse::Paused {}).map_err(From::from)
} else {
to_json_binary(&PauseInfoResponse::Unpaused {}).map_err(From::from)
}
}

fn query_total_async_tokens(deps: Deps<NeutronQuery>) -> ContractResult<Uint128> {
let mut total_async_shares = Uint128::zero();
let bond_providers = BOND_PROVIDERS.get_all_providers(deps.storage)?;
Expand Down Expand Up @@ -295,7 +284,6 @@ pub fn execute(
batch_id,
withdrawn_amount,
} => execute_update_withdrawn_amount(deps, env, info, batch_id, withdrawn_amount),
ExecuteMsg::Tick {} => execute_tick(deps, env, info),
ExecuteMsg::PeripheralHook(msg) => execute_puppeteer_hook(deps, env, info, *msg),
ExecuteMsg::SetPause(pause) => execute_set_pause(deps, info, pause),
ExecuteMsg::SetBondHooks { hooks } => execute_set_bond_hooks(deps, info, hooks),
Expand Down
10 changes: 2 additions & 8 deletions contracts/core/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,10 @@ use cosmwasm_std::{
to_json_binary, Addr, Coin, CosmosMsg, Decimal, Decimal256, Event, OwnedDeps, Response, SubMsg,
Timestamp, Uint128, WasmMsg,
};
use drop_helpers::testing::{mock_dependencies, WasmMockQuerier};
use drop_helpers::{
pause::PauseError,
testing::{mock_dependencies, WasmMockQuerier},
};
use drop_puppeteer_base::{
msg::TransferReadyBatchesMsg,
state::{Delegations, DropDelegation, RedeemShareItem},
};

use drop_puppeteer_base::msg::TransferReadyBatchesMsg;
use drop_staking_base::{
error::core::ContractError,
Expand All @@ -28,10 +22,10 @@ use drop_staking_base::{
},
state::{
core::{
unbond_batches_map, Config, ConfigOptional, ContractState, UnbondBatch,
unbond_batches_map, Config, ConfigOptional, ContractState, Pause, UnbondBatch,
UnbondBatchStatus, UnbondBatchStatusTimestamps, BONDED_AMOUNT, BOND_HOOKS,
BOND_PROVIDERS, BOND_PROVIDER_REPLY_ID, CONFIG, FAILED_BATCH_ID, FSM,
LAST_ICA_CHANGE_HEIGHT, LAST_IDLE_CALL, LAST_PUPPETEER_RESPONSE, LD_DENOM,
LAST_ICA_CHANGE_HEIGHT, LAST_IDLE_CALL, LAST_PUPPETEER_RESPONSE, LD_DENOM, PAUSE,
TOTAL_LSM_SHARES, UNBOND_BATCH_ID,
},
puppeteer::{Delegations, DropDelegation},
Expand Down
4 changes: 2 additions & 2 deletions contracts/factory/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::{
contract::{execute, instantiate, query},
msg::{
CoreMsg, CoreParams, ExecuteMsg, FeeParams, InstantiateMsg, LsmShareBondParams,
NativeBondParams, ProxyMsg, QueryMsg, UpdateConfigMsg, ValidatorSetMsg,
CoreParams, ExecuteMsg, FeeParams, InstantiateMsg, LsmShareBondParams, NativeBondParams,
QueryMsg, UpdateConfigMsg, ValidatorSetMsg,
},
state::{CodeIds, RemoteOpts, State, Timeout, STATE},
};
Expand Down
3 changes: 1 addition & 2 deletions packages/base/src/msg/core.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use crate::{
error::core::ContractResult,
msg::staker::ResponseHookMsg as StakerResponseHookMsg,
state::core::{Config, ConfigOptional, Pause},
};
use cosmwasm_schema::{cw_serde, QueryResponses};

#[allow(unused_imports)]
use cosmwasm_std::{Addr, Deps, Uint128, Uint64};
use cw_ownable::cw_ownable_execute;
use drop_puppeteer_base::msg::ResponseHookMsg as PuppeteerResponseHookMsg;
use drop_puppeteer_base::peripheral_hook::ResponseHookMsg as PuppeteerResponseHookMsg;

#[cw_serde]
pub struct InstantiateMsg {
Expand Down
Loading

0 comments on commit 8658e85

Please sign in to comment.