diff --git a/Cargo.lock b/Cargo.lock index 4154fef4a57..94c1ba8d319 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3868,6 +3868,7 @@ dependencies = [ "futures", "gear-core", "gear-core-errors", + "gear-runtime-primitives", "gmeta", "gsdk", "hex", @@ -3887,7 +3888,6 @@ dependencies = [ "sp-io", "thiserror", "tokio", - "vara-runtime", "wasmi 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", "which", "whoami", diff --git a/gcli/Cargo.toml b/gcli/Cargo.toml index 5ae78c79334..3bb0dcb1b35 100644 --- a/gcli/Cargo.toml +++ b/gcli/Cargo.toml @@ -42,6 +42,7 @@ reqwest = { workspace = true, default-features = false, features = [ "json", "ru etc.workspace = true sp-io = { workspace = true, features = [ "std" ] } sp-core = { workspace = true, features = [ "std" ] } +runtime-primitives.workspace = true # TODO: use wasmi from workspace (#3214) wasmi = { version = "0.30.0", features = ["std"] } @@ -51,7 +52,6 @@ demo-messager.workspace = true demo-new-meta.workspace = true demo-waiter.workspace = true gsdk = { workspace = true, features = ["testing"] } -vara-runtime = { workspace = true, features = [ "std", "dev" ] } [build-dependencies] which.workspace = true diff --git a/gcli/src/app.rs b/gcli/src/app.rs index 0946db8cff2..7075d13b86d 100644 --- a/gcli/src/app.rs +++ b/gcli/src/app.rs @@ -111,7 +111,7 @@ pub trait App: Parser + Sync { /// and verbose level. async fn run(&self) -> Result<()> { color_eyre::install()?; - sp_core::crypto::set_default_ss58_version(crate::VARA_SS58_PREFIX.into()); + sp_core::crypto::set_default_ss58_version(runtime_primitives::VARA_SS58_PREFIX.into()); let name = Self::command().get_name().to_string(); let filter = match self.verbose() { diff --git a/gcli/tests/gear.rs b/gcli/tests/gear.rs index 9793fc60be5..a815d2d96d5 100644 --- a/gcli/tests/gear.rs +++ b/gcli/tests/gear.rs @@ -46,8 +46,3 @@ fn paths() { } }) } - -#[test] -fn ss58_prefix() { - assert_eq!(gcli::VARA_SS58_PREFIX, vara_runtime::SS58Prefix::get()); -} diff --git a/runtime/primitives/src/lib.rs b/runtime/primitives/src/lib.rs index 392a9e6757d..afb433ef6e2 100644 --- a/runtime/primitives/src/lib.rs +++ b/runtime/primitives/src/lib.rs @@ -68,3 +68,6 @@ pub type Header = generic::Header; pub type Block = generic::Block; /// Block ID. pub type BlockId = generic::BlockId; + +/// SS58 prefix of VARA. +pub const VARA_SS58_PREFIX: u8 = 137; diff --git a/runtime/vara/src/lib.rs b/runtime/vara/src/lib.rs index 8b01682a855..155634420e6 100644 --- a/runtime/vara/src/lib.rs +++ b/runtime/vara/src/lib.rs @@ -75,7 +75,7 @@ pub use runtime_common::{ impl_runtime_apis_plus_common, BlockHashCount, DealWithFees, AVERAGE_ON_INITIALIZE_RATIO, GAS_LIMIT_MIN_PERCENTAGE_NUM, NORMAL_DISPATCH_RATIO, VALUE_PER_GAS, }; -pub use runtime_primitives::{AccountId, Signature}; +pub use runtime_primitives::{AccountId, Signature, VARA_SS58_PREFIX}; use runtime_primitives::{Balance, BlockNumber, Hash, Index, Moment}; use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, ConstBool, ConstU64, OpaqueMetadata, H256}; @@ -189,7 +189,7 @@ pub fn native_version() -> NativeVersion { parameter_types! { pub const Version: RuntimeVersion = VERSION; - pub const SS58Prefix: u8 = 137; + pub const SS58Prefix: u8 = VARA_SS58_PREFIX; pub RuntimeBlockWeights: BlockWeights = runtime_common::block_weights_for(MAXIMUM_BLOCK_WEIGHT); pub RuntimeBlockLength: BlockLength = BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);