Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 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
32 changes: 16 additions & 16 deletions bridges/bin/millau/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ impl pallet_message_lane::Config for Runtime {
type LaneMessageVerifier = crate::rialto_messages::ToRialtoMessageVerifier;
type MessageDeliveryAndDispatchPayment = pallet_message_lane::instant_payments::InstantCurrencyPayments<
Runtime,
pallet_balances::Module<Runtime>,
pallet_balances::Pallet<Runtime>,
GetDeliveryConfirmationTransactionFee,
RootAccountForPayments,
>;
Expand All @@ -369,20 +369,20 @@ construct_runtime!(
NodeBlock = opaque::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
BridgeRialto: pallet_substrate_bridge::{Module, Call, Storage, Config<T>},
BridgeRialtoMessageLane: pallet_message_lane::{Module, Call, Storage, Event<T>},
BridgeCallDispatch: pallet_bridge_call_dispatch::{Module, Event<T>},
BridgeFinalityVerifier: pallet_finality_verifier::{Module, Call},
System: frame_system::{Module, Call, Config, Storage, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
Aura: pallet_aura::{Module, Config<T>},
Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
TransactionPayment: pallet_transaction_payment::{Module, Storage},
Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},
Session: pallet_session::{Module, Call, Storage, Event, Config<T>},
ShiftSessionManager: pallet_shift_session_manager::{Module},
BridgeRialto: pallet_substrate_bridge::{Pallet, Call, Storage, Config<T>},
BridgeRialtoMessageLane: pallet_message_lane::{Pallet, Call, Storage, Event<T>},
BridgeCallDispatch: pallet_bridge_call_dispatch::{Pallet, Event<T>},
BridgeFinalityVerifier: pallet_finality_verifier::{Pallet, Call},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage},
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
Aura: pallet_aura::{Pallet, Config<T>},
Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
TransactionPayment: pallet_transaction_payment::{Pallet, Storage},
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>},
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>},
ShiftSessionManager: pallet_shift_session_manager::{Pallet},
}
);

Expand Down Expand Up @@ -414,7 +414,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signatu
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive =
frame_executive::Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllModules>;
frame_executive::Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllPallets>;

