Skip to content

Commit

Permalink
u128 balance fix
Browse files Browse the repository at this point in the history
  • Loading branch information
michalkucharczyk committed Jan 17, 2024
1 parent 166ae5a commit 879917e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion substrate/bin/minimal/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ pub fn development_config() -> Result<ChainSpec, String> {
fn testnet_genesis() -> Value {
use frame::traits::Get;
use runtime::interface::{Balance, MinimumBalance};
let endowment = <MinimumBalance as Get<Balance>>::get().max(1) * 1000;
// let endowment = <MinimumBalance as Get<Balance>>::get().max(1) * 1000;
let endowment = u128::MAX / 2;
let balances = AccountKeyring::iter()
.map(|a| (a.to_account_id(), endowment))
.collect::<Vec<_>>();
Expand Down
1 change: 1 addition & 0 deletions substrate/bin/minimal/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ workspace = true
[dependencies]
parity-scale-codec = { version = "3.0.0", default-features = false }
scale-info = { version = "2.6.0", default-features = false }
serde_json = { version = "1.0.108", default-features = false, features = ["alloc", "arbitrary_precision"] }

# this is a frame-based runtime, thus importing `frame` with runtime feature enabled.
frame = { path = "../../../frame", default-features = false, features = ["experimental", "runtime"] }
Expand Down
2 changes: 2 additions & 0 deletions substrate/bin/minimal/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ impl frame_system::Config for Runtime {
#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)]
impl pallet_balances::Config for Runtime {
type AccountStore = System;
type Balance = u128;
type ExistentialDeposit = ConstU128<1>;
}

#[derive_impl(pallet_sudo::config_preludes::TestDefaultConfig as pallet_sudo::DefaultConfig)]
Expand Down

0 comments on commit 879917e

Please sign in to comment.