Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trinitys7 committed Sep 5, 2024
1 parent 9d82cc7 commit 8b6f4ee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions contracts/consumer/virtual-staking/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ impl VirtualStakingApi for VirtualStakingContract<'_> {
delegator,
validator: validator.clone(),
},
VirtualStakeMsg::Unbond { amount, validator }
VirtualStakeMsg::Unbond { amount, validator },
];
Ok(Response::new().add_messages(msgs))
}
Expand Down Expand Up @@ -579,7 +579,7 @@ impl VirtualStakingApi for VirtualStakingContract<'_> {
let all_delegations = TokenQuerier::new(&deps.querier)
.all_delegations(env.contract.address.to_string(), config.max_retrieve)?;
if all_delegations.delegations.len() == 0 {

Check failure on line 581 in contracts/consumer/virtual-staking/src/contract.rs

View workflow job for this annotation

GitHub Actions / Lints

length comparison to zero
return Ok(resp.add_message(VirtualStakeMsg::DeleteAllScheduledTasks{}));
return Ok(resp.add_message(VirtualStakeMsg::DeleteAllScheduledTasks {}));
}
let mut msgs = vec![];
for delegation in all_delegations.delegations {
Expand Down Expand Up @@ -1737,9 +1737,9 @@ mod tests {

#[track_caller]
fn assert_no_bonding(&self) -> &Self {
if !self.virtual_stake_msgs.is_empty() {
if self.virtual_stake_msgs.len() > 1 {
panic!(
"hit_epoch result was expected to be a noop, but has these: {:?}",
"hit_epoch result was expected to only contain DeleteAllScheduledTasks, but has these: {:?}",
self.virtual_stake_msgs
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/bindings/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub enum VirtualStakeMsg {
validator: String,
},
/// Delete all scheduled tasks after zero max cap and unbond all delegations
DeleteAllScheduledTasks {}
DeleteAllScheduledTasks {},
}

impl VirtualStakeMsg {
Expand Down
3 changes: 3 additions & 0 deletions packages/virtual-staking-mock/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ impl Module for VirtualStakingModule {
}
}
mesh_bindings::VirtualStakeMsg::UpdateDelegation { .. } => Ok(AppResponse::default()),
mesh_bindings::VirtualStakeMsg::DeleteAllScheduledTasks { .. } => {
Ok(AppResponse::default())
}
}
}

Expand Down

0 comments on commit 8b6f4ee

Please sign in to comment.