Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor get_account_id_from_seed / get_from_seed to one common place #5804

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 0 additions & 46 deletions cumulus/parachains/common/src/genesis_config_helpers.rs

This file was deleted.

1 change: 0 additions & 1 deletion cumulus/parachains/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

extern crate alloc;

pub mod genesis_config_helpers;
pub mod impls;
pub mod message_queue;
pub mod xcm_config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ workspace = true

# Substrate
sp-core = { workspace = true }
sp-keyring = { workspace = true }
frame-support = { workspace = true }

# Cumulus
Expand All @@ -22,7 +23,9 @@ cumulus-primitives-core = { workspace = true }
emulated-integration-tests-common = { workspace = true }
asset-hub-rococo-runtime = { workspace = true, default-features = true }
rococo-emulated-chain = { workspace = true }
testnet-parachains-constants = { features = ["rococo"], workspace = true, default-features = true }
testnet-parachains-constants = { features = [
"rococo",
], workspace = true, default-features = true }

# Polkadot
xcm = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@

// Substrate
use frame_support::parameter_types;
use sp_core::{sr25519, storage::Storage};
use sp_core::storage::Storage;
use sp_keyring::Sr25519Keyring as Keyring;

// Cumulus
use emulated_integration_tests_common::{
accounts, build_genesis_storage, collators, get_account_id_from_seed,
PenpalSiblingSovereignAccount, PenpalTeleportableAssetLocation, RESERVABLE_ASSET_ID,
SAFE_XCM_VERSION, USDT_ID,
accounts, build_genesis_storage, collators, PenpalSiblingSovereignAccount,
PenpalTeleportableAssetLocation, RESERVABLE_ASSET_ID, SAFE_XCM_VERSION, USDT_ID,
};
use parachains_common::{AccountId, Balance};

pub const PARA_ID: u32 = 1000;
pub const ED: Balance = testnet_parachains_constants::rococo::currency::EXISTENTIAL_DEPOSIT;

parameter_types! {
pub AssetHubRococoAssetOwner: AccountId = get_account_id_from_seed::<sr25519::Public>("Alice");
pub AssetHubRococoAssetOwner: AccountId = Keyring::Alice.to_account_id();
}

pub fn genesis() -> Storage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ workspace = true

# Substrate
sp-core = { workspace = true }
sp-keyring = { workspace = true }
frame-support = { workspace = true }

# Cumulus
Expand All @@ -22,7 +23,9 @@ cumulus-primitives-core = { workspace = true }
emulated-integration-tests-common = { workspace = true }
asset-hub-westend-runtime = { workspace = true }
westend-emulated-chain = { workspace = true, default-features = true }
testnet-parachains-constants = { features = ["westend"], workspace = true, default-features = true }
testnet-parachains-constants = { features = [
"westend",
], workspace = true, default-features = true }

# Polkadot
xcm = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

// Substrate
use frame_support::parameter_types;
use sp_core::{sr25519, storage::Storage};
use sp_core::storage::Storage;
use sp_keyring::Sr25519Keyring as Keyring;

// Cumulus
use emulated_integration_tests_common::{
accounts, build_genesis_storage, collators, get_account_id_from_seed,
PenpalBSiblingSovereignAccount, PenpalBTeleportableAssetLocation,
PenpalSiblingSovereignAccount, PenpalTeleportableAssetLocation, RESERVABLE_ASSET_ID,
SAFE_XCM_VERSION, USDT_ID,
accounts, build_genesis_storage, collators, PenpalBSiblingSovereignAccount,
PenpalBTeleportableAssetLocation, PenpalSiblingSovereignAccount,
PenpalTeleportableAssetLocation, RESERVABLE_ASSET_ID, SAFE_XCM_VERSION, USDT_ID,
};
use parachains_common::{AccountId, Balance};

Expand All @@ -31,7 +31,7 @@ pub const ED: Balance = testnet_parachains_constants::westend::currency::EXISTEN
pub const USDT_ED: Balance = 70_000;

parameter_types! {
pub AssetHubWestendAssetOwner: AccountId = get_account_id_from_seed::<sr25519::Public>("Alice");
pub AssetHubWestendAssetOwner: AccountId = Keyring::Alice.to_account_id();
}

pub fn genesis() -> Storage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ workspace = true

# Substrate
sp-core = { workspace = true }
sp-keyring = { workspace = true }
frame-support = { workspace = true }

# Polkadot Dependencies
Expand All @@ -27,4 +28,6 @@ parachains-common = { workspace = true, default-features = true }
emulated-integration-tests-common = { workspace = true }
bridge-hub-rococo-runtime = { workspace = true, default-features = true }
bridge-hub-common = { workspace = true }
testnet-parachains-constants = { features = ["rococo"], workspace = true, default-features = true }
testnet-parachains-constants = { features = [
"rococo",
], workspace = true, default-features = true }
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
// limitations under the License.

// Substrate
use sp_core::{sr25519, storage::Storage};
use sp_core::storage::Storage;
use sp_keyring::Sr25519Keyring as Keyring;

// Cumulus
use emulated_integration_tests_common::{
accounts, build_genesis_storage, collators, get_account_id_from_seed, SAFE_XCM_VERSION,
accounts, build_genesis_storage, collators, SAFE_XCM_VERSION,
};
use parachains_common::Balance;
use xcm::latest::prelude::*;
Expand Down Expand Up @@ -60,11 +61,11 @@ pub fn genesis() -> Storage {
..Default::default()
},
bridge_westend_grandpa: bridge_hub_rococo_runtime::BridgeWestendGrandpaConfig {
owner: Some(get_account_id_from_seed::<sr25519::Public>(accounts::BOB)),
owner: Some(Keyring::Bob.to_account_id()),
..Default::default()
},
bridge_westend_messages: bridge_hub_rococo_runtime::BridgeWestendMessagesConfig {
owner: Some(get_account_id_from_seed::<sr25519::Public>(accounts::BOB)),
owner: Some(Keyring::Bob.to_account_id()),
..Default::default()
},
xcm_over_bridge_hub_westend: bridge_hub_rococo_runtime::XcmOverBridgeHubWestendConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ workspace = true

# Substrate
sp-core = { workspace = true }
sp-keyring = { workspace = true }
frame-support = { workspace = true }

# Polkadot Dependencies
Expand All @@ -27,4 +28,6 @@ parachains-common = { workspace = true, default-features = true }
emulated-integration-tests-common = { workspace = true }
bridge-hub-westend-runtime = { workspace = true, default-features = true }
bridge-hub-common = { workspace = true }
testnet-parachains-constants = { features = ["westend"], workspace = true, default-features = true }
testnet-parachains-constants = { features = [
"westend",
], workspace = true, default-features = true }
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
// limitations under the License.

// Substrate
use sp_core::{sr25519, storage::Storage};
use sp_core::storage::Storage;
use sp_keyring::Sr25519Keyring as Keyring;

// Cumulus
use emulated_integration_tests_common::{
accounts, build_genesis_storage, collators, get_account_id_from_seed, SAFE_XCM_VERSION,
accounts, build_genesis_storage, collators, SAFE_XCM_VERSION,
};
use parachains_common::Balance;
use xcm::latest::prelude::*;
Expand Down Expand Up @@ -60,11 +61,11 @@ pub fn genesis() -> Storage {
..Default::default()
},
bridge_rococo_grandpa: bridge_hub_westend_runtime::BridgeRococoGrandpaConfig {
owner: Some(get_account_id_from_seed::<sr25519::Public>(accounts::BOB)),
owner: Some(Keyring::Bob.to_account_id()),
..Default::default()
},
bridge_rococo_messages: bridge_hub_westend_runtime::BridgeRococoMessagesConfig {
owner: Some(get_account_id_from_seed::<sr25519::Public>(accounts::BOB)),
owner: Some(Keyring::Bob.to_account_id()),
..Default::default()
},
xcm_over_bridge_hub_rococo: bridge_hub_westend_runtime::XcmOverBridgeHubRococoConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ workspace = true

# Substrate
sp-core = { workspace = true }
sp-keyring = { workspace = true }
frame-support = { workspace = true }

# Polkadot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@

// Substrate
use frame_support::parameter_types;
use sp_core::{sr25519, storage::Storage};
use sp_core::storage::Storage;
use sp_keyring::Sr25519Keyring as Keyring;

// Cumulus
use emulated_integration_tests_common::{
accounts, build_genesis_storage, collators, get_account_id_from_seed, SAFE_XCM_VERSION,
accounts, build_genesis_storage, collators, SAFE_XCM_VERSION,
};
use parachains_common::{AccountId, Balance};
use penpal_runtime::xcm_config::{LocalReservableFromAssetHub, RelayLocation, UsdtFromAssetHub};
Expand All @@ -30,7 +31,7 @@ pub const ED: Balance = penpal_runtime::EXISTENTIAL_DEPOSIT;
pub const USDT_ED: Balance = 70_000;

parameter_types! {
pub PenpalSudoAccount: AccountId = get_account_id_from_seed::<sr25519::Public>("Alice");
pub PenpalSudoAccount: AccountId = Keyring::Alice.to_account_id();
pub PenpalAssetOwner: AccountId = PenpalSudoAccount::get();
}

Expand Down
Loading
Loading