Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtual-staking: jailing / tombstoning tests #142

Merged
merged 15 commits into from
Oct 12, 2023
Prev Previous commit
Next Next commit
Fix clippy warnings / remove unused stuff
  • Loading branch information
maurolacy committed Oct 11, 2023
commit 647377abf95772d548b8dbd05d96eabffcf8f1de
9 changes: 1 addition & 8 deletions contracts/consumer/virtual-staking/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,6 @@ mod tests {

let handler = {
let bs_copy = bond_status.clone();
let sr_copy = slash_ratio.clone();
move |msg: &_| {
let VirtualStakeCustomQuery::VirtualStake(msg) = msg;
match msg {
Expand All @@ -841,7 +840,7 @@ mod tests {
}
mesh_bindings::VirtualStakeQuery::SlashRatio {} => {
cosmwasm_std::SystemResult::Ok(cosmwasm_std::ContractResult::Ok(
to_binary(&*sr_copy.borrow()).unwrap(),
to_binary(&*slash_ratio.borrow()).unwrap(),
))
}
}
Expand All @@ -857,14 +856,12 @@ mod tests {
},
StakingKnobs {
bond_status,
slash_ratio,
},
)
}

struct StakingKnobs {
bond_status: MockBondStatus,
slash_ratio: MockSlashRatio,
}

#[derive(Clone)]
Expand Down Expand Up @@ -897,10 +894,6 @@ mod tests {
self.0.borrow()
}

fn update_downtime(&self, slash_ratio: &str) {
let mut mut_obj = self.0.borrow_mut();
mut_obj.slash_fraction_downtime = slash_ratio.into();
}
}

fn set_reward_targets(storage: &mut dyn Storage, targets: &[&str]) {
Expand Down
Loading