Skip to content

Commit

Permalink
Ignore untrn balance
Browse files Browse the repository at this point in the history
  • Loading branch information
faust403 committed Nov 20, 2024
1 parent 7ac13f2 commit 5451a27
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions contracts/core/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use drop_staking_base::{
UnbondBatchStatus, UnbondBatchStatusTimestamps, UnbondBatchesResponse, 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,
MAX_BOND_PROVIDERS, PAUSE, UNBOND_BATCH_ID,
MAX_BOND_PROVIDERS, PAUSE, UNBOND_BATCH_ID, UNTRN_DENOM,
},
validatorset::ValidatorInfo,
withdrawal_voucher::{Metadata, Trait},
Expand Down Expand Up @@ -372,7 +372,11 @@ fn execute_remove_bond_provider(
let bond_provider_balances = deps
.querier
.query_all_balances(bond_provider_address.clone())?;
if !bond_provider_balances.is_empty() {
let bond_provider_balances_except_untrn = bond_provider_balances
.into_iter()
.filter(|coin| coin.denom == UNTRN_DENOM.to_string())
.collect::<Vec<Coin>>();
if !bond_provider_balances_except_untrn.is_empty() {
return Err(ContractError::BondProviderBalanceNotEmpty {});
}

Expand Down
1 change: 0 additions & 1 deletion integration_tests/src/testcases/core.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,6 @@ describe('Core', () => {
coreContractClient,
puppeteerContractClient,
);

const res = await context.coreContractClient.tick(
neutronUserAddress,
1.5,
Expand Down
1 change: 1 addition & 0 deletions packages/base/src/state/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ pub struct Pause {
}
pub const BOND_PROVIDER_REPLY_ID: u64 = 1;
pub const MAX_BOND_PROVIDERS: u64 = 10;
pub static UNTRN_DENOM: &str = "untrn";

pub const FSM: Fsm<ContractState> = Fsm::new("machine_state", TRANSITIONS);
pub const LAST_IDLE_CALL: Item<u64> = Item::new("last_tick");
Expand Down

0 comments on commit 5451a27

Please sign in to comment.