Skip to content

Commit

Permalink
Fix mandala-runtime with dev mode (#1718)
Browse files Browse the repository at this point in the history
* fix mandala-runtime with dev mode

* fix tests
  • Loading branch information
zjb0807 authored Dec 21, 2021
1 parent 8beb6f8 commit ffa217b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
23 changes: 10 additions & 13 deletions runtime/integration-tests/src/treasury.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,15 @@ mod mandala_only_tests {
// The amount above existential is below the `MinRewardDistributeAmount`.
assert_eq!(
Currencies::free_balance(NATIVE_CURRENCY, &pot_account_id),
100_299_999_998
299_999_999_998
);

CollatorSelection::note_author(AccountId::from(ALICE));
CollatorSelection::note_author(AccountId::from(BOB));
assert_eq!(
Currencies::free_balance(NATIVE_CURRENCY, &pot_account_id),
100_299_999_998
);
assert_eq!(
Currencies::free_balance(NATIVE_CURRENCY, &AccountId::from(ALICE)),
dollar(NATIVE_CURRENCY)
299_999_999_998
);
assert_eq!(Currencies::free_balance(NATIVE_CURRENCY, &AccountId::from(BOB)), 0);

// Put a little more money into the pot
let tip = NegativeImbalance::new(10);
Expand All @@ -296,19 +293,19 @@ mod mandala_only_tests {
// Now the above existential is above the `MinRewardDistributeAmount`.
assert_eq!(
Currencies::free_balance(NATIVE_CURRENCY, &pot_account_id),
100_300_000_000
300_000_000_000
);

// Splits half of 300_000_000 to ALICE
CollatorSelection::note_author(AccountId::from(ALICE));
// Splits half of 300_000_000_000 to BOB
CollatorSelection::note_author(AccountId::from(BOB));

assert_eq!(
Currencies::free_balance(NATIVE_CURRENCY, &pot_account_id),
100_150_000_000
200_000_000_000
);
assert_eq!(
Currencies::free_balance(NATIVE_CURRENCY, &AccountId::from(ALICE)),
dollar(NATIVE_CURRENCY) + 150_000_000
Currencies::free_balance(NATIVE_CURRENCY, &AccountId::from(BOB)),
100_000_000_000
);
});
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/mandala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ parameter_types! {
pub const MaxInvulnerables: u32 = 50;
pub const KickPenaltySessionLength: u32 = 8;
pub const CollatorKickThreshold: Permill = Permill::from_percent(50);
// 10% of transaction fee of empty remark call: 150_459_200
pub MinRewardDistributeAmount: Balance = 15 * millicent(ACA);
// Ensure that can create the author(`ExistentialDeposit`) with dev mode.
pub MinRewardDistributeAmount: Balance = NativeTokenExistentialDeposit::get();
}

impl module_collator_selection::Config for Runtime {
Expand Down

0 comments on commit ffa217b

Please sign in to comment.