Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tests for non-zero existential deposit #1209

Merged
merged 2 commits into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions modules/transaction-payment/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl orml_tokens::Config for Runtime {
}

parameter_types! {
pub const NativeTokenExistentialDeposit: Balance = 0;
pub const NativeTokenExistentialDeposit: Balance = 10;
pub const MaxReserves: u32 = 50;
}

Expand Down Expand Up @@ -253,6 +253,7 @@ pub struct ExtBuilder {
base_weight: u64,
byte_fee: u128,
weight_to_fee: u128,
native_balances: Vec<(AccountId, Balance)>,
}

impl Default for ExtBuilder {
Expand All @@ -262,6 +263,7 @@ impl Default for ExtBuilder {
base_weight: 0,
byte_fee: 2,
weight_to_fee: 1,
native_balances: vec![],
}
}
}
Expand All @@ -279,6 +281,10 @@ impl ExtBuilder {
self.weight_to_fee = weight_to_fee;
self
}
pub fn one_hundred_thousand_for_alice_n_charlie(mut self) -> Self {
self.native_balances = vec![(ALICE, 100000), (CHARLIE, 100000)];
self
}
fn set_constants(&self) {
EXTRINSIC_BASE_WEIGHT.with(|v| *v.borrow_mut() = self.base_weight);
TRANSACTION_BYTE_FEE.with(|v| *v.borrow_mut() = self.byte_fee);
Expand All @@ -291,7 +297,7 @@ impl ExtBuilder {
.unwrap();

pallet_balances::GenesisConfig::<Runtime> {
balances: vec![(ALICE, 100000), (CHARLIE, 100000)],
balances: self.native_balances,
}
.assimilate_storage(&mut t)
.unwrap();
Expand Down
Loading