impl_runtime_apis! {
impl sp_api::Core<Block> for Runtime {
Expand Down
62 changes: 31 additions & 31 deletions bridges/bin/rialto/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ impl bp_currency_exchange::DepositInto for DepositInto {
fn deposit_into(recipient: Self::Recipient, amount: Self::Amount) -> bp_currency_exchange::Result<()> {
// let balances module make all checks for us (it won't allow depositing lower than existential
// deposit, balance overflow, ...)
let deposited = <pallet_balances::Module<Runtime> as Currency<AccountId>>::deposit_creating(&recipient, amount);
let deposited = <pallet_balances::Pallet<Runtime> as Currency<AccountId>>::deposit_creating(&recipient, amount);

// I'm dropping deposited here explicitly to illustrate the fact that it'll update `TotalIssuance`
// on drop
Expand Down Expand Up @@ -461,7 +461,7 @@ impl pallet_message_lane::Config for Runtime {
type LaneMessageVerifier = crate::millau_messages::ToMillauMessageVerifier;
type MessageDeliveryAndDispatchPayment = pallet_message_lane::instant_payments::InstantCurrencyPayments<
Runtime,
pallet_balances::Module<Runtime>,
pallet_balances::Pallet<Runtime>,
GetDeliveryConfirmationTransactionFee,
RootAccountForPayments,
>;
Expand All @@ -476,24 +476,24 @@ construct_runtime!(
NodeBlock = opaque::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
BridgeRialtoPoA: pallet_bridge_eth_poa::<Instance1>::{Module, Call, Config, Storage, ValidateUnsigned},
BridgeKovan: pallet_bridge_eth_poa::<Instance2>::{Module, Call, Config, Storage, ValidateUnsigned},
BridgeRialtoCurrencyExchange: pallet_bridge_currency_exchange::<Instance1>::{Module, Call},
BridgeKovanCurrencyExchange: pallet_bridge_currency_exchange::<Instance2>::{Module, Call},
BridgeMillau: pallet_substrate_bridge::{Module, Call, Storage, Config<T>},
BridgeFinalityVerifier: pallet_finality_verifier::{Module, Call},
BridgeCallDispatch: pallet_bridge_call_dispatch::{Module, Event<T>},
BridgeMillauMessageLane: pallet_message_lane::{Module, Call, Storage, Event<T>},
System: frame_system::{Module, Call, Config, Storage, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
Aura: pallet_aura::{Module, Config<T>},
Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
TransactionPayment: pallet_transaction_payment::{Module, Storage},
Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},
Session: pallet_session::{Module, Call, Storage, Event, Config<T>},
ShiftSessionManager: pallet_shift_session_manager::{Module},
BridgeRialtoPoA: pallet_bridge_eth_poa::<Instance1>::{Pallet, Call, Config, Storage, ValidateUnsigned},
BridgeKovan: pallet_bridge_eth_poa::<Instance2>::{Pallet, Call, Config, Storage, ValidateUnsigned},
BridgeRialtoCurrencyExchange: pallet_bridge_currency_exchange::<Instance1>::{Pallet, Call},
BridgeKovanCurrencyExchange: pallet_bridge_currency_exchange::<Instance2>::{Pallet, Call},
BridgeMillau: pallet_substrate_bridge::{Pallet, Call, Storage, Config<T>},
BridgeFinalityVerifier: pallet_finality_verifier::{Pallet, Call},
BridgeCallDispatch: pallet_bridge_call_dispatch::{Pallet, Event<T>},
BridgeMillauMessageLane: pallet_message_lane::{Pallet, Call, Storage, Event<T>},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage},
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
Aura: pallet_aura::{Pallet, Config<T>},
Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
TransactionPayment: pallet_transaction_payment::{Pallet, Storage},
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>},
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>},
ShiftSessionManager: pallet_shift_session_manager::{Pallet},
}
);

Expand Down Expand Up @@ -525,7 +525,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signatu
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive =
frame_executive::Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllModules>;
frame_executive::Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllPallets>;

impl_runtime_apis! {
impl sp_api::Core<Block> for Runtime {
Expand Down Expand Up @@ -854,11 +854,11 @@ impl_runtime_apis! {
}

fn account_balance(account: &Self::AccountId) -> Self::OutboundMessageFee {
pallet_balances::Module::<Runtime>::free_balance(account)
pallet_balances::Pallet::<Runtime>::free_balance(account)
}

fn endow_account(account: &Self::AccountId) {
pallet_balances::Module::<Runtime>::make_free_balance_be(
pallet_balances::Pallet::<Runtime>::make_free_balance_be(
account,
Balance::MAX / 100,
);
Expand Down Expand Up @@ -1037,22 +1037,22 @@ mod tests {
ext.execute_with(|| {
// initially issuance is zero
assert_eq!(
<pallet_balances::Module<Runtime> as Currency<AccountId>>::total_issuance(),
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::total_issuance(),
0,
);

// create account
let account: AccountId = [1u8; 32].into();
let initial_amount = ExistentialDeposit::get();
let deposited =
<pallet_balances::Module<Runtime> as Currency<AccountId>>::deposit_creating(&account, initial_amount);
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::deposit_creating(&account, initial_amount);
drop(deposited);
assert_eq!(
<pallet_balances::Module<Runtime> as Currency<AccountId>>::total_issuance(),
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::total_issuance(),
initial_amount,
);
assert_eq!(
<pallet_balances::Module<Runtime> as Currency<AccountId>>::free_balance(&account),
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::free_balance(&account),
initial_amount,
);

Expand All @@ -1061,7 +1061,7 @@ mod tests {

// check that total issuance has changed by `run_deposit_into_test`
assert_eq!(
<pallet_balances::Module<Runtime> as Currency<AccountId>>::total_issuance(),
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::total_issuance(),
initial_amount + total_issuance_change,
);
});
Expand Down Expand Up @@ -1115,15 +1115,15 @@ mod tests {
fn deposit_into_existing_account_works() {
run_deposit_into_test(|existing_account| {
let initial_amount =
<pallet_balances::Module<Runtime> as Currency<AccountId>>::free_balance(&existing_account);
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::free_balance(&existing_account);
let additional_amount = 10_000;
<Runtime as pallet_bridge_currency_exchange::Config<KovanCurrencyExchange>>::DepositInto::deposit_into(
existing_account.clone(),
additional_amount,
)
.unwrap();
assert_eq!(
<pallet_balances::Module<Runtime> as Currency<AccountId>>::free_balance(&existing_account),
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::free_balance(&existing_account),
initial_amount + additional_amount,
);
additional_amount
Expand All @@ -1142,7 +1142,7 @@ mod tests {
)
.unwrap();
assert_eq!(
<pallet_balances::Module<Runtime> as Currency<AccountId>>::free_balance(&new_account),
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::free_balance(&new_account),
initial_amount + additional_amount,
);
additional_amount
Expand Down
4 changes: 2 additions & 2 deletions bridges/modules/call-dispatch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@ mod tests {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
CallDispatch: call_dispatch::{Module, Call, Event<T>},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
CallDispatch: call_dispatch::{Pallet, Call, Event<T>},
}
}

Expand Down
4 changes: 2 additions & 2 deletions bridges/modules/currency-exchange/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ mod tests {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Exchange: pallet_bridge_currency_exchange::{Module},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Exchange: pallet_bridge_currency_exchange::{Pallet},
}
}

Expand Down
4 changes: 2 additions & 2 deletions bridges/modules/ethereum/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ frame_support::construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Ethereum: pallet_ethereum::{Module, Call},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Ethereum: pallet_ethereum::{Pallet, Call},
}
}

Expand Down
4 changes: 2 additions & 2 deletions bridges/modules/finality-verifier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ mod tests {
fn next_block() {
use frame_support::traits::OnInitialize;

let current_number = frame_system::Module::<TestRuntime>::block_number();
frame_system::Module::<TestRuntime>::set_block_number(current_number + 1);
let current_number = frame_system::Pallet::<TestRuntime>::block_number();
frame_system::Pallet::<TestRuntime>::set_block_number(current_number + 1);
let _ = Module::<TestRuntime>::on_initialize(current_number);
}

Expand Down
6 changes: 3 additions & 3 deletions bridges/modules/finality-verifier/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Bridge: pallet_substrate_bridge::{Module},
FinalityVerifier: finality_verifier::{Module},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Bridge: pallet_substrate_bridge::{Pallet},
FinalityVerifier: finality_verifier::{Pallet},
}
}

Expand Down
4 changes: 2 additions & 2 deletions bridges/modules/message-lane/src/instant_payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ where

fn initialize(relayer_fund_account: &T::AccountId) -> usize {
assert!(
frame_system::Module::<T>::account_exists(relayer_fund_account),
frame_system::Pallet::<T>::account_exists(relayer_fund_account),
"The relayer fund account ({:?}) must exist for the message lanes pallet to work correctly.",
relayer_fund_account,
);
Expand Down Expand Up @@ -189,7 +189,7 @@ mod tests {
use crate::mock::{run_test, AccountId as TestAccountId, Balance as TestBalance, TestRuntime};
use bp_message_lane::source_chain::RelayerRewards;

type Balances = pallet_balances::Module<TestRuntime>;
type Balances = pallet_balances::Pallet<TestRuntime>;

const RELAYER_1: TestAccountId = 1;
const RELAYER_2: TestAccountId = 2;
Expand Down
8 changes: 4 additions & 4 deletions bridges/modules/message-lane/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ frame_support::construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Module, Call, Event<T>},
MessageLane: pallet_message_lane::{Module, Call, Event<T>},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Pallet, Call, Event<T>},
MessageLane: pallet_message_lane::{Pallet, Call, Event<T>},
}
}

Expand Down Expand Up @@ -112,7 +112,7 @@ impl pallet_balances::Config for TestRuntime {
type DustRemoval = ();
type Event = Event;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = frame_system::Module<TestRuntime>;
type AccountStore = frame_system::Pallet<TestRuntime>;
type WeightInfo = ();
}

Expand Down
6 changes: 3 additions & 3 deletions bridges/modules/shift-session-manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ mod tests {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Session: pallet_session::{Module},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Session: pallet_session::{Pallet},
}
}

Expand Down Expand Up @@ -193,7 +193,7 @@ mod tests {

BasicExternalities::execute_with_storage(&mut t, || {
for (ref k, ..) in &keys {
frame_system::Module::<TestRuntime>::inc_providers(k);
frame_system::Pallet::<TestRuntime>::inc_providers(k);
}
});

Expand Down
4 changes: 2 additions & 2 deletions bridges/modules/substrate/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ frame_support::construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Substrate: pallet_substrate::{Module, Call},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Substrate: pallet_substrate::{Pallet, Call},
}
}

Expand Down
Loading