diff --git a/Cargo.lock b/Cargo.lock index a95169d..1b34d10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1519,13 +1519,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "common" -version = "0.1.0" -dependencies = [ - "polkadot-core-primitives", -] - [[package]] name = "common" version = "0.1.0" @@ -7311,7 +7304,6 @@ version = "0.1.0" dependencies = [ "clap", "color-print", - "common 0.1.0", "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-aura", @@ -7367,7 +7359,6 @@ dependencies = [ name = "parachain-template-runtime" version = "0.1.0" dependencies = [ - "common 0.1.0", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -9493,7 +9484,7 @@ dependencies = [ "ark-serialize", "ark-std", "blake2 0.10.6", - "common 0.1.0 (git+https://github.com/w3f/ring-proof)", + "common", "fflonk", "merlin 3.0.0", ] diff --git a/Cargo.toml b/Cargo.toml index 83c060f..138eaa2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = [ "common", "node", "pallets/template", "runtime"] +members = [ "node", "pallets/template", "runtime"] package.edition = "2021" package.repository = "https://github.com/paritytech/polkadot-sdk" resolver = "2" diff --git a/node/Cargo.toml b/node/Cargo.toml index c9e5d2c..24d5ff8 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -20,7 +20,6 @@ futures = "0.3.28" # Local parachain-template-runtime = { path = "../runtime" } -common = { path = "../common" } # Substrate frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false } diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index f39e0ff..e352738 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -1,6 +1,7 @@ -use common::EXISTENTIAL_DEPOSIT; use cumulus_primitives_core::ParaId; -use parachain_template_runtime::{AccountId, AuraId, Signature}; +use parachain_template_runtime::{ + constants::currency::EXISTENTIAL_DEPOSIT, AccountId, AuraId, Signature, +}; use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup}; use sc_service::ChainType; use serde::{Deserialize, Serialize}; diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index edaa510..e165a39 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -27,7 +27,6 @@ smallvec = "1.11.0" # Local pallet-parachain-template = { path = "../pallets/template", default-features = false } -common = { path = "../common", default-features = false } # Substrate frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false, optional = true } diff --git a/runtime/src/constants.rs b/runtime/src/constants.rs index f1833cf..b3a1690 100644 --- a/runtime/src/constants.rs +++ b/runtime/src/constants.rs @@ -1,10 +1,13 @@ pub mod currency { use crate::Balance; + pub const MICROCENTS: Balance = 1_000_000; pub const MILLICENTS: Balance = 1_000_000_000; pub const CENTS: Balance = 1_000 * MILLICENTS; // assume this is worth about a cent. pub const DOLLARS: Balance = 100 * CENTS; + pub const EXISTENTIAL_DEPOSIT: Balance = MILLICENTS; + pub const fn deposit(items: u32, bytes: u32) -> Balance { items as Balance * 15 * CENTS + (bytes as Balance) * 6 * CENTS } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 2ecf304..9d95b86 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -11,7 +11,7 @@ mod weights; pub mod xcm_config; use codec::{Decode, Encode, MaxEncodedLen}; -use common::{deposit, EXISTENTIAL_DEPOSIT, MICROUNIT, MILLIUNIT}; +use constants::currency::{deposit, EXISTENTIAL_DEPOSIT, MICROCENTS, MILLICENTS}; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; use cumulus_primitives_core::ParaId; use frame_support::{ @@ -140,7 +140,7 @@ impl WeightToFeePolynomial for WeightToFee { fn polynomial() -> WeightToFeeCoefficients { // in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1 // MILLIUNIT: in our template, we map to 1/10 of that, or 1/10 MILLIUNIT - let p = MILLIUNIT / 10; + let p = MILLICENTS / 10; let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); smallvec![WeightToFeeCoefficient { degree: 1, @@ -428,7 +428,7 @@ impl pallet_balances::Config for Runtime { parameter_types! { /// Relay Chain `TransactionByteFee` / 10 - pub const TransactionByteFee: Balance = 10 * MICROUNIT; + pub const TransactionByteFee: Balance = 10 * MICROCENTS; } impl pallet_transaction_payment::Config for Runtime {