From 7e4b42da4180a20c90a17b458d4216c50120a0e0 Mon Sep 17 00:00:00 2001 From: zjb0807 Date: Tue, 21 Dec 2021 13:51:47 +0800 Subject: [PATCH 1/2] fix mandala-runtime with dev mode --- runtime/mandala/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/mandala/src/lib.rs b/runtime/mandala/src/lib.rs index 0642e84f9e..0c27437db7 100644 --- a/runtime/mandala/src/lib.rs +++ b/runtime/mandala/src/lib.rs @@ -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 { From 367fdfa620bdcbe0f7fc9b0a78fac35f8beceadf Mon Sep 17 00:00:00 2001 From: zjb0807 Date: Tue, 21 Dec 2021 14:03:59 +0800 Subject: [PATCH 2/2] fix tests --- runtime/integration-tests/src/treasury.rs | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/runtime/integration-tests/src/treasury.rs b/runtime/integration-tests/src/treasury.rs index 3feb811a2e..7ec1b361ec 100644 --- a/runtime/integration-tests/src/treasury.rs +++ b/runtime/integration-tests/src/treasury.rs @@ -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); @@ -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 ); }); }