mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 10:17:57 +00:00
Switch to using ss58-registry crate (#9755)
* Switch to using ss58-registry crate * Custom(42) is now eq to Substrate Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
@@ -23,7 +23,10 @@ use crate::{
|
||||
};
|
||||
use serde_json::json;
|
||||
use sp_core::{
|
||||
crypto::{ExposeSecret, SecretString, Ss58AddressFormat, Ss58Codec, Zeroize},
|
||||
crypto::{
|
||||
unwrap_or_default_ss58_version, ExposeSecret, SecretString, Ss58AddressFormat, Ss58Codec,
|
||||
Zeroize,
|
||||
},
|
||||
hexdisplay::HexDisplay,
|
||||
Pair,
|
||||
};
|
||||
@@ -72,7 +75,7 @@ pub fn print_from_uri<Pair>(
|
||||
let password = password.as_ref().map(|s| s.expose_secret().as_str());
|
||||
if let Ok((pair, seed)) = Pair::from_phrase(uri, password.clone()) {
|
||||
let public_key = pair.public();
|
||||
let network_override = network_override.unwrap_or_default();
|
||||
let network_override = unwrap_or_default_ss58_version(network_override);
|
||||
|
||||
match output {
|
||||
OutputType::Json => {
|
||||
@@ -108,7 +111,7 @@ pub fn print_from_uri<Pair>(
|
||||
}
|
||||
} else if let Ok((pair, seed)) = Pair::from_string_with_seed(uri, password.clone()) {
|
||||
let public_key = pair.public();
|
||||
let network_override = network_override.unwrap_or_default();
|
||||
let network_override = unwrap_or_default_ss58_version(network_override);
|
||||
|
||||
match output {
|
||||
OutputType::Json => {
|
||||
@@ -198,7 +201,7 @@ where
|
||||
let public_key = Pair::Public::try_from(&public)
|
||||
.map_err(|_| "Failed to construct public key from given hex")?;
|
||||
|
||||
let network_override = network_override.unwrap_or_default();
|
||||
let network_override = unwrap_or_default_ss58_version(network_override);
|
||||
|
||||
match output {
|
||||
OutputType::Json => {
|
||||
|
||||
Reference in New Issue
Block a user