Skip to content

Commit

Permalink
add: test
Browse files Browse the repository at this point in the history
  • Loading branch information
aurexav committed Dec 27, 2019
1 parent 07f5665 commit adc02f0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions srml/staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2230,6 +2230,29 @@ fn dont_slash_if_fraction_is_zero() {

// custom tests

#[test]
fn bond_zero_should_work() {
ExtBuilder::default().build().execute_with(|| {
let (stash, controller) = (123, 456);
assert_ok!(Staking::bond(
Origin::signed(stash),
controller,
StakingBalances::RingBalance(0),
RewardDestination::Stash,
0,
));

let (stash, controller) = (234, 567);
assert_ok!(Staking::bond(
Origin::signed(stash),
controller,
StakingBalances::KtonBalance(0),
RewardDestination::Stash,
0,
));
});
}

#[test]
fn normal_kton_should_work() {
ExtBuilder::default().build().execute_with(|| {
Expand Down

0 comments on commit adc02f0

Please sign in to comment.