Skip to content

Commit

Permalink
change(runtime): kusama-runtime-constants -> runtime-constants + …
Browse files Browse the repository at this point in the history
…add constants for kreivo de paseo (#429)
  • Loading branch information
pandres95 authored Oct 27, 2024
1 parent d627119 commit 9bf94c4
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 25 deletions.
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pallet-communities = { default-features = false, path = "pallets/communities" }
pallet-communities-manager = { default-features = false, path = "pallets/communities-manager" }
pallet-payments = { default-features = false, path = "pallets/payments" }

kusama-runtime-constants = { default-features = false, path = "runtime/kusama-runtime-constants" }
runtime-constants = { default-features = false, path = "runtime/runtime-constants" }
runtime-common = { default-features = false, path = "runtime/common" }

# Frame Contrib
Expand Down
4 changes: 2 additions & 2 deletions runtime/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ sp-transaction-pool.workspace = true
sp-version.workspace = true

# Polkadot
kusama-runtime-constants.workspace = true
runtime-constants.workspace = true
polkadot-core-primitives.workspace = true
pallet-xcm.workspace = true
polkadot-runtime-common.workspace = true
Expand Down Expand Up @@ -92,7 +92,7 @@ std = [
"frame-system-benchmarking/std",
"frame-system-rpc-runtime-api/std",
"frame-try-runtime/std",
"kusama-runtime-constants/std",
"runtime-constants/std",
"log/std",
"pallet-assets/std",
"pallet-asset-tx-payment/std",
Expand Down
6 changes: 3 additions & 3 deletions runtime/kreivo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ sp-version.workspace = true
sp-weights.workspace = true

# Polkadot
kusama-runtime-constants.workspace = true
runtime-constants.workspace = true
pallet-xcm.workspace = true
pallet-xcm-benchmarks = { workspace = true, optional = true }
polkadot-core-primitives.workspace = true
Expand Down Expand Up @@ -110,7 +110,7 @@ pallet-referenda-tracks.workspace = true

[features]
default = ["std"]
paseo = []
paseo = ["runtime-constants/paseo"]
std = [
"assets-common/std",
"cumulus-pallet-aura-ext/std",
Expand All @@ -131,7 +131,7 @@ std = [
"frame-system/std",
"fc-traits-memberships/std",
"log/std",
"kusama-runtime-constants/std",
"runtime-constants/std",
"pallet-assets-freezer/std",
"pallet-asset-tx-payment/std",
"pallet-assets/std",
Expand Down
2 changes: 1 addition & 1 deletion runtime/kreivo/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
// limitations under the License.

pub mod currency {
use kusama_runtime_constants as constants;
use polkadot_core_primitives::Balance;
use runtime_constants as constants;

/// The existential deposit. Set to 1/10 of its parent Relay Chain.
pub const EXISTENTIAL_DEPOSIT: Balance = constants::currency::EXISTENTIAL_DEPOSIT / 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
name = "kusama-runtime-constants"
name = "runtime-constants"
repository.workspace = true
version = "1.0.0"

Expand All @@ -19,6 +19,7 @@ xcm-builder.workspace = true

[features]
default = ["std"]
paseo = []
std = [
"frame-support/std",
"polkadot-primitives/std",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,25 @@ pub mod currency {

/// The existential deposit.
pub const EXISTENTIAL_DEPOSIT: Balance = CENTS;

#[cfg(not(feature = "paseo"))]
pub const UNITS: Balance = 1_000_000_000_000;
#[cfg(feature = "paseo")]
pub const UNITS: Balance = 10_000_000_000;

#[cfg(not(feature = "paseo"))]
pub const QUID: Balance = UNITS / 30;

#[cfg(not(feature = "paseo"))]
pub const CENTS: Balance = QUID / 100;
pub const GRAND: Balance = QUID * 1_000;
#[cfg(feature = "paseo")]
pub const CENTS: Balance = UNITS / 100;

#[cfg(not(feature = "paseo"))]
pub const GRAND: Balance = 1_000 * QUID;
#[cfg(feature = "paseo")]
pub const GRAND: Balance = 1_000 * UNITS;

pub const MILLICENTS: Balance = CENTS / 1_000;

pub const fn deposit(items: u32, bytes: u32) -> Balance {
Expand Down

0 comments on commit 9bf94c4

Please sign in to comment.