Skip to content

Commit

Permalink
runtimes: Update existential deposit (#523)
Browse files Browse the repository at this point in the history
Signed-off-by: Shreevatsa N <[email protected]>
  • Loading branch information
vatsa287 authored Nov 12, 2024
1 parent b5e9b09 commit 5f4d48d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions runtimes/braid/constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ pub mod weights;
pub mod currency {
use cord_primitives::Balance;

/// The existential deposit.
pub const EXISTENTIAL_DEPOSIT: Balance = 100 * MILLI_UNITS;
pub const UNITS: Balance = 1_000_000_000_000; // 10^12 precision

pub const MILLI_UNITS: Balance = UNITS / 1_000; // 10^9 precision
pub const MICRO_UNITS: Balance = UNITS / 1_000_000; // 10^6 precision
pub const NANO_UNITS: Balance = UNITS / 1_000_000_000; // 10^3 precision

/// The existential deposit.
pub const EXISTENTIAL_DEPOSIT: Balance = 100 * MILLI_UNITS;

pub const fn deposit(items: u32, bytes: u32) -> Balance {
items as Balance * 100 * UNITS + (bytes as Balance) * 100 * MILLI_UNITS
}
Expand Down
5 changes: 3 additions & 2 deletions runtimes/loom/constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ pub mod weights;
pub mod currency {
use cord_primitives::Balance;

/// The existential deposit.
pub const EXISTENTIAL_DEPOSIT: Balance = 100 * MILLI_UNITS;
pub const UNITS: Balance = 1_000_000_000_000; // 10^12 precision

pub const MILLI_UNITS: Balance = UNITS / 1_000; // 10^9 precision
pub const MICRO_UNITS: Balance = UNITS / 1_000_000; // 10^6 precision
pub const NANO_UNITS: Balance = UNITS / 1_000_000_000; // 10^3 precision

/// The existential deposit.
pub const EXISTENTIAL_DEPOSIT: Balance = 100 * MILLI_UNITS;

pub const fn deposit(items: u32, bytes: u32) -> Balance {
items as Balance * 100 * UNITS + (bytes as Balance) * 100 * MILLI_UNITS
}
Expand Down
3 changes: 2 additions & 1 deletion test-utils/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@ pub mod currency {
}

parameter_types! {
pub const ExistentialDeposit: Balance = currency::UNITS;
pub const ExistentialDeposit: Balance = 100 * currency::MILLI_UNITS;

// For weight estimation, we assume that the most locks on an individual account will be 50.
// This number may need to be adjusted in the future if this assumption no longer holds true.
pub const MaxLocks: u32 = 50;
Expand Down

0 comments on commit 5f4d48d

Please sign in to comment.