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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 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
009fd5b
Update cumulus/parachains/integration-tests/emulated/tests/assets/ass…
programskillforverification Oct 15, 2024
f2be494
Update cumulus/parachains/integration-tests/emulated/tests/assets/ass…
programskillforverification Oct 15, 2024
eeb298b
Update substrate/primitives/core/src/crypto.rs
programskillforverification Oct 15, 2024
e9eb64b
Update substrate/primitives/core/src/crypto.rs
programskillforverification Oct 15, 2024
b86b000
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 15, 2024
b59cf20
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 16, 2024
262cfef
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 16, 2024
a161d07
adjust
programskillforverification Oct 16, 2024
f0e37bc
Update prdoc/pr_5804.prdoc
programskillforverification Oct 16, 2024
c7b31af
fix nit
programskillforverification Oct 16, 2024
6b39516
Merge branch 'master' into refactor-get_account_id_from_seed
programskillforverification Oct 17, 2024
341c689
remove magic number
programskillforverification Oct 17, 2024
b1fcb7f
Update substrate/primitives/keyring/src/ed25519.rs
programskillforverification Oct 17, 2024
d9ca423
Update substrate/primitives/keyring/src/sr25519.rs
programskillforverification Oct 17, 2024
5860e2d
Update substrate/primitives/keyring/src/lib.rs
programskillforverification Oct 17, 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
14 changes: 13 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 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 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 Down
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 Down
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
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 }
sp-authority-discovery = { workspace = true }
sp-consensus-babe = { workspace = true }
sp-consensus-beefy = { workspace = true, default-features = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ use sc_consensus_grandpa::AuthorityId as GrandpaId;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_consensus_babe::AuthorityId as BabeId;
use sp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId;
use sp_core::{sr25519, storage::Storage};
use sp_core::storage::Storage;
use sp_keyring::Sr25519Keyring as Keyring;

// Polkadot
use polkadot_primitives::{AssignmentId, ValidatorId};

// Cumulus
use emulated_integration_tests_common::{
accounts, build_genesis_storage, get_account_id_from_seed, get_host_config, validators,
accounts, build_genesis_storage, get_host_config, validators,
};
use parachains_common::Balance;
use rococo_runtime_constants::currency::UNITS as ROC;
Expand Down Expand Up @@ -82,9 +83,7 @@ pub fn genesis() -> Storage {
epoch_config: rococo_runtime::BABE_GENESIS_EPOCH_CONFIG,
..Default::default()
},
sudo: rococo_runtime::SudoConfig {
key: Some(get_account_id_from_seed::<sr25519::Public>("Alice")),
},
sudo: rococo_runtime::SudoConfig { key: Some(Keyring::Alice.to_account_id()) },
configuration: rococo_runtime::ConfigurationConfig { config: get_host_config() },
registrar: rococo_runtime::RegistrarConfig {
next_free_para_id: polkadot_primitives::LOWEST_PUBLIC_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ sp-runtime = { workspace = true, default-features = true }
frame-support = { workspace = true, default-features = true }
sp-core = { workspace = true, default-features = true }
sp-consensus-babe = { workspace = true, default-features = true }
sp-keyring = { workspace = true, default-features = true }
pallet-assets = { workspace = true, default-features = true }
pallet-balances = { workspace = true, default-features = true }
pallet-message-queue = { workspace = true, default-features = true }
Expand Down
Loading
Loading