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

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7edba45
remove related func from integration-tests
programskillforverification Sep 23, 2024
320d9bd
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Sep 23, 2024
533f8dd
remove more and add from_str for ed25519
programskillforverification Sep 23, 2024
9c8aaff
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 2, 2024
12d0b3a
remove all
programskillforverification Oct 2, 2024
6c6d32b
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 4, 2024
81bf41c
simplify some code
programskillforverification Oct 7, 2024
8267fd6
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 7, 2024
63cee3d
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 7, 2024
a5fcf92
fix some errors
programskillforverification Oct 7, 2024
92dde5a
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 7, 2024
9db4b08
make ci happy
programskillforverification Oct 7, 2024
e85bdbe
Update prdoc/pr_5804.prdoc
programskillforverification Oct 8, 2024
f020937
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 8, 2024
0371cb1
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 9, 2024
4aa15ac
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 10, 2024
ef21eef
reuse get_from_seed
programskillforverification Oct 10, 2024
ab5b57f
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 11, 2024
ee39c0d
fix format not found
programskillforverification Oct 11, 2024
38d3aba
fix prdoc
programskillforverification Oct 11, 2024
41b0d6b
keep lowercase str
programskillforverification Oct 11, 2024
5f2364b
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 14, 2024
ae96dfe
rewirte helper func
programskillforverification Oct 14, 2024
48de94a
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 14, 2024
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