Skip to content

Commit

Permalink
test: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
TarekkMA committed Jan 14, 2025
1 parent c199943 commit 0980453
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
3 changes: 1 addition & 2 deletions runtime/moonbase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ use frame_support::{
construct_runtime,
dispatch::{DispatchClass, GetDispatchInfo, PostDispatchInfo},
ensure,
pallet_prelude::{DispatchResult},
pallet_prelude::DispatchResult,
parameter_types,
traits::{
fungible::{Balanced, Credit, HoldConsideration, Inspect},
Expand Down Expand Up @@ -89,7 +89,6 @@ use pallet_evm::{
OnChargeEVMTransaction as OnChargeEVMTransactionT, Runner,
};
use pallet_transaction_payment::{FungibleAdapter, Multiplier, TargetedFeeAdjustment};
use pallet_treasury::TreasuryAccountId;
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use runtime_params::*;
use scale_info::TypeInfo;
Expand Down
8 changes: 6 additions & 2 deletions runtime/moonbase/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2797,7 +2797,8 @@ fn substrate_based_fees_zero_txn_costs_only_base_extrinsic() {
#[test]
fn deal_with_fees_handles_tip() {
use frame_support::traits::OnUnbalanced;
use moonbase_runtime::{DealWithSubstrateFeesAndTip, Treasury};
use moonbase_runtime::Treasury;
use moonbeam_runtime_common::deal_with_fees::DealWithSubstrateFeesAndTip;

ExtBuilder::default().build().execute_with(|| {
set_parachain_inherent_data();
Expand Down Expand Up @@ -2832,7 +2833,10 @@ fn deal_with_fees_handles_tip() {
assert_eq!(Balances::free_balance(&Treasury::account_id()), 0);

// Step 3: Execute the fees handling logic.
DealWithSubstrateFeesAndTip::on_unbalanceds(vec![fee, tip].into_iter());
DealWithSubstrateFeesAndTip::<
Runtime,
dynamic_params::runtime_config::FeesTreasuryProportion,
>::on_unbalanceds(vec![fee, tip].into_iter());

// Step 4: Compute the split between treasury and burned fees based on FeesTreasuryProportion (20%).
let treasury_proportion = dynamic_params::runtime_config::FeesTreasuryProportion::get();
Expand Down
3 changes: 1 addition & 2 deletions runtime/moonbeam/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ use frame_support::{
fungible::{Balanced, Credit, HoldConsideration, Inspect},
tokens::{PayFromAccount, UnityAssetBalanceConversion},
ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse,
EqualPrivilegeOnly, InstanceFilter, LinearStoragePrice, OnFinalize,
OnUnbalanced,
EqualPrivilegeOnly, InstanceFilter, LinearStoragePrice, OnFinalize, OnUnbalanced,
},
weights::{
constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient,
Expand Down
8 changes: 6 additions & 2 deletions runtime/moonbeam/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2618,7 +2618,8 @@ fn removed_precompiles() {
#[test]
fn deal_with_fees_handles_tip() {
use frame_support::traits::OnUnbalanced;
use moonbeam_runtime::{DealWithSubstrateFeesAndTip, Treasury};
use moonbeam_runtime::Treasury;
use moonbeam_runtime_common::deal_with_fees::DealWithSubstrateFeesAndTip;

ExtBuilder::default().build().execute_with(|| {
set_parachain_inherent_data();
Expand Down Expand Up @@ -2653,7 +2654,10 @@ fn deal_with_fees_handles_tip() {
assert_eq!(Balances::free_balance(&Treasury::account_id()), 0);

// Step 3: Execute the fees handling logic.
DealWithSubstrateFeesAndTip::on_unbalanceds(vec![fee, tip].into_iter());
DealWithSubstrateFeesAndTip::<
Runtime,
dynamic_params::runtime_config::FeesTreasuryProportion,
>::on_unbalanceds(vec![fee, tip].into_iter());

// Step 4: Compute the split between treasury and burned fees based on FeesTreasuryProportion (20%).
let treasury_proportion = dynamic_params::runtime_config::FeesTreasuryProportion::get();
Expand Down
3 changes: 1 addition & 2 deletions runtime/moonriver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ use frame_support::{
fungible::{Balanced, Credit, HoldConsideration, Inspect},
tokens::{PayFromAccount, UnityAssetBalanceConversion},
ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse,
EqualPrivilegeOnly, InstanceFilter, LinearStoragePrice, OnFinalize,
OnUnbalanced,
EqualPrivilegeOnly, InstanceFilter, LinearStoragePrice, OnFinalize, OnUnbalanced,
},
weights::{
constants::WEIGHT_REF_TIME_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient,
Expand Down
8 changes: 6 additions & 2 deletions runtime/moonriver/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2517,7 +2517,8 @@ fn removed_precompiles() {
#[test]
fn deal_with_fees_handles_tip() {
use frame_support::traits::OnUnbalanced;
use moonriver_runtime::{DealWithSubstrateFeesAndTip, Treasury};
use moonbeam_runtime_common::deal_with_fees::DealWithSubstrateFeesAndTip;
use moonriver_runtime::Treasury;

ExtBuilder::default().build().execute_with(|| {
set_parachain_inherent_data();
Expand Down Expand Up @@ -2552,7 +2553,10 @@ fn deal_with_fees_handles_tip() {
assert_eq!(Balances::free_balance(&Treasury::account_id()), 0);

// Step 3: Execute the fees handling logic.
DealWithSubstrateFeesAndTip::on_unbalanceds(vec![fee, tip].into_iter());
DealWithSubstrateFeesAndTip::<
Runtime,
dynamic_params::runtime_config::FeesTreasuryProportion,
>::on_unbalanceds(vec![fee, tip].into_iter());

// Step 4: Compute the split between treasury and burned fees based on FeesTreasuryProportion (20%).
let treasury_proportion = dynamic_params::runtime_config::FeesTreasuryProportion::get();
Expand Down

0 comments on commit 0980453

Please sign in to comment.