From 9179349660d9b3cc537f60b71827dbb74d675ae0 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Mon, 31 Jan 2022 14:13:44 +0300 Subject: [PATCH 1/2] fix ss58 prefixes of Polkadot, Kusama and Westend --- relays/bin-substrate/src/chains/kusama.rs | 2 +- relays/bin-substrate/src/chains/polkadot.rs | 2 +- relays/bin-substrate/src/chains/westend.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/relays/bin-substrate/src/chains/kusama.rs b/relays/bin-substrate/src/chains/kusama.rs index 10afbdd8a5..8f3ea013a2 100644 --- a/relays/bin-substrate/src/chains/kusama.rs +++ b/relays/bin-substrate/src/chains/kusama.rs @@ -81,7 +81,7 @@ impl CliChain for Kusama { type MessagePayload = (); fn ss58_format() -> u16 { - 42 + sp_core::crypto::Ss58AddressFormat::from(sp_core::crypto::Ss58AddressFormatRegistry::KusamaAccount).into() } fn encode_message( diff --git a/relays/bin-substrate/src/chains/polkadot.rs b/relays/bin-substrate/src/chains/polkadot.rs index 8c31792a54..1bd64c6fb8 100644 --- a/relays/bin-substrate/src/chains/polkadot.rs +++ b/relays/bin-substrate/src/chains/polkadot.rs @@ -81,7 +81,7 @@ impl CliChain for Polkadot { type MessagePayload = (); fn ss58_format() -> u16 { - 42 + sp_core::crypto::Ss58AddressFormat::from(sp_core::crypto::Ss58AddressFormatRegistry::PolkadotAccount).into() } fn encode_message( diff --git a/relays/bin-substrate/src/chains/westend.rs b/relays/bin-substrate/src/chains/westend.rs index 5a3dd9956d..9bc45bdddf 100644 --- a/relays/bin-substrate/src/chains/westend.rs +++ b/relays/bin-substrate/src/chains/westend.rs @@ -28,7 +28,7 @@ impl CliChain for Westend { type MessagePayload = (); fn ss58_format() -> u16 { - 42 + sp_core::crypto::Ss58AddressFormat::from(sp_core::crypto::Ss58AddressFormatRegistry::SubstrateAccount).into() } fn encode_message( From f796ee1df86271d1334bb45067e8f4695da12f95 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Mon, 31 Jan 2022 14:19:15 +0300 Subject: [PATCH 2/2] fmt --- relays/bin-substrate/src/chains/kusama.rs | 5 ++++- relays/bin-substrate/src/chains/polkadot.rs | 5 ++++- relays/bin-substrate/src/chains/westend.rs | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/relays/bin-substrate/src/chains/kusama.rs b/relays/bin-substrate/src/chains/kusama.rs index 8f3ea013a2..5a65426c9d 100644 --- a/relays/bin-substrate/src/chains/kusama.rs +++ b/relays/bin-substrate/src/chains/kusama.rs @@ -81,7 +81,10 @@ impl CliChain for Kusama { type MessagePayload = (); fn ss58_format() -> u16 { - sp_core::crypto::Ss58AddressFormat::from(sp_core::crypto::Ss58AddressFormatRegistry::KusamaAccount).into() + sp_core::crypto::Ss58AddressFormat::from( + sp_core::crypto::Ss58AddressFormatRegistry::KusamaAccount, + ) + .into() } fn encode_message( diff --git a/relays/bin-substrate/src/chains/polkadot.rs b/relays/bin-substrate/src/chains/polkadot.rs index 1bd64c6fb8..16d44f4687 100644 --- a/relays/bin-substrate/src/chains/polkadot.rs +++ b/relays/bin-substrate/src/chains/polkadot.rs @@ -81,7 +81,10 @@ impl CliChain for Polkadot { type MessagePayload = (); fn ss58_format() -> u16 { - sp_core::crypto::Ss58AddressFormat::from(sp_core::crypto::Ss58AddressFormatRegistry::PolkadotAccount).into() + sp_core::crypto::Ss58AddressFormat::from( + sp_core::crypto::Ss58AddressFormatRegistry::PolkadotAccount, + ) + .into() } fn encode_message( diff --git a/relays/bin-substrate/src/chains/westend.rs b/relays/bin-substrate/src/chains/westend.rs index 9bc45bdddf..8d3b5db9ab 100644 --- a/relays/bin-substrate/src/chains/westend.rs +++ b/relays/bin-substrate/src/chains/westend.rs @@ -28,7 +28,10 @@ impl CliChain for Westend { type MessagePayload = (); fn ss58_format() -> u16 { - sp_core::crypto::Ss58AddressFormat::from(sp_core::crypto::Ss58AddressFormatRegistry::SubstrateAccount).into() + sp_core::crypto::Ss58AddressFormat::from( + sp_core::crypto::Ss58AddressFormatRegistry::SubstrateAccount, + ) + .into() } fn encode_message(