Skip to content

Commit

Permalink
remove not correct test
Browse files Browse the repository at this point in the history
  • Loading branch information
trinitys7 committed Sep 5, 2024
1 parent 8b6f4ee commit 014bd50
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions contracts/consumer/virtual-staking/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1100,46 +1100,6 @@ mod tests {
.assert_rewards(&["val1"]); // Rewards are being gathered again
}

#[test]
fn validator_tombstoning() {
let (mut deps, knobs) = mock_dependencies();

let contract = VirtualStakingContract::new();
contract.quick_inst(deps.as_mut());
let denom = contract.config.load(&deps.storage).unwrap().denom;

knobs.bond_status.update_cap(100u128);
contract.quick_bond(deps.as_mut(), "owner", "val1", 20);
contract.quick_bond(deps.as_mut(), "owner", "val2", 20);
contract
.hit_epoch(deps.as_mut())
.assert_bond(&[("val1", (20u128, &denom)), ("val2", (20u128, &denom))])
.assert_rewards(&[]);

// Val1 is being tombstoned
contract.tombstone(deps.as_mut(), "val1", Decimal::percent(25), Uint128::new(5));
contract
.hit_epoch(deps.as_mut())
.assert_bond(&[]) // No bond msgs after tombstoning
.assert_unbond(&[]) // No unbond msgs after tombstoning
.assert_rewards(&["val1", "val2"]); // Last rewards msgs after tombstoning

// Check that the bonded amounts of val1 have been slashed for double sign (25%)
// Val2 is unaffected.
// TODO: Check that the amounts have been slashed for double sign on-chain (needs mt slashing / tombstoning support)
let bonded = contract.bonded.load(deps.as_ref().storage).unwrap();
assert_eq!(
bonded,
[
("val1".to_string(), Uint128::new(15)),
("val2".to_string(), Uint128::new(20))
]
);

// Subsequent rewards msgs are removed after validator is tombstoned
contract.hit_epoch(deps.as_mut()).assert_rewards(&["val2"]);
}

#[test]
fn validator_tombstoning_pending_bond() {
let (mut deps, knobs) = mock_dependencies();
Expand Down

0 comments on commit 014bd50

Please sign in to comment.