Skip to content

Commit

Permalink
fix fee pool threshold (#2293)
Browse files Browse the repository at this point in the history
  • Loading branch information
zqhxuyuan authored Jul 28, 2022
1 parent 2e6da86 commit 78f2a1a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
10 changes: 3 additions & 7 deletions runtime/acala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1777,11 +1777,11 @@ parameter_types! {
pub struct TransactionPaymentMigration;
impl OnRuntimeUpgrade for TransactionPaymentMigration {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
let poo_size = 5 * dollar(ACA);
let threshold = Ratio::saturating_from_rational(1, 2).saturating_mul_int(dollar(ACA));
let pool_size = 5 * dollar(ACA);
let threshold = Ratio::saturating_from_rational(1, 2).saturating_mul_int(pool_size);
for token in FeeTokens::get() {
let _ = module_transaction_payment::Pallet::<Runtime>::disable_pool(token);
let _ = module_transaction_payment::Pallet::<Runtime>::initialize_pool(token, poo_size, threshold);
let _ = module_transaction_payment::Pallet::<Runtime>::initialize_pool(token, pool_size, threshold);
}
<Runtime as frame_system::Config>::BlockWeights::get().max_block
}
Expand All @@ -1793,10 +1793,6 @@ impl OnRuntimeUpgrade for TransactionPaymentMigration {
module_transaction_payment::TokenExchangeRate::<Runtime>::contains_key(&token),
true
);
assert_eq!(
module_transaction_payment::GlobalFeeSwapPath::<Runtime>::contains_key(&token),
true
);
}
Ok(())
}
Expand Down
10 changes: 3 additions & 7 deletions runtime/karura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1810,11 +1810,11 @@ parameter_types! {
pub struct TransactionPaymentMigration;
impl OnRuntimeUpgrade for TransactionPaymentMigration {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
let poo_size = 5 * dollar(KAR);
let threshold = Ratio::saturating_from_rational(1, 2).saturating_mul_int(dollar(KAR));
let pool_size = 5 * dollar(KAR);
let threshold = Ratio::saturating_from_rational(1, 2).saturating_mul_int(pool_size);
for token in FeeTokens::get() {
let _ = module_transaction_payment::Pallet::<Runtime>::disable_pool(token);
let _ = module_transaction_payment::Pallet::<Runtime>::initialize_pool(token, poo_size, threshold);
let _ = module_transaction_payment::Pallet::<Runtime>::initialize_pool(token, pool_size, threshold);
}
<Runtime as frame_system::Config>::BlockWeights::get().max_block
}
Expand All @@ -1826,10 +1826,6 @@ impl OnRuntimeUpgrade for TransactionPaymentMigration {
module_transaction_payment::TokenExchangeRate::<Runtime>::contains_key(&token),
true
);
assert_eq!(
module_transaction_payment::GlobalFeeSwapPath::<Runtime>::contains_key(&token),
true
);
}
Ok(())
}
Expand Down
10 changes: 3 additions & 7 deletions runtime/mandala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1931,11 +1931,11 @@ parameter_types! {
pub struct TransactionPaymentMigration;
impl OnRuntimeUpgrade for TransactionPaymentMigration {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
let poo_size = 5 * dollar(ACA);
let threshold = Ratio::saturating_from_rational(1, 2).saturating_mul_int(dollar(ACA));
let pool_size = 5 * dollar(ACA);
let threshold = Ratio::saturating_from_rational(1, 2).saturating_mul_int(pool_size);
for token in FeeTokens::get() {
let _ = module_transaction_payment::Pallet::<Runtime>::disable_pool(token);
let _ = module_transaction_payment::Pallet::<Runtime>::initialize_pool(token, poo_size, threshold);
let _ = module_transaction_payment::Pallet::<Runtime>::initialize_pool(token, pool_size, threshold);
}
<Runtime as frame_system::Config>::BlockWeights::get().max_block
}
Expand All @@ -1947,10 +1947,6 @@ impl OnRuntimeUpgrade for TransactionPaymentMigration {
module_transaction_payment::TokenExchangeRate::<Runtime>::contains_key(&token),
true
);
assert_eq!(
module_transaction_payment::GlobalFeeSwapPath::<Runtime>::contains_key(&token),
true
);
}
Ok(())
}
Expand Down

0 comments on commit 78f2a1a

Please sign in to comment.