mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07:58 +00:00
Companion PR for ss58 crate (#3953)
* Companion PR for ss58 crate * cargo fmt * Rename * into() * into() * updating substrate (ideally use bot merge)
This commit is contained in:
@@ -19,6 +19,7 @@ use futures::future::TryFutureExt;
|
||||
use log::info;
|
||||
use sc_cli::{Role, RuntimeVersion, SubstrateCli};
|
||||
use service::{self, IdentifyVariant};
|
||||
use sp_core::crypto::Ss58AddressFormatRegistry;
|
||||
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
pub enum Error {
|
||||
@@ -191,15 +192,14 @@ impl SubstrateCli for Cli {
|
||||
}
|
||||
|
||||
fn set_default_ss58_version(spec: &Box<dyn service::ChainSpec>) {
|
||||
use sp_core::crypto::Ss58AddressFormat;
|
||||
|
||||
let ss58_version = if spec.is_kusama() {
|
||||
Ss58AddressFormat::KusamaAccount
|
||||
Ss58AddressFormatRegistry::KusamaAccount
|
||||
} else if spec.is_westend() {
|
||||
Ss58AddressFormat::SubstrateAccount
|
||||
Ss58AddressFormatRegistry::SubstrateAccount
|
||||
} else {
|
||||
Ss58AddressFormat::PolkadotAccount
|
||||
};
|
||||
Ss58AddressFormatRegistry::PolkadotAccount
|
||||
}
|
||||
.into();
|
||||
|
||||
sp_core::crypto::set_default_ss58_version(ss58_version);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user