Skip to content

Commit

Permalink
Remove AccountKeyring everywhere (#5899)
Browse files Browse the repository at this point in the history
Close: #5858

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
  • Loading branch information
programskillforverification and bkchr authored Dec 10, 2024
1 parent 8f4b99c commit 311ea43
Show file tree
Hide file tree
Showing 59 changed files with 330 additions and 291 deletions.
32 changes: 16 additions & 16 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion bridges/snowbridge/pallets/inbound-queue/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use super::*;
use frame_support::{assert_noop, assert_ok};
use hex_literal::hex;
use snowbridge_core::{inbound::Proof, ChannelId};
use sp_keyring::AccountKeyring as Keyring;
use sp_keyring::Sr25519Keyring as Keyring;
use sp_runtime::DispatchError;
use sp_std::convert::From;

Expand Down
6 changes: 3 additions & 3 deletions bridges/snowbridge/runtime/test-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use parachains_runtimes_test_utils::{
use snowbridge_core::{ChannelId, ParaId};
use snowbridge_pallet_ethereum_client_fixtures::*;
use sp_core::{Get, H160, U256};
use sp_keyring::AccountKeyring::*;
use sp_keyring::Sr25519Keyring::*;
use sp_runtime::{traits::Header, AccountId32, DigestItem, SaturatedConversion, Saturating};
use xcm::latest::prelude::*;
use xcm_executor::XcmExecutor;
Expand Down Expand Up @@ -431,7 +431,7 @@ pub fn ethereum_extrinsic<Runtime>(
collator_session_key: CollatorSessionKeys<Runtime>,
runtime_para_id: u32,
construct_and_apply_extrinsic: fn(
sp_keyring::AccountKeyring,
sp_keyring::Sr25519Keyring,
<Runtime as frame_system::Config>::RuntimeCall,
) -> sp_runtime::DispatchOutcome,
) where
Expand Down Expand Up @@ -567,7 +567,7 @@ pub fn ethereum_to_polkadot_message_extrinsics_work<Runtime>(
collator_session_key: CollatorSessionKeys<Runtime>,
runtime_para_id: u32,
construct_and_apply_extrinsic: fn(
sp_keyring::AccountKeyring,
sp_keyring::Sr25519Keyring,
<Runtime as frame_system::Config>::RuntimeCall,
) -> sp_runtime::DispatchOutcome,
) where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use frame_support::parameter_types;
use parachains_common::{AccountId, AuraId, Balance};
use snowbridge_pallet_ethereum_client::WeightInfo;
use sp_core::H160;
use sp_keyring::AccountKeyring::Alice;
use sp_keyring::Sr25519Keyring::Alice;
use sp_runtime::{
generic::{Era, SignedPayload},
AccountId32,
Expand Down Expand Up @@ -166,7 +166,7 @@ pub fn ethereum_outbound_queue_processes_messages_before_message_queue_works() {
}

fn construct_extrinsic(
sender: sp_keyring::AccountKeyring,
sender: sp_keyring::Sr25519Keyring,
call: RuntimeCall,
) -> UncheckedExtrinsic {
let account_id = AccountId32::from(sender.public());
Expand All @@ -192,7 +192,7 @@ fn construct_extrinsic(
}

fn construct_and_apply_extrinsic(
origin: sp_keyring::AccountKeyring,
origin: sp_keyring::Sr25519Keyring,
call: RuntimeCall,
) -> sp_runtime::DispatchOutcome {
let xt = construct_extrinsic(origin, call);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use parachains_common::{AccountId, AuraId, Balance};
use snowbridge_core::ChannelId;
use sp_consensus_aura::SlotDuration;
use sp_core::{crypto::Ss58Codec, H160};
use sp_keyring::AccountKeyring::Alice;
use sp_keyring::Sr25519Keyring::Alice;
use sp_runtime::{
generic::{Era, SignedPayload},
AccountId32, Perbill,
Expand All @@ -45,7 +45,7 @@ parameter_types! {
}

fn construct_extrinsic(
sender: sp_keyring::AccountKeyring,
sender: sp_keyring::Sr25519Keyring,
call: RuntimeCall,
) -> UncheckedExtrinsic {
let account_id = AccountId32::from(sender.public());
Expand All @@ -72,7 +72,7 @@ fn construct_extrinsic(
}

fn construct_and_apply_extrinsic(
relayer_at_target: sp_keyring::AccountKeyring,
relayer_at_target: sp_keyring::Sr25519Keyring,
call: RuntimeCall,
) -> sp_runtime::DispatchOutcome {
let xt = construct_extrinsic(relayer_at_target, call);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use frame_support::parameter_types;
use parachains_common::{AccountId, AuraId, Balance};
use snowbridge_pallet_ethereum_client::WeightInfo;
use sp_core::H160;
use sp_keyring::AccountKeyring::Alice;
use sp_keyring::Sr25519Keyring::Alice;
use sp_runtime::{
generic::{Era, SignedPayload},
AccountId32,
Expand Down Expand Up @@ -167,7 +167,7 @@ pub fn ethereum_outbound_queue_processes_messages_before_message_queue_works() {
}

fn construct_extrinsic(
sender: sp_keyring::AccountKeyring,
sender: sp_keyring::Sr25519Keyring,
call: RuntimeCall,
) -> UncheckedExtrinsic {
let account_id = AccountId32::from(sender.public());
Expand All @@ -193,7 +193,7 @@ fn construct_extrinsic(
}

fn construct_and_apply_extrinsic(
origin: sp_keyring::AccountKeyring,
origin: sp_keyring::Sr25519Keyring,
call: RuntimeCall,
) -> sp_runtime::DispatchOutcome {
let xt = construct_extrinsic(origin, call);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use frame_support::{dispatch::GetDispatchInfo, parameter_types, traits::ConstU8}
use parachains_common::{AccountId, AuraId, Balance};
use sp_consensus_aura::SlotDuration;
use sp_core::crypto::Ss58Codec;
use sp_keyring::AccountKeyring::Alice;
use sp_keyring::Sr25519Keyring::Alice;
use sp_runtime::{
generic::{Era, SignedPayload},
AccountId32, Perbill,
Expand Down Expand Up @@ -77,7 +77,7 @@ parameter_types! {
}

fn construct_extrinsic(
sender: sp_keyring::AccountKeyring,
sender: sp_keyring::Sr25519Keyring,
call: RuntimeCall,
) -> UncheckedExtrinsic {
let account_id = AccountId32::from(sender.public());
Expand All @@ -104,7 +104,7 @@ fn construct_extrinsic(
}

fn construct_and_apply_extrinsic(
relayer_at_target: sp_keyring::AccountKeyring,
relayer_at_target: sp_keyring::Sr25519Keyring,
call: RuntimeCall,
) -> sp_runtime::DispatchOutcome {
let xt = construct_extrinsic(relayer_at_target, call);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use parachains_runtimes_test_utils::{
AccountIdOf, BasicParachainRuntime, CollatorSessionKeys, RuntimeCallOf, SlotDurations,
};
use sp_core::Get;
use sp_keyring::AccountKeyring::*;
use sp_keyring::Sr25519Keyring::*;
use sp_runtime::{traits::Header as HeaderT, AccountId32};
use xcm::latest::prelude::*;

Expand Down Expand Up @@ -103,7 +103,7 @@ pub fn relayed_incoming_message_works<RuntimeHelper>(
local_relay_chain_id: NetworkId,
prepare_configuration: impl Fn() -> LaneIdOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>,
construct_and_apply_extrinsic: fn(
sp_keyring::AccountKeyring,
sp_keyring::Sr25519Keyring,
RuntimeCallOf<RuntimeHelper::Runtime>,
) -> sp_runtime::DispatchOutcome,
expect_rewards: bool,
Expand Down Expand Up @@ -210,7 +210,7 @@ pub fn free_relay_extrinsic_works<RuntimeHelper>(
local_relay_chain_id: NetworkId,
prepare_configuration: impl Fn() -> LaneIdOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>,
construct_and_apply_extrinsic: fn(
sp_keyring::AccountKeyring,
sp_keyring::Sr25519Keyring,
RuntimeCallOf<RuntimeHelper::Runtime>,
) -> sp_runtime::DispatchOutcome,
expect_rewards: bool,
Expand Down Expand Up @@ -344,7 +344,7 @@ pub fn complex_relay_extrinsic_works<RuntimeHelper>(
local_relay_chain_id: NetworkId,
prepare_configuration: impl Fn() -> LaneIdOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>,
construct_and_apply_extrinsic: fn(
sp_keyring::AccountKeyring,
sp_keyring::Sr25519Keyring,
RuntimeCallOf<RuntimeHelper::Runtime>,
) -> sp_runtime::DispatchOutcome,
) where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use parachains_runtimes_test_utils::{
AccountIdOf, BasicParachainRuntime, CollatorSessionKeys, RuntimeCallOf, SlotDurations,
};
use sp_core::Get;
use sp_keyring::AccountKeyring::*;
use sp_keyring::Sr25519Keyring::*;
use sp_runtime::{traits::Header as HeaderT, AccountId32};
use xcm::latest::prelude::*;

Expand Down Expand Up @@ -112,7 +112,7 @@ pub fn relayed_incoming_message_works<RuntimeHelper>(
local_relay_chain_id: NetworkId,
prepare_configuration: impl Fn() -> LaneIdOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>,
construct_and_apply_extrinsic: fn(
sp_keyring::AccountKeyring,
sp_keyring::Sr25519Keyring,
<RuntimeHelper::Runtime as frame_system::Config>::RuntimeCall,
) -> sp_runtime::DispatchOutcome,
expect_rewards: bool,
Expand Down Expand Up @@ -246,7 +246,7 @@ pub fn free_relay_extrinsic_works<RuntimeHelper>(
local_relay_chain_id: NetworkId,
prepare_configuration: impl Fn() -> LaneIdOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>,
construct_and_apply_extrinsic: fn(
sp_keyring::AccountKeyring,
sp_keyring::Sr25519Keyring,
<RuntimeHelper::Runtime as frame_system::Config>::RuntimeCall,
) -> sp_runtime::DispatchOutcome,
expect_rewards: bool,
Expand Down Expand Up @@ -414,7 +414,7 @@ pub fn complex_relay_extrinsic_works<RuntimeHelper>(
local_relay_chain_id: NetworkId,
prepare_configuration: impl Fn() -> LaneIdOf<RuntimeHelper::Runtime, RuntimeHelper::MPI>,
construct_and_apply_extrinsic: fn(
sp_keyring::AccountKeyring,
sp_keyring::Sr25519Keyring,
<RuntimeHelper::Runtime as frame_system::Config>::RuntimeCall,
) -> sp_runtime::DispatchOutcome,
) where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use parachains_runtimes_test_utils::{
mock_open_hrmp_channel, AccountIdOf, CollatorSessionKeys, RuntimeCallOf, SlotDurations,
};
use sp_core::Get;
use sp_keyring::AccountKeyring::*;
use sp_keyring::Sr25519Keyring::*;
use sp_runtime::{traits::TrailingZeroInput, AccountId32};
use xcm::latest::prelude::*;
use xcm_executor::traits::ConvertLocation;
Expand Down Expand Up @@ -264,7 +264,7 @@ pub fn relayed_incoming_message_works<Runtime, AllPalletsWithoutSystem, MPI>(
sibling_parachain_id: u32,
local_relay_chain_id: NetworkId,
construct_and_apply_extrinsic: fn(
sp_keyring::AccountKeyring,
sp_keyring::Sr25519Keyring,
RuntimeCallOf<Runtime>,
) -> sp_runtime::DispatchOutcome,
prepare_message_proof_import: impl FnOnce(
Expand Down Expand Up @@ -374,9 +374,9 @@ pub fn relayed_incoming_message_works<Runtime, AllPalletsWithoutSystem, MPI>(

/// Execute every call and verify its outcome.
fn execute_and_verify_calls<Runtime: frame_system::Config>(
submitter: sp_keyring::AccountKeyring,
submitter: sp_keyring::Sr25519Keyring,
construct_and_apply_extrinsic: fn(
sp_keyring::AccountKeyring,
sp_keyring::Sr25519Keyring,
RuntimeCallOf<Runtime>,
) -> sp_runtime::DispatchOutcome,
calls_and_verifiers: CallsAndVerifiers<Runtime>,
Expand Down
6 changes: 3 additions & 3 deletions cumulus/test/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub fn generate_extrinsic_with_pair(
/// Generate an extrinsic from the provided function call, origin and [`Client`].
pub fn generate_extrinsic(
client: &Client,
origin: sp_keyring::AccountKeyring,
origin: sp_keyring::Sr25519Keyring,
function: impl Into<RuntimeCall>,
) -> UncheckedExtrinsic {
generate_extrinsic_with_pair(client, origin.into(), function, None)
Expand All @@ -176,8 +176,8 @@ pub fn generate_extrinsic(
/// Transfer some token from one account to another using a provided test [`Client`].
pub fn transfer(
client: &Client,
origin: sp_keyring::AccountKeyring,
dest: sp_keyring::AccountKeyring,
origin: sp_keyring::Sr25519Keyring,
dest: sp_keyring::Sr25519Keyring,
value: Balance,
) -> UncheckedExtrinsic {
let function = RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death {
Expand Down
Loading

0 comments on commit 311ea43

Please sign in to comment.