mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
Change account names to something meaningful (#1497)
* change testnets account "names" to something meaningful * fixes * fix doc * fmt * account names as consts * fmt * spelling
This commit is contained in:
committed by
Bastian Köcher
parent
00f1225b19
commit
d327b25724
@@ -15,7 +15,6 @@
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use beefy_primitives::crypto::AuthorityId as BeefyId;
|
||||
use bp_millau::derive_account_from_rialto_id;
|
||||
use millau_runtime::{
|
||||
AccountId, AuraConfig, BalancesConfig, BeefyConfig, BridgeRialtoMessagesConfig,
|
||||
BridgeRialtoParachainMessagesConfig, BridgeWestendGrandpaConfig, GenesisConfig, GrandpaConfig,
|
||||
@@ -26,6 +25,21 @@ use sp_core::{sr25519, Pair, Public};
|
||||
use sp_finality_grandpa::AuthorityId as GrandpaId;
|
||||
use sp_runtime::traits::{IdentifyAccount, Verify};
|
||||
|
||||
/// "Names" of the authorities accounts at local testnet.
|
||||
const LOCAL_AUTHORITIES_ACCOUNTS: [&str; 5] = ["Alice", "Bob", "Charlie", "Dave", "Eve"];
|
||||
/// "Names" of the authorities accounts at development testnet.
|
||||
const DEV_AUTHORITIES_ACCOUNTS: [&str; 1] = [LOCAL_AUTHORITIES_ACCOUNTS[0]];
|
||||
/// "Names" of all possible authorities accounts.
|
||||
const ALL_AUTHORITIES_ACCOUNTS: [&str; 5] = LOCAL_AUTHORITIES_ACCOUNTS;
|
||||
/// "Name" of the `sudo` account.
|
||||
const SUDO_ACCOUNT: &str = "Sudo";
|
||||
/// "Name" of the account, which owns the with-Westend GRANDPA pallet.
|
||||
const WESTEND_GRANDPA_PALLET_OWNER: &str = "Westend.GrandpaOwner";
|
||||
/// "Name" of the account, which owns the with-Rialto messages pallet.
|
||||
const RIALTO_MESSAGES_PALLET_OWNER: &str = "Rialto.MessagesOwner";
|
||||
/// "Name" of the account, which owns the with-RialtoParachain messages pallet.
|
||||
const RIALTO_PARACHAIN_MESSAGES_PALLET_OWNER: &str = "RialtoParachain.MessagesOwner";
|
||||
|
||||
/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
|
||||
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig>;
|
||||
|
||||
@@ -86,8 +100,11 @@ impl Alternative {
|
||||
sc_service::ChainType::Development,
|
||||
|| {
|
||||
testnet_genesis(
|
||||
vec![get_authority_keys_from_seed("Alice")],
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
DEV_AUTHORITIES_ACCOUNTS
|
||||
.into_iter()
|
||||
.map(get_authority_keys_from_seed)
|
||||
.collect(),
|
||||
get_account_id_from_seed::<sr25519::Public>(SUDO_ACCOUNT),
|
||||
endowed_accounts(),
|
||||
true,
|
||||
)
|
||||
@@ -105,14 +122,11 @@ impl Alternative {
|
||||
sc_service::ChainType::Local,
|
||||
|| {
|
||||
testnet_genesis(
|
||||
vec![
|
||||
get_authority_keys_from_seed("Alice"),
|
||||
get_authority_keys_from_seed("Bob"),
|
||||
get_authority_keys_from_seed("Charlie"),
|
||||
get_authority_keys_from_seed("Dave"),
|
||||
get_authority_keys_from_seed("Eve"),
|
||||
],
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
LOCAL_AUTHORITIES_ACCOUNTS
|
||||
.into_iter()
|
||||
.map(get_authority_keys_from_seed)
|
||||
.collect(),
|
||||
get_account_id_from_seed::<sr25519::Public>(SUDO_ACCOUNT),
|
||||
endowed_accounts(),
|
||||
true,
|
||||
)
|
||||
@@ -133,56 +147,39 @@ impl Alternative {
|
||||
/// accounts used by relayers in our test deployments, accounts used for demonstration
|
||||
/// purposes), are all available on these chains.
|
||||
fn endowed_accounts() -> Vec<AccountId> {
|
||||
let all_authorities = ALL_AUTHORITIES_ACCOUNTS.iter().flat_map(|x| {
|
||||
[
|
||||
get_account_id_from_seed::<sr25519::Public>(x),
|
||||
get_account_id_from_seed::<sr25519::Public>(&format!("{}//stash", x)),
|
||||
]
|
||||
});
|
||||
vec![
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Charlie"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Dave"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Eve"),
|
||||
// Sudo account
|
||||
get_account_id_from_seed::<sr25519::Public>(SUDO_ACCOUNT),
|
||||
// Regular (unused) accounts
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
|
||||
get_account_id_from_seed::<sr25519::Public>("George"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Harry"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Iden"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Ken"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Leon"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Mary"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("George//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Harry//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Iden//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Ken//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Leon//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Mary//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("RialtoMessagesOwner"),
|
||||
get_account_id_from_seed::<sr25519::Public>("RialtoParachainMessagesOwner"),
|
||||
pallet_bridge_messages::relayer_fund_account_id::<
|
||||
bp_millau::AccountId,
|
||||
bp_millau::AccountIdConverter,
|
||||
>(),
|
||||
derive_account_from_rialto_id(bp_runtime::SourceAccount::Account(
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
)),
|
||||
derive_account_from_rialto_id(bp_runtime::SourceAccount::Account(
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob"),
|
||||
)),
|
||||
derive_account_from_rialto_id(bp_runtime::SourceAccount::Account(
|
||||
get_account_id_from_seed::<sr25519::Public>("Charlie"),
|
||||
)),
|
||||
derive_account_from_rialto_id(bp_runtime::SourceAccount::Account(
|
||||
get_account_id_from_seed::<sr25519::Public>("Dave"),
|
||||
)),
|
||||
derive_account_from_rialto_id(bp_runtime::SourceAccount::Account(
|
||||
get_account_id_from_seed::<sr25519::Public>("Eve"),
|
||||
)),
|
||||
derive_account_from_rialto_id(bp_runtime::SourceAccount::Account(
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
|
||||
)),
|
||||
// Accounts, used by Westend<>Millau bridge
|
||||
get_account_id_from_seed::<sr25519::Public>(WESTEND_GRANDPA_PALLET_OWNER),
|
||||
get_account_id_from_seed::<sr25519::Public>("Westend.HeadersRelay1"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Westend.HeadersRelay2"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Westend.WestmintHeaders1"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Westend.WestmintHeaders2"),
|
||||
// Accounts, used by Rialto<>Millau bridge
|
||||
get_account_id_from_seed::<sr25519::Public>(RIALTO_MESSAGES_PALLET_OWNER),
|
||||
get_account_id_from_seed::<sr25519::Public>("Rialto.HeadersAndMessagesRelay"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Rialto.OutboundMessagesRelay.Lane00000001"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Rialto.InboundMessagesRelay.Lane00000001"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Rialto.MessagesSender"),
|
||||
// Accounts, used by RialtoParachain<>Millau bridge
|
||||
get_account_id_from_seed::<sr25519::Public>(RIALTO_PARACHAIN_MESSAGES_PALLET_OWNER),
|
||||
get_account_id_from_seed::<sr25519::Public>("RialtoParachain.HeadersAndMessagesRelay"),
|
||||
get_account_id_from_seed::<sr25519::Public>("RialtoParachain.RialtoHeadersRelay"),
|
||||
get_account_id_from_seed::<sr25519::Public>("RialtoParachain.MessagesSender"),
|
||||
]
|
||||
.into_iter()
|
||||
.chain(all_authorities)
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn session_keys(aura: AuraId, beefy: BeefyId, grandpa: GrandpaId) -> SessionKeys {
|
||||
@@ -217,28 +214,20 @@ fn testnet_genesis(
|
||||
bridge_westend_grandpa: BridgeWestendGrandpaConfig {
|
||||
// for our deployments to avoid multiple same-nonces transactions:
|
||||
// //Alice is already used to initialize Rialto<->Millau bridge
|
||||
// => let's use //George to initialize Westend->Millau bridge
|
||||
owner: Some(get_account_id_from_seed::<sr25519::Public>("George")),
|
||||
// => let's use //Westend.GrandpaOwner to initialize Westend->Millau bridge
|
||||
owner: Some(get_account_id_from_seed::<sr25519::Public>(WESTEND_GRANDPA_PALLET_OWNER)),
|
||||
..Default::default()
|
||||
},
|
||||
bridge_rialto_messages: BridgeRialtoMessagesConfig {
|
||||
owner: Some(get_account_id_from_seed::<sr25519::Public>("RialtoMessagesOwner")),
|
||||
owner: Some(get_account_id_from_seed::<sr25519::Public>(RIALTO_MESSAGES_PALLET_OWNER)),
|
||||
..Default::default()
|
||||
},
|
||||
bridge_rialto_parachain_messages: BridgeRialtoParachainMessagesConfig {
|
||||
owner: Some(get_account_id_from_seed::<sr25519::Public>(
|
||||
"RialtoParachainMessagesOwner",
|
||||
RIALTO_PARACHAIN_MESSAGES_PALLET_OWNER,
|
||||
)),
|
||||
..Default::default()
|
||||
},
|
||||
xcm_pallet: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn derived_dave_account_is_as_expected() {
|
||||
let dave = get_account_id_from_seed::<sr25519::Public>("Dave");
|
||||
let derived: AccountId =
|
||||
derive_account_from_rialto_id(bp_runtime::SourceAccount::Account(dave));
|
||||
assert_eq!(derived.to_string(), "5DNW6UVnb7TN6wX5KwXtDYR3Eccecbdzuw89HqjyNfkzce6J".to_string());
|
||||
}
|
||||
|
||||
@@ -22,6 +22,17 @@ use serde::{Deserialize, Serialize};
|
||||
use sp_core::{sr25519, Pair, Public};
|
||||
use sp_runtime::traits::{IdentifyAccount, Verify};
|
||||
|
||||
/// "Names" of the authorities accounts at local testnet.
|
||||
const LOCAL_AUTHORITIES_ACCOUNTS: [&str; 2] = ["Alice", "Bob"];
|
||||
/// "Names" of the authorities accounts at development testnet.
|
||||
const DEV_AUTHORITIES_ACCOUNTS: [&str; 2] = LOCAL_AUTHORITIES_ACCOUNTS;
|
||||
/// "Names" of all possible authorities accounts.
|
||||
const ALL_AUTHORITIES_ACCOUNTS: [&str; 2] = LOCAL_AUTHORITIES_ACCOUNTS;
|
||||
/// "Name" of the `sudo` account.
|
||||
const SUDO_ACCOUNT: &str = "Sudo";
|
||||
/// "Name" of the account, which owns the with-Millau messages pallet.
|
||||
const MILLAU_MESSAGES_PALLET_OWNER: &str = "Millau.MessagesOwner";
|
||||
|
||||
/// Specialized `ChainSpec` for the normal parachain runtime.
|
||||
pub type ChainSpec =
|
||||
sc_service::GenericChainSpec<rialto_parachain_runtime::GenesisConfig, Extensions>;
|
||||
@@ -67,27 +78,32 @@ where
|
||||
/// accounts used by relayers in our test deployments, accounts used for demonstration
|
||||
/// purposes), are all available on these chains.
|
||||
fn endowed_accounts() -> Vec<AccountId> {
|
||||
let all_authorities = ALL_AUTHORITIES_ACCOUNTS.iter().flat_map(|x| {
|
||||
[
|
||||
get_account_id_from_seed::<sr25519::Public>(x),
|
||||
get_account_id_from_seed::<sr25519::Public>(&format!("{}//stash", x)),
|
||||
]
|
||||
});
|
||||
vec![
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob"),
|
||||
// Sudo account
|
||||
get_account_id_from_seed::<sr25519::Public>(SUDO_ACCOUNT),
|
||||
// Regular (unused) accounts
|
||||
get_account_id_from_seed::<sr25519::Public>("Charlie"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Dave"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Eve"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
|
||||
get_account_id_from_seed::<sr25519::Public>("George"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("George//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("MillauMessagesOwner"),
|
||||
pallet_bridge_messages::relayer_fund_account_id::<
|
||||
bp_rialto_parachain::AccountId,
|
||||
bp_rialto_parachain::AccountIdConverter,
|
||||
>(),
|
||||
// Accounts, used by RialtoParachain<>Millau bridge
|
||||
get_account_id_from_seed::<sr25519::Public>(MILLAU_MESSAGES_PALLET_OWNER),
|
||||
get_account_id_from_seed::<sr25519::Public>("Millau.HeadersAndMessagesRelay"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Millau.MessagesSender"),
|
||||
]
|
||||
.into_iter()
|
||||
.chain(all_authorities)
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn development_config(id: ParaId) -> ChainSpec {
|
||||
@@ -104,8 +120,11 @@ pub fn development_config(id: ParaId) -> ChainSpec {
|
||||
ChainType::Local,
|
||||
move || {
|
||||
testnet_genesis(
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
vec![get_from_seed::<AuraId>("Alice"), get_from_seed::<AuraId>("Bob")],
|
||||
get_account_id_from_seed::<sr25519::Public>(SUDO_ACCOUNT),
|
||||
DEV_AUTHORITIES_ACCOUNTS
|
||||
.into_iter()
|
||||
.map(|x| get_from_seed::<AuraId>(x))
|
||||
.collect(),
|
||||
endowed_accounts(),
|
||||
id,
|
||||
)
|
||||
@@ -136,8 +155,11 @@ pub fn local_testnet_config(id: ParaId) -> ChainSpec {
|
||||
ChainType::Local,
|
||||
move || {
|
||||
testnet_genesis(
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
vec![get_from_seed::<AuraId>("Alice"), get_from_seed::<AuraId>("Bob")],
|
||||
get_account_id_from_seed::<sr25519::Public>(SUDO_ACCOUNT),
|
||||
LOCAL_AUTHORITIES_ACCOUNTS
|
||||
.into_iter()
|
||||
.map(|x| get_from_seed::<AuraId>(x))
|
||||
.collect(),
|
||||
endowed_accounts(),
|
||||
id,
|
||||
)
|
||||
@@ -174,7 +196,7 @@ fn testnet_genesis(
|
||||
aura: rialto_parachain_runtime::AuraConfig { authorities: initial_authorities },
|
||||
aura_ext: Default::default(),
|
||||
bridge_millau_messages: BridgeMillauMessagesConfig {
|
||||
owner: Some(get_account_id_from_seed::<sr25519::Public>("MillauMessagesOwner")),
|
||||
owner: Some(get_account_id_from_seed::<sr25519::Public>(MILLAU_MESSAGES_PALLET_OWNER)),
|
||||
..Default::default()
|
||||
},
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use beefy_primitives::crypto::AuthorityId as BeefyId;
|
||||
use bp_rialto::derive_account_from_millau_id;
|
||||
use polkadot_primitives::v2::{AssignmentId, ValidatorId};
|
||||
use rialto_runtime::{
|
||||
AccountId, BabeConfig, BalancesConfig, BeefyConfig, BridgeMillauMessagesConfig,
|
||||
@@ -29,6 +28,17 @@ use sp_core::{sr25519, Pair, Public};
|
||||
use sp_finality_grandpa::AuthorityId as GrandpaId;
|
||||
use sp_runtime::traits::{IdentifyAccount, Verify};
|
||||
|
||||
/// "Names" of the authorities accounts at local testnet.
|
||||
const LOCAL_AUTHORITIES_ACCOUNTS: [&str; 5] = ["Alice", "Bob", "Charlie", "Dave", "Eve"];
|
||||
/// "Names" of the authorities accounts at development testnet.
|
||||
const DEV_AUTHORITIES_ACCOUNTS: [&str; 1] = [LOCAL_AUTHORITIES_ACCOUNTS[0]];
|
||||
/// "Names" of all possible authorities accounts.
|
||||
const ALL_AUTHORITIES_ACCOUNTS: [&str; 5] = LOCAL_AUTHORITIES_ACCOUNTS;
|
||||
/// "Name" of the `sudo` account.
|
||||
const SUDO_ACCOUNT: &str = "Sudo";
|
||||
/// "Name" of the account, which owns the with-Millau messages pallet.
|
||||
const MILLAU_MESSAGES_PALLET_OWNER: &str = "Millau.MessagesOwner";
|
||||
|
||||
/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
|
||||
pub type ChainSpec =
|
||||
sc_service::GenericChainSpec<GenesisConfig, polkadot_service::chain_spec::Extensions>;
|
||||
@@ -95,8 +105,11 @@ impl Alternative {
|
||||
sc_service::ChainType::Development,
|
||||
|| {
|
||||
testnet_genesis(
|
||||
vec![get_authority_keys_from_seed("Alice")],
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
DEV_AUTHORITIES_ACCOUNTS
|
||||
.into_iter()
|
||||
.map(get_authority_keys_from_seed)
|
||||
.collect(),
|
||||
get_account_id_from_seed::<sr25519::Public>(SUDO_ACCOUNT),
|
||||
endowed_accounts(),
|
||||
true,
|
||||
)
|
||||
@@ -114,14 +127,11 @@ impl Alternative {
|
||||
sc_service::ChainType::Local,
|
||||
|| {
|
||||
testnet_genesis(
|
||||
vec![
|
||||
get_authority_keys_from_seed("Alice"),
|
||||
get_authority_keys_from_seed("Bob"),
|
||||
get_authority_keys_from_seed("Charlie"),
|
||||
get_authority_keys_from_seed("Dave"),
|
||||
get_authority_keys_from_seed("Eve"),
|
||||
],
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
LOCAL_AUTHORITIES_ACCOUNTS
|
||||
.into_iter()
|
||||
.map(get_authority_keys_from_seed)
|
||||
.collect(),
|
||||
get_account_id_from_seed::<sr25519::Public>(SUDO_ACCOUNT),
|
||||
endowed_accounts(),
|
||||
true,
|
||||
)
|
||||
@@ -142,48 +152,28 @@ impl Alternative {
|
||||
/// accounts used by relayers in our test deployments, accounts used for demonstration
|
||||
/// purposes), are all available on these chains.
|
||||
fn endowed_accounts() -> Vec<AccountId> {
|
||||
let all_authorities = ALL_AUTHORITIES_ACCOUNTS.iter().flat_map(|x| {
|
||||
[
|
||||
get_account_id_from_seed::<sr25519::Public>(x),
|
||||
get_account_id_from_seed::<sr25519::Public>(&format!("{}//stash", x)),
|
||||
]
|
||||
});
|
||||
vec![
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Charlie"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Dave"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Eve"),
|
||||
// Sudo account
|
||||
get_account_id_from_seed::<sr25519::Public>(SUDO_ACCOUNT),
|
||||
// Regular (unused) accounts
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
|
||||
get_account_id_from_seed::<sr25519::Public>("George"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Harry"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("George//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Harry//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("MillauMessagesOwner"),
|
||||
get_account_id_from_seed::<sr25519::Public>("WithMillauTokenSwap"),
|
||||
pallet_bridge_messages::relayer_fund_account_id::<
|
||||
bp_rialto::AccountId,
|
||||
bp_rialto::AccountIdConverter,
|
||||
>(),
|
||||
derive_account_from_millau_id(bp_runtime::SourceAccount::Account(
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
)),
|
||||
derive_account_from_millau_id(bp_runtime::SourceAccount::Account(
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob"),
|
||||
)),
|
||||
derive_account_from_millau_id(bp_runtime::SourceAccount::Account(
|
||||
get_account_id_from_seed::<sr25519::Public>("Charlie"),
|
||||
)),
|
||||
derive_account_from_millau_id(bp_runtime::SourceAccount::Account(
|
||||
get_account_id_from_seed::<sr25519::Public>("Dave"),
|
||||
)),
|
||||
derive_account_from_millau_id(bp_runtime::SourceAccount::Account(
|
||||
get_account_id_from_seed::<sr25519::Public>("Eve"),
|
||||
)),
|
||||
derive_account_from_millau_id(bp_runtime::SourceAccount::Account(
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
|
||||
)),
|
||||
// Accounts, used by Rialto<>Millau bridge
|
||||
get_account_id_from_seed::<sr25519::Public>(MILLAU_MESSAGES_PALLET_OWNER),
|
||||
get_account_id_from_seed::<sr25519::Public>("Millau.HeadersAndMessagesRelay"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Millau.OutboundMessagesRelay.Lane00000001"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Millau.InboundMessagesRelay.Lane00000001"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Millau.MessagesSender"),
|
||||
]
|
||||
.into_iter()
|
||||
.chain(all_authorities)
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn session_keys(
|
||||
@@ -287,17 +277,9 @@ fn testnet_genesis(
|
||||
},
|
||||
paras: Default::default(),
|
||||
bridge_millau_messages: BridgeMillauMessagesConfig {
|
||||
owner: Some(get_account_id_from_seed::<sr25519::Public>("MillauMessagesOwner")),
|
||||
owner: Some(get_account_id_from_seed::<sr25519::Public>(MILLAU_MESSAGES_PALLET_OWNER)),
|
||||
..Default::default()
|
||||
},
|
||||
xcm_pallet: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn derived_dave_account_is_as_expected() {
|
||||
let dave = get_account_id_from_seed::<sr25519::Public>("Dave");
|
||||
let derived: AccountId =
|
||||
derive_account_from_millau_id(bp_runtime::SourceAccount::Account(dave));
|
||||
assert_eq!(derived.to_string(), "5HZhdv53gSJmWWtD8XR5Ypu4PgbT5JNWwGw2mkE75cN61w9t".to_string());
|
||||
}
|
||||
|
||||
@@ -754,7 +754,7 @@ mod tests {
|
||||
"--millau-signer",
|
||||
"//Charlie",
|
||||
"--millau-messages-pallet-owner",
|
||||
"//RialtoMessagesOwner",
|
||||
"//Rialto.MessagesOwner",
|
||||
"--millau-transactions-mortality",
|
||||
"64",
|
||||
"--rialto-host",
|
||||
@@ -764,7 +764,7 @@ mod tests {
|
||||
"--rialto-signer",
|
||||
"//Charlie",
|
||||
"--rialto-messages-pallet-owner",
|
||||
"//MillauMessagesOwner",
|
||||
"//Millau.MessagesOwner",
|
||||
"--rialto-transactions-mortality",
|
||||
"64",
|
||||
"--lane",
|
||||
@@ -811,7 +811,7 @@ mod tests {
|
||||
millau_transactions_mortality: Some(64),
|
||||
},
|
||||
left_messages_pallet_owner: MillauMessagesPalletOwnerSigningParams {
|
||||
millau_messages_pallet_owner: Some("//RialtoMessagesOwner".into()),
|
||||
millau_messages_pallet_owner: Some("//Rialto.MessagesOwner".into()),
|
||||
millau_messages_pallet_owner_password: None,
|
||||
},
|
||||
left_headers_to_right_sign_override: MillauHeadersToRialtoSigningParams {
|
||||
@@ -839,7 +839,7 @@ mod tests {
|
||||
rialto_transactions_mortality: Some(64),
|
||||
},
|
||||
right_messages_pallet_owner: RialtoMessagesPalletOwnerSigningParams {
|
||||
rialto_messages_pallet_owner: Some("//MillauMessagesOwner".into()),
|
||||
rialto_messages_pallet_owner: Some("//Millau.MessagesOwner".into()),
|
||||
rialto_messages_pallet_owner_password: None,
|
||||
},
|
||||
right_headers_to_left_sign_override: RialtoHeadersToMillauSigningParams {
|
||||
@@ -868,7 +868,7 @@ mod tests {
|
||||
"--rialto-headers-to-millau-signer",
|
||||
"//Ken",
|
||||
"--millau-messages-pallet-owner",
|
||||
"//RialtoParachainMessagesOwner",
|
||||
"//RialtoParachain.MessagesOwner",
|
||||
"--millau-transactions-mortality",
|
||||
"64",
|
||||
"--rialto-parachain-host",
|
||||
@@ -878,7 +878,7 @@ mod tests {
|
||||
"--rialto-parachain-signer",
|
||||
"//George",
|
||||
"--rialto-parachain-messages-pallet-owner",
|
||||
"//MillauMessagesOwner",
|
||||
"//Millau.MessagesOwner",
|
||||
"--rialto-parachain-transactions-mortality",
|
||||
"64",
|
||||
"--rialto-host",
|
||||
@@ -925,7 +925,9 @@ mod tests {
|
||||
millau_transactions_mortality: Some(64),
|
||||
},
|
||||
left_messages_pallet_owner: MillauMessagesPalletOwnerSigningParams {
|
||||
millau_messages_pallet_owner: Some("//RialtoParachainMessagesOwner".into()),
|
||||
millau_messages_pallet_owner: Some(
|
||||
"//RialtoParachain.MessagesOwner".into()
|
||||
),
|
||||
millau_messages_pallet_owner_password: None,
|
||||
},
|
||||
left_headers_to_right_sign_override:
|
||||
@@ -955,7 +957,7 @@ mod tests {
|
||||
},
|
||||
right_messages_pallet_owner: RialtoParachainMessagesPalletOwnerSigningParams {
|
||||
rialto_parachain_messages_pallet_owner: Some(
|
||||
"//MillauMessagesOwner".into()
|
||||
"//Millau.MessagesOwner".into()
|
||||
),
|
||||
rialto_parachain_messages_pallet_owner_password: None,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user