Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
8c800d1
update: sync tests and runtime primitives
aurexav Nov 22, 2019
a6a3ef1
fix: `clear_mature_deposits` logic
aurexav Nov 22, 2019
ec53209
hanging: bakcup
aurexav Nov 22, 2019
4c847fd
Merge remote-tracking branch 'upstream/develop' into update-test
aurexav Nov 22, 2019
77852bb
hanging: backup
aurexav Nov 22, 2019
fe248b7
hanging: backup
aurexav Nov 22, 2019
c4de14b
Merge remote-tracking branch 'upstream/develop' into update-test
aurexav Nov 22, 2019
ecafdd0
fix: `normal_unbond_should_work`
aurexav Nov 22, 2019
a30ff73
hanging: backup
aurexav Nov 22, 2019
a652a20
Merge remote-tracking branch 'upstream/develop' into update-test
aurexav Nov 22, 2019
9f80a33
update: currency primitives
aurexav Nov 23, 2019
af5d88d
remove: useless import
aurexav Nov 23, 2019
e7064cc
remove: useless lifetime bound
aurexav Nov 23, 2019
2f6ff75
hanging: backup
aurexav Nov 23, 2019
7202e66
fix: `punished_claim_should_work`
aurexav Nov 23, 2019
928a1aa
remove: clone on copy, useless field
aurexav Nov 23, 2019
3f67e3a
hanging: bakcup
aurexav Nov 23, 2019
1b780cf
fix: `transform_to_deposited_ring_should_work`
aurexav Nov 23, 2019
1c7ea90
hanging: backup
aurexav Nov 23, 2019
e9bd448
fix: `expired_ring_should_capable_to_promise_again`
aurexav Nov 23, 2019
48ba6c2
fix: `inflation_should_be_correct`
aurexav Nov 23, 2019
93cff5d
add: TODO
aurexav Nov 23, 2019
ab0cb5a
add: comment for `reward_validator`
aurexav Nov 25, 2019
2bb337f
fix: `set_controller_should_not_change_ledger`
aurexav Nov 25, 2019
77219c0
fix: remove dangling comma
aurexav Nov 25, 2019
5d728eb
rename: `set_controller_should_remove_old_ledger` to `set_controller_…
aurexav Nov 25, 2019
f82d4b0
fix: `check_stash_already_bonded_and_controller_already_paired`
aurexav Nov 25, 2019
333db3a
fix: `bond_over_max_promise_month_should_fail`
aurexav Nov 25, 2019
a93aba2
add: comment for `slash_validator`
aurexav Nov 25, 2019
ac33c71
fix: typo
aurexav Nov 25, 2019
a8a9b98
update: `set_controller_should_work`
aurexav Nov 25, 2019
08f95cc
fix: `pool_should_be_increased_and_decreased_correctly`
aurexav Nov 25, 2019
eaab535
fix: typo
aurexav Nov 25, 2019
d76be29
hanging: backup
aurexav Nov 25, 2019
0c0aca9
Merge remote-tracking branch 'upstream/develop' into update-test
aurexav Nov 25, 2019
8619dfc
fix: `unbond_over_max_unbondings_chunks_should_fail`
aurexav Nov 25, 2019
920b338
fix: bug with `ensure!` parser
aurexav Nov 25, 2019
9dcdcef
add: `unbond_zero`
aurexav Nov 26, 2019
bb332ba
fix: `promise_extra_should_not_remove_unexpired_items`
aurexav Nov 26, 2019
b0cdc1e
update: avoid unnecessary `insert` operation
aurexav Nov 26, 2019
46be1dd
remove: `total_deposit_should_be_increased_and_decreased_correctly`
aurexav Nov 26, 2019
d4b6eb2
remove: `unlock_value_should_be_increased_and_decreased_correctly`
aurexav Nov 26, 2019
7ad23af
fix: `yakio_q1`
aurexav Nov 26, 2019
129416a
update: `ValidatorPrefs`
aurexav Nov 26, 2019
b77c505
fix: `yakio_q2`
aurexav Nov 26, 2019
8fefeb9
fix: `pool_should_be_increased_and_decreased_correctly`
aurexav Nov 26, 2019
840be95
fix: `slash_should_not_touch_unbondings`
aurexav Nov 26, 2019
9fb732f
udpate: format
aurexav Nov 26, 2019
5dc44fd
add: `FIXME: slash strategy`
aurexav Nov 26, 2019
45729fd
Merge remote-tracking branch 'upstream/develop' into update-test
aurexav Nov 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add: FIXME: slash strategy
  • Loading branch information
aurexav committed Nov 26, 2019
commit 5dc44fda18d9d80cdfc74f6b95056e5b8dd7ed2a
15 changes: 8 additions & 7 deletions srml/staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,11 +523,11 @@ fn reward_and_slash_should_work() {
others: vec![],
},
);
assert_eq!(Ring::total_balance(&stash_1), 100 * COIN);
assert_eq!(Ring::free_balance(&stash_1), 100 * COIN);
let _ = Staking::reward_validator(&stash_1, 20 * COIN);
assert_eq!(Ring::total_balance(&stash_1), 120 * COIN);
assert_eq!(Ring::free_balance(&stash_1), 120 * COIN);

// TODO
// FIXME: slash strategy
// <Stakers<Test>>::insert(
// &stash_1,
// Exposure {
Expand All @@ -539,11 +539,9 @@ fn reward_and_slash_should_work() {
// }],
// },
// );
// println!("{:#?}", Ring::total_balance(&stash_1));
// let _ = Staking::slash_validator(&stash_1, 1, &Staking::stakers(&stash_1), &mut Vec::new());
// println!("{:#?}", Ring::total_balance(&stash_1));
// assert_eq!(Ring::total_balance(&stash_1), 120 * COIN - 1);
// assert_eq!(Ring::total_balance(&stash_2), 1);
// assert_eq!(Ring::free_balance(&stash_1), 120 * COIN - 1);
// assert_eq!(Ring::free_balance(&stash_2), 1);
});
}

Expand Down Expand Up @@ -605,6 +603,7 @@ fn slash_should_not_touch_unbondings() {
others: vec![],
},
);
// FIXME: slash strategy
let _ = Staking::slash_validator(
&stash,
ExtendedBalance::max_value(),
Expand Down Expand Up @@ -741,12 +740,14 @@ fn pool_should_be_increased_and_decreased_correctly() {
others: vec![],
},
);
// FIXME: slash strategy
let _ = Staking::slash_validator(
&stash_1,
ExtendedBalance::max_value(),
&Staking::stakers(&stash_1),
&mut vec![],
);
// FIXME: slash strategy
let _ = Staking::slash_validator(
&stash_2,
ExtendedBalance::max_value(),
Expand Down