From 72292174422a89bdaadf129d1fa5fa4cecf4ec88 Mon Sep 17 00:00:00 2001 From: Shreevatsa N Date: Mon, 11 Nov 2024 11:38:30 +0530 Subject: [PATCH] runtimes: Update existential deposit Signed-off-by: Shreevatsa N --- runtimes/braid/constants/src/lib.rs | 5 +++-- runtimes/loom/constants/src/lib.rs | 5 +++-- test-utils/runtime/src/lib.rs | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/runtimes/braid/constants/src/lib.rs b/runtimes/braid/constants/src/lib.rs index f4272fb65..e90905573 100644 --- a/runtimes/braid/constants/src/lib.rs +++ b/runtimes/braid/constants/src/lib.rs @@ -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 } diff --git a/runtimes/loom/constants/src/lib.rs b/runtimes/loom/constants/src/lib.rs index 7daff497a..ea8a311a0 100644 --- a/runtimes/loom/constants/src/lib.rs +++ b/runtimes/loom/constants/src/lib.rs @@ -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 } diff --git a/test-utils/runtime/src/lib.rs b/test-utils/runtime/src/lib.rs index bfb905d60..dfe1c0f36 100644 --- a/test-utils/runtime/src/lib.rs +++ b/test-utils/runtime/src/lib.rs @@ -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;