Skip to content
Snippets Groups Projects
Unverified Commit 32666fd1 authored by Shaun Wang's avatar Shaun Wang Committed by GitHub
Browse files

Consistent 'balances' naming in mocks. (#520)

parent ffa1a264
No related branches found
No related tags found
No related merge requests found
......@@ -123,20 +123,18 @@ pub const EVA: AccountId = AccountId32::new([5u8; 32]);
pub const ID_1: LockIdentifier = *b"1 ";
pub struct ExtBuilder {
endowed_accounts: Vec<(AccountId, CurrencyId, Balance)>,
balances: Vec<(AccountId, CurrencyId, Balance)>,
}
impl Default for ExtBuilder {
fn default() -> Self {
Self {
endowed_accounts: vec![],
}
Self { balances: vec![] }
}
}
impl ExtBuilder {
pub fn balances(mut self, endowed_accounts: Vec<(AccountId, CurrencyId, Balance)>) -> Self {
self.endowed_accounts = endowed_accounts;
pub fn balances(mut self, balances: Vec<(AccountId, CurrencyId, Balance)>) -> Self {
self.balances = balances;
self
}
......@@ -156,7 +154,7 @@ impl ExtBuilder {
pallet_balances::GenesisConfig::<Runtime> {
balances: self
.endowed_accounts
.balances
.clone()
.into_iter()
.filter(|(_, currency_id, _)| *currency_id == NATIVE_CURRENCY_ID)
......@@ -168,7 +166,7 @@ impl ExtBuilder {
orml_tokens::GenesisConfig::<Runtime> {
balances: self
.endowed_accounts
.balances
.into_iter()
.filter(|(_, currency_id, _)| *currency_id != NATIVE_CURRENCY_ID)
.collect::<Vec<_>>(),
......
......@@ -240,22 +240,22 @@ construct_runtime!(
);
pub struct ExtBuilder {
endowed_accounts: Vec<(AccountId, CurrencyId, Balance)>,
balances: Vec<(AccountId, CurrencyId, Balance)>,
treasury_genesis: bool,
}
impl Default for ExtBuilder {
fn default() -> Self {
Self {
endowed_accounts: vec![],
balances: vec![],
treasury_genesis: false,
}
}
}
impl ExtBuilder {
pub fn balances(mut self, endowed_accounts: Vec<(AccountId, CurrencyId, Balance)>) -> Self {
self.endowed_accounts = endowed_accounts;
pub fn balances(mut self, balances: Vec<(AccountId, CurrencyId, Balance)>) -> Self {
self.balances = balances;
self
}
......@@ -274,7 +274,7 @@ impl ExtBuilder {
.unwrap();
tokens::GenesisConfig::<Runtime> {
balances: self.endowed_accounts,
balances: self.balances,
}
.assimilate_storage(&mut t)
.unwrap();
......
......@@ -447,7 +447,7 @@ impl ParaExtBuilder {
.unwrap();
orml_tokens::GenesisConfig::<Runtime> {
endowed_accounts: vec![(ALICE, CurrencyId::R, 100)],
balances: vec![(ALICE, CurrencyId::R, 100)],
}
.assimilate_storage(&mut t)
.unwrap();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment