mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 21:01:05 +00:00
BREAKING: Rename Call & Event (#11981)
* rename Event to RuntimeEvent * rename Call * rename in runtimes * small fix * rename Event * small fix & rename RuntimeCall back to Call for now * small fixes * more renaming * a bit more renaming * fmt * small fix * commit * prep for renaming associated types * fix * rename associated Event type * rename to RuntimeEvent * commit * merge conflict fixes & fmt * additional renaming * fix. * fix decl_event * rename in tests * remove warnings * remove accidental rename * . * commit * update .stderr * fix in test * update .stderr * TRYBUILD=overwrite * docs * fmt * small change in docs * rename PalletEvent to Event * rename Call to RuntimeCall * renamed at wrong places :P * rename Call * rename * rename associated type * fix * fix & fmt * commit * frame-support-test * passing tests * update docs * rustdoc fix * update .stderr * wrong code in docs * merge fix * fix in error message * update .stderr * docs & error message * . * merge fix * merge fix * fmt * fmt * merge fix * more fixing * fmt * remove unused * fmt * fix Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -122,7 +122,7 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
|
||||
fn extrinsic_set_time(now: u64) -> OpaqueExtrinsic {
|
||||
kitchensink_runtime::UncheckedExtrinsic {
|
||||
signature: None,
|
||||
function: kitchensink_runtime::Call::Timestamp(pallet_timestamp::Call::set { now }),
|
||||
function: kitchensink_runtime::RuntimeCall::Timestamp(pallet_timestamp::Call::set { now }),
|
||||
}
|
||||
.into()
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ pub fn fetch_nonce(client: &FullClient, account: sp_core::sr25519::Pair) -> u32
|
||||
pub fn create_extrinsic(
|
||||
client: &FullClient,
|
||||
sender: sp_core::sr25519::Pair,
|
||||
function: impl Into<kitchensink_runtime::Call>,
|
||||
function: impl Into<kitchensink_runtime::RuntimeCall>,
|
||||
nonce: Option<u32>,
|
||||
) -> kitchensink_runtime::UncheckedExtrinsic {
|
||||
let function = function.into();
|
||||
@@ -570,7 +570,7 @@ mod tests {
|
||||
use codec::Encode;
|
||||
use kitchensink_runtime::{
|
||||
constants::{currency::CENTS, time::SLOT_DURATION},
|
||||
Address, BalancesCall, Call, UncheckedExtrinsic,
|
||||
Address, BalancesCall, RuntimeCall, UncheckedExtrinsic,
|
||||
};
|
||||
use node_primitives::{Block, DigestItem, Signature};
|
||||
use sc_client_api::BlockBackend;
|
||||
@@ -759,8 +759,10 @@ mod tests {
|
||||
};
|
||||
let signer = charlie.clone();
|
||||
|
||||
let function =
|
||||
Call::Balances(BalancesCall::transfer { dest: to.into(), value: amount });
|
||||
let function = RuntimeCall::Balances(BalancesCall::transfer {
|
||||
dest: to.into(),
|
||||
value: amount,
|
||||
});
|
||||
|
||||
let check_non_zero_sender = frame_system::CheckNonZeroSender::new();
|
||||
let check_spec_version = frame_system::CheckSpecVersion::new();
|
||||
|
||||
@@ -19,8 +19,8 @@ use codec::{Decode, Encode};
|
||||
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
|
||||
use frame_support::Hashable;
|
||||
use kitchensink_runtime::{
|
||||
constants::currency::*, Block, BuildStorage, Call, CheckedExtrinsic, GenesisConfig, Header,
|
||||
UncheckedExtrinsic,
|
||||
constants::currency::*, Block, BuildStorage, CheckedExtrinsic, GenesisConfig, Header,
|
||||
RuntimeCall, UncheckedExtrinsic,
|
||||
};
|
||||
use node_executor::ExecutorDispatch;
|
||||
use node_primitives::{BlockNumber, Hash};
|
||||
@@ -141,11 +141,11 @@ fn test_blocks(
|
||||
let mut test_ext = new_test_ext(genesis_config);
|
||||
let mut block1_extrinsics = vec![CheckedExtrinsic {
|
||||
signed: None,
|
||||
function: Call::Timestamp(pallet_timestamp::Call::set { now: 0 }),
|
||||
function: RuntimeCall::Timestamp(pallet_timestamp::Call::set { now: 0 }),
|
||||
}];
|
||||
block1_extrinsics.extend((0..20).map(|i| CheckedExtrinsic {
|
||||
signed: Some((alice(), signed_extra(i, 0))),
|
||||
function: Call::Balances(pallet_balances::Call::transfer {
|
||||
function: RuntimeCall::Balances(pallet_balances::Call::transfer {
|
||||
dest: bob().into(),
|
||||
value: 1 * DOLLARS,
|
||||
}),
|
||||
|
||||
@@ -28,8 +28,8 @@ use sp_runtime::{
|
||||
|
||||
use kitchensink_runtime::{
|
||||
constants::{currency::*, time::SLOT_DURATION},
|
||||
Balances, Call, CheckedExtrinsic, Event, Header, Runtime, System, TransactionPayment,
|
||||
UncheckedExtrinsic,
|
||||
Balances, CheckedExtrinsic, Header, Runtime, RuntimeCall, RuntimeEvent, System,
|
||||
TransactionPayment, UncheckedExtrinsic,
|
||||
};
|
||||
use node_primitives::{Balance, Hash};
|
||||
use node_testing::keyring::*;
|
||||
@@ -67,7 +67,7 @@ fn transfer_fee<E: Encode>(extrinsic: &E) -> Balance {
|
||||
fn xt() -> UncheckedExtrinsic {
|
||||
sign(CheckedExtrinsic {
|
||||
signed: Some((alice(), signed_extra(0, 0))),
|
||||
function: Call::Balances(default_transfer_call()),
|
||||
function: RuntimeCall::Balances(default_transfer_call()),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -84,11 +84,11 @@ fn changes_trie_block() -> (Vec<u8>, Hash) {
|
||||
vec![
|
||||
CheckedExtrinsic {
|
||||
signed: None,
|
||||
function: Call::Timestamp(pallet_timestamp::Call::set { now: time }),
|
||||
function: RuntimeCall::Timestamp(pallet_timestamp::Call::set { now: time }),
|
||||
},
|
||||
CheckedExtrinsic {
|
||||
signed: Some((alice(), signed_extra(0, 0))),
|
||||
function: Call::Balances(pallet_balances::Call::transfer {
|
||||
function: RuntimeCall::Balances(pallet_balances::Call::transfer {
|
||||
dest: bob().into(),
|
||||
value: 69 * DOLLARS,
|
||||
}),
|
||||
@@ -111,11 +111,11 @@ fn blocks() -> ((Vec<u8>, Hash), (Vec<u8>, Hash)) {
|
||||
vec![
|
||||
CheckedExtrinsic {
|
||||
signed: None,
|
||||
function: Call::Timestamp(pallet_timestamp::Call::set { now: time1 }),
|
||||
function: RuntimeCall::Timestamp(pallet_timestamp::Call::set { now: time1 }),
|
||||
},
|
||||
CheckedExtrinsic {
|
||||
signed: Some((alice(), signed_extra(0, 0))),
|
||||
function: Call::Balances(pallet_balances::Call::transfer {
|
||||
function: RuntimeCall::Balances(pallet_balances::Call::transfer {
|
||||
dest: bob().into(),
|
||||
value: 69 * DOLLARS,
|
||||
}),
|
||||
@@ -131,18 +131,18 @@ fn blocks() -> ((Vec<u8>, Hash), (Vec<u8>, Hash)) {
|
||||
vec![
|
||||
CheckedExtrinsic {
|
||||
signed: None,
|
||||
function: Call::Timestamp(pallet_timestamp::Call::set { now: time2 }),
|
||||
function: RuntimeCall::Timestamp(pallet_timestamp::Call::set { now: time2 }),
|
||||
},
|
||||
CheckedExtrinsic {
|
||||
signed: Some((bob(), signed_extra(0, 0))),
|
||||
function: Call::Balances(pallet_balances::Call::transfer {
|
||||
function: RuntimeCall::Balances(pallet_balances::Call::transfer {
|
||||
dest: alice().into(),
|
||||
value: 5 * DOLLARS,
|
||||
}),
|
||||
},
|
||||
CheckedExtrinsic {
|
||||
signed: Some((alice(), signed_extra(1, 0))),
|
||||
function: Call::Balances(pallet_balances::Call::transfer {
|
||||
function: RuntimeCall::Balances(pallet_balances::Call::transfer {
|
||||
dest: bob().into(),
|
||||
value: 15 * DOLLARS,
|
||||
}),
|
||||
@@ -166,11 +166,11 @@ fn block_with_size(time: u64, nonce: u32, size: usize) -> (Vec<u8>, Hash) {
|
||||
vec![
|
||||
CheckedExtrinsic {
|
||||
signed: None,
|
||||
function: Call::Timestamp(pallet_timestamp::Call::set { now: time * 1000 }),
|
||||
function: RuntimeCall::Timestamp(pallet_timestamp::Call::set { now: time * 1000 }),
|
||||
},
|
||||
CheckedExtrinsic {
|
||||
signed: Some((alice(), signed_extra(nonce, 0))),
|
||||
function: Call::System(frame_system::Call::remark { remark: vec![0; size] }),
|
||||
function: RuntimeCall::System(frame_system::Call::remark { remark: vec![0; size] }),
|
||||
},
|
||||
],
|
||||
(time * 1000 / SLOT_DURATION).into(),
|
||||
@@ -324,7 +324,7 @@ fn full_native_block_import_works() {
|
||||
let events = vec![
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(0),
|
||||
event: Event::System(frame_system::Event::ExtrinsicSuccess {
|
||||
event: RuntimeEvent::System(frame_system::Event::ExtrinsicSuccess {
|
||||
dispatch_info: DispatchInfo {
|
||||
weight: timestamp_weight,
|
||||
class: DispatchClass::Mandatory,
|
||||
@@ -335,7 +335,7 @@ fn full_native_block_import_works() {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: Event::Balances(pallet_balances::Event::Withdraw {
|
||||
event: RuntimeEvent::Balances(pallet_balances::Event::Withdraw {
|
||||
who: alice().into(),
|
||||
amount: fees,
|
||||
}),
|
||||
@@ -343,7 +343,7 @@ fn full_native_block_import_works() {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: Event::Balances(pallet_balances::Event::Transfer {
|
||||
event: RuntimeEvent::Balances(pallet_balances::Event::Transfer {
|
||||
from: alice().into(),
|
||||
to: bob().into(),
|
||||
amount: 69 * DOLLARS,
|
||||
@@ -352,7 +352,7 @@ fn full_native_block_import_works() {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: Event::Balances(pallet_balances::Event::Deposit {
|
||||
event: RuntimeEvent::Balances(pallet_balances::Event::Deposit {
|
||||
who: pallet_treasury::Pallet::<Runtime>::account_id(),
|
||||
amount: fees * 8 / 10,
|
||||
}),
|
||||
@@ -360,12 +360,14 @@ fn full_native_block_import_works() {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: Event::Treasury(pallet_treasury::Event::Deposit { value: fees * 8 / 10 }),
|
||||
event: RuntimeEvent::Treasury(pallet_treasury::Event::Deposit {
|
||||
value: fees * 8 / 10,
|
||||
}),
|
||||
topics: vec![],
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: Event::TransactionPayment(
|
||||
event: RuntimeEvent::TransactionPayment(
|
||||
pallet_transaction_payment::Event::TransactionFeePaid {
|
||||
who: alice().into(),
|
||||
actual_fee: fees,
|
||||
@@ -376,7 +378,7 @@ fn full_native_block_import_works() {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: Event::System(frame_system::Event::ExtrinsicSuccess {
|
||||
event: RuntimeEvent::System(frame_system::Event::ExtrinsicSuccess {
|
||||
dispatch_info: DispatchInfo { weight: transfer_weight, ..Default::default() },
|
||||
}),
|
||||
topics: vec![],
|
||||
@@ -398,7 +400,7 @@ fn full_native_block_import_works() {
|
||||
let events = vec![
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(0),
|
||||
event: Event::System(frame_system::Event::ExtrinsicSuccess {
|
||||
event: RuntimeEvent::System(frame_system::Event::ExtrinsicSuccess {
|
||||
dispatch_info: DispatchInfo {
|
||||
weight: timestamp_weight,
|
||||
class: DispatchClass::Mandatory,
|
||||
@@ -409,7 +411,7 @@ fn full_native_block_import_works() {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: Event::Balances(pallet_balances::Event::Withdraw {
|
||||
event: RuntimeEvent::Balances(pallet_balances::Event::Withdraw {
|
||||
who: bob().into(),
|
||||
amount: fees,
|
||||
}),
|
||||
@@ -417,7 +419,7 @@ fn full_native_block_import_works() {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: Event::Balances(pallet_balances::Event::Transfer {
|
||||
event: RuntimeEvent::Balances(pallet_balances::Event::Transfer {
|
||||
from: bob().into(),
|
||||
to: alice().into(),
|
||||
amount: 5 * DOLLARS,
|
||||
@@ -426,7 +428,7 @@ fn full_native_block_import_works() {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: Event::Balances(pallet_balances::Event::Deposit {
|
||||
event: RuntimeEvent::Balances(pallet_balances::Event::Deposit {
|
||||
who: pallet_treasury::Pallet::<Runtime>::account_id(),
|
||||
amount: fees * 8 / 10,
|
||||
}),
|
||||
@@ -434,12 +436,14 @@ fn full_native_block_import_works() {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: Event::Treasury(pallet_treasury::Event::Deposit { value: fees * 8 / 10 }),
|
||||
event: RuntimeEvent::Treasury(pallet_treasury::Event::Deposit {
|
||||
value: fees * 8 / 10,
|
||||
}),
|
||||
topics: vec![],
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: Event::TransactionPayment(
|
||||
event: RuntimeEvent::TransactionPayment(
|
||||
pallet_transaction_payment::Event::TransactionFeePaid {
|
||||
who: bob().into(),
|
||||
actual_fee: fees,
|
||||
@@ -450,14 +454,14 @@ fn full_native_block_import_works() {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: Event::System(frame_system::Event::ExtrinsicSuccess {
|
||||
event: RuntimeEvent::System(frame_system::Event::ExtrinsicSuccess {
|
||||
dispatch_info: DispatchInfo { weight: transfer_weight, ..Default::default() },
|
||||
}),
|
||||
topics: vec![],
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(2),
|
||||
event: Event::Balances(pallet_balances::Event::Withdraw {
|
||||
event: RuntimeEvent::Balances(pallet_balances::Event::Withdraw {
|
||||
who: alice().into(),
|
||||
amount: fees,
|
||||
}),
|
||||
@@ -465,7 +469,7 @@ fn full_native_block_import_works() {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(2),
|
||||
event: Event::Balances(pallet_balances::Event::Transfer {
|
||||
event: RuntimeEvent::Balances(pallet_balances::Event::Transfer {
|
||||
from: alice().into(),
|
||||
to: bob().into(),
|
||||
amount: 15 * DOLLARS,
|
||||
@@ -474,7 +478,7 @@ fn full_native_block_import_works() {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(2),
|
||||
event: Event::Balances(pallet_balances::Event::Deposit {
|
||||
event: RuntimeEvent::Balances(pallet_balances::Event::Deposit {
|
||||
who: pallet_treasury::Pallet::<Runtime>::account_id(),
|
||||
amount: fees * 8 / 10,
|
||||
}),
|
||||
@@ -482,12 +486,14 @@ fn full_native_block_import_works() {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(2),
|
||||
event: Event::Treasury(pallet_treasury::Event::Deposit { value: fees * 8 / 10 }),
|
||||
event: RuntimeEvent::Treasury(pallet_treasury::Event::Deposit {
|
||||
value: fees * 8 / 10,
|
||||
}),
|
||||
topics: vec![],
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(2),
|
||||
event: Event::TransactionPayment(
|
||||
event: RuntimeEvent::TransactionPayment(
|
||||
pallet_transaction_payment::Event::TransactionFeePaid {
|
||||
who: alice().into(),
|
||||
actual_fee: fees,
|
||||
@@ -498,7 +504,7 @@ fn full_native_block_import_works() {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(2),
|
||||
event: Event::System(frame_system::Event::ExtrinsicSuccess {
|
||||
event: RuntimeEvent::System(frame_system::Event::ExtrinsicSuccess {
|
||||
dispatch_info: DispatchInfo { weight: transfer_weight, ..Default::default() },
|
||||
}),
|
||||
topics: vec![],
|
||||
@@ -648,24 +654,24 @@ fn deploying_wasm_contract_should_work() {
|
||||
vec![
|
||||
CheckedExtrinsic {
|
||||
signed: None,
|
||||
function: Call::Timestamp(pallet_timestamp::Call::set { now: time }),
|
||||
function: RuntimeCall::Timestamp(pallet_timestamp::Call::set { now: time }),
|
||||
},
|
||||
CheckedExtrinsic {
|
||||
signed: Some((charlie(), signed_extra(0, 0))),
|
||||
function: Call::Contracts(
|
||||
pallet_contracts::Call::instantiate_with_code::<Runtime> {
|
||||
value: 0,
|
||||
gas_limit: Weight::from_ref_time(500_000_000),
|
||||
storage_deposit_limit: None,
|
||||
code: transfer_code,
|
||||
data: Vec::new(),
|
||||
salt: Vec::new(),
|
||||
},
|
||||
),
|
||||
function: RuntimeCall::Contracts(pallet_contracts::Call::instantiate_with_code::<
|
||||
Runtime,
|
||||
> {
|
||||
value: 0,
|
||||
gas_limit: Weight::from_ref_time(500_000_000),
|
||||
storage_deposit_limit: None,
|
||||
code: transfer_code,
|
||||
data: Vec::new(),
|
||||
salt: Vec::new(),
|
||||
}),
|
||||
},
|
||||
CheckedExtrinsic {
|
||||
signed: Some((charlie(), signed_extra(1, 0))),
|
||||
function: Call::Contracts(pallet_contracts::Call::call::<Runtime> {
|
||||
function: RuntimeCall::Contracts(pallet_contracts::Call::call::<Runtime> {
|
||||
dest: sp_runtime::MultiAddress::Id(addr.clone()),
|
||||
value: 10,
|
||||
gas_limit: Weight::from_ref_time(500_000_000),
|
||||
|
||||
@@ -22,7 +22,8 @@ use frame_support::{
|
||||
};
|
||||
use kitchensink_runtime::{
|
||||
constants::{currency::*, time::SLOT_DURATION},
|
||||
Balances, Call, CheckedExtrinsic, Multiplier, Runtime, TransactionByteFee, TransactionPayment,
|
||||
Balances, CheckedExtrinsic, Multiplier, Runtime, RuntimeCall, TransactionByteFee,
|
||||
TransactionPayment,
|
||||
};
|
||||
use node_primitives::Balance;
|
||||
use node_testing::keyring::*;
|
||||
@@ -53,12 +54,12 @@ fn fee_multiplier_increases_and_decreases_on_big_weight() {
|
||||
vec![
|
||||
CheckedExtrinsic {
|
||||
signed: None,
|
||||
function: Call::Timestamp(pallet_timestamp::Call::set { now: time1 }),
|
||||
function: RuntimeCall::Timestamp(pallet_timestamp::Call::set { now: time1 }),
|
||||
},
|
||||
CheckedExtrinsic {
|
||||
signed: Some((charlie(), signed_extra(0, 0))),
|
||||
function: Call::Sudo(pallet_sudo::Call::sudo {
|
||||
call: Box::new(Call::System(frame_system::Call::fill_block {
|
||||
function: RuntimeCall::Sudo(pallet_sudo::Call::sudo {
|
||||
call: Box::new(RuntimeCall::System(frame_system::Call::fill_block {
|
||||
ratio: Perbill::from_percent(60),
|
||||
})),
|
||||
}),
|
||||
@@ -76,11 +77,11 @@ fn fee_multiplier_increases_and_decreases_on_big_weight() {
|
||||
vec![
|
||||
CheckedExtrinsic {
|
||||
signed: None,
|
||||
function: Call::Timestamp(pallet_timestamp::Call::set { now: time2 }),
|
||||
function: RuntimeCall::Timestamp(pallet_timestamp::Call::set { now: time2 }),
|
||||
},
|
||||
CheckedExtrinsic {
|
||||
signed: Some((charlie(), signed_extra(1, 0))),
|
||||
function: Call::System(frame_system::Call::remark { remark: vec![0; 1] }),
|
||||
function: RuntimeCall::System(frame_system::Call::remark { remark: vec![0; 1] }),
|
||||
},
|
||||
],
|
||||
(time2 / SLOT_DURATION).into(),
|
||||
@@ -146,7 +147,7 @@ fn transaction_fee_is_correct() {
|
||||
let tip = 1_000_000;
|
||||
let xt = sign(CheckedExtrinsic {
|
||||
signed: Some((alice(), signed_extra(0, tip))),
|
||||
function: Call::Balances(default_transfer_call()),
|
||||
function: RuntimeCall::Balances(default_transfer_call()),
|
||||
});
|
||||
|
||||
let r =
|
||||
@@ -212,7 +213,7 @@ fn block_weight_capacity_report() {
|
||||
let mut xts = (0..num_transfers)
|
||||
.map(|i| CheckedExtrinsic {
|
||||
signed: Some((charlie(), signed_extra(nonce + i as Index, 0))),
|
||||
function: Call::Balances(pallet_balances::Call::transfer {
|
||||
function: RuntimeCall::Balances(pallet_balances::Call::transfer {
|
||||
dest: bob().into(),
|
||||
value: 0,
|
||||
}),
|
||||
@@ -223,7 +224,7 @@ fn block_weight_capacity_report() {
|
||||
0,
|
||||
CheckedExtrinsic {
|
||||
signed: None,
|
||||
function: Call::Timestamp(pallet_timestamp::Call::set { now: time * 1000 }),
|
||||
function: RuntimeCall::Timestamp(pallet_timestamp::Call::set { now: time * 1000 }),
|
||||
},
|
||||
);
|
||||
|
||||
@@ -286,11 +287,13 @@ fn block_length_capacity_report() {
|
||||
vec![
|
||||
CheckedExtrinsic {
|
||||
signed: None,
|
||||
function: Call::Timestamp(pallet_timestamp::Call::set { now: time * 1000 }),
|
||||
function: RuntimeCall::Timestamp(pallet_timestamp::Call::set {
|
||||
now: time * 1000,
|
||||
}),
|
||||
},
|
||||
CheckedExtrinsic {
|
||||
signed: Some((charlie(), signed_extra(nonce, 0))),
|
||||
function: Call::System(frame_system::Call::remark {
|
||||
function: RuntimeCall::System(frame_system::Call::remark {
|
||||
remark: vec![0u8; (block_number * factor) as usize],
|
||||
}),
|
||||
},
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
//! Some configurable implementations as associated type for the substrate runtime.
|
||||
|
||||
use crate::{
|
||||
AccountId, AllianceMotion, Assets, Authorship, Balances, Call, Hash, NegativeImbalance, Runtime,
|
||||
AccountId, AllianceMotion, Assets, Authorship, Balances, Hash, NegativeImbalance, Runtime,
|
||||
RuntimeCall,
|
||||
};
|
||||
use frame_support::{
|
||||
pallet_prelude::*,
|
||||
@@ -77,11 +78,11 @@ impl IdentityVerifier<AccountId> for AllianceIdentityVerifier {
|
||||
}
|
||||
|
||||
pub struct AllianceProposalProvider;
|
||||
impl ProposalProvider<AccountId, Hash, Call> for AllianceProposalProvider {
|
||||
impl ProposalProvider<AccountId, Hash, RuntimeCall> for AllianceProposalProvider {
|
||||
fn propose_proposal(
|
||||
who: AccountId,
|
||||
threshold: u32,
|
||||
proposal: Box<Call>,
|
||||
proposal: Box<RuntimeCall>,
|
||||
length_bound: u32,
|
||||
) -> Result<(u32, u32), DispatchError> {
|
||||
AllianceMotion::do_propose_proposed(who, threshold, proposal, length_bound)
|
||||
@@ -109,7 +110,7 @@ impl ProposalProvider<AccountId, Hash, Call> for AllianceProposalProvider {
|
||||
AllianceMotion::do_close(proposal_hash, proposal_index, proposal_weight_bound, length_bound)
|
||||
}
|
||||
|
||||
fn proposal_of(proposal_hash: Hash) -> Option<Call> {
|
||||
fn proposal_of(proposal_hash: Hash) -> Option<RuntimeCall> {
|
||||
AllianceMotion::proposal_of(proposal_hash)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ impl frame_system::Config for Runtime {
|
||||
type BlockLength = RuntimeBlockLength;
|
||||
type DbWeight = RocksDbWeight;
|
||||
type Origin = Origin;
|
||||
type Call = Call;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Index = Index;
|
||||
type BlockNumber = BlockNumber;
|
||||
type Hash = Hash;
|
||||
@@ -213,7 +213,7 @@ impl frame_system::Config for Runtime {
|
||||
type AccountId = AccountId;
|
||||
type Lookup = Indices;
|
||||
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type BlockHashCount = BlockHashCount;
|
||||
type Version = Version;
|
||||
type PalletInfo = PalletInfo;
|
||||
@@ -229,8 +229,8 @@ impl frame_system::Config for Runtime {
|
||||
impl pallet_randomness_collective_flip::Config for Runtime {}
|
||||
|
||||
impl pallet_utility::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type PalletsOrigin = OriginCaller;
|
||||
type WeightInfo = pallet_utility::weights::SubstrateWeight<Runtime>;
|
||||
}
|
||||
@@ -243,8 +243,8 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_multisig::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Currency = Balances;
|
||||
type DepositBase = DepositBase;
|
||||
type DepositFactor = DepositFactor;
|
||||
@@ -286,25 +286,28 @@ impl Default for ProxyType {
|
||||
Self::Any
|
||||
}
|
||||
}
|
||||
impl InstanceFilter<Call> for ProxyType {
|
||||
fn filter(&self, c: &Call) -> bool {
|
||||
impl InstanceFilter<RuntimeCall> for ProxyType {
|
||||
fn filter(&self, c: &RuntimeCall) -> bool {
|
||||
match self {
|
||||
ProxyType::Any => true,
|
||||
ProxyType::NonTransfer => !matches!(
|
||||
c,
|
||||
Call::Balances(..) |
|
||||
Call::Assets(..) | Call::Uniques(..) |
|
||||
Call::Vesting(pallet_vesting::Call::vested_transfer { .. }) |
|
||||
Call::Indices(pallet_indices::Call::transfer { .. })
|
||||
RuntimeCall::Balances(..) |
|
||||
RuntimeCall::Assets(..) |
|
||||
RuntimeCall::Uniques(..) |
|
||||
RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. }) |
|
||||
RuntimeCall::Indices(pallet_indices::Call::transfer { .. })
|
||||
),
|
||||
ProxyType::Governance => matches!(
|
||||
c,
|
||||
Call::Democracy(..) |
|
||||
Call::Council(..) | Call::Society(..) |
|
||||
Call::TechnicalCommittee(..) |
|
||||
Call::Elections(..) | Call::Treasury(..)
|
||||
RuntimeCall::Democracy(..) |
|
||||
RuntimeCall::Council(..) |
|
||||
RuntimeCall::Society(..) |
|
||||
RuntimeCall::TechnicalCommittee(..) |
|
||||
RuntimeCall::Elections(..) |
|
||||
RuntimeCall::Treasury(..)
|
||||
),
|
||||
ProxyType::Staking => matches!(c, Call::Staking(..)),
|
||||
ProxyType::Staking => matches!(c, RuntimeCall::Staking(..)),
|
||||
}
|
||||
}
|
||||
fn is_superset(&self, o: &Self) -> bool {
|
||||
@@ -319,8 +322,8 @@ impl InstanceFilter<Call> for ProxyType {
|
||||
}
|
||||
|
||||
impl pallet_proxy::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Currency = Balances;
|
||||
type ProxyType = ProxyType;
|
||||
type ProxyDepositBase = ProxyDepositBase;
|
||||
@@ -341,10 +344,10 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_scheduler::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Origin = Origin;
|
||||
type PalletsOrigin = OriginCaller;
|
||||
type Call = Call;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type MaximumWeight = MaximumSchedulerWeight;
|
||||
type ScheduleOrigin = EnsureRoot<AccountId>;
|
||||
type MaxScheduledPerBlock = ConstU32<50>;
|
||||
@@ -363,7 +366,7 @@ parameter_types! {
|
||||
|
||||
impl pallet_preimage::Config for Runtime {
|
||||
type WeightInfo = pallet_preimage::weights::SubstrateWeight<Runtime>;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Currency = Balances;
|
||||
type ManagerOrigin = EnsureRoot<AccountId>;
|
||||
type MaxSize = PreimageMaxSize;
|
||||
@@ -413,7 +416,7 @@ impl pallet_indices::Config for Runtime {
|
||||
type AccountIndex = AccountIndex;
|
||||
type Currency = Balances;
|
||||
type Deposit = IndexDeposit;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type WeightInfo = pallet_indices::weights::SubstrateWeight<Runtime>;
|
||||
}
|
||||
|
||||
@@ -431,7 +434,7 @@ impl pallet_balances::Config for Runtime {
|
||||
type ReserveIdentifier = [u8; 8];
|
||||
type Balance = Balance;
|
||||
type DustRemoval = ();
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type ExistentialDeposit = ExistentialDeposit;
|
||||
type AccountStore = frame_system::Pallet<Runtime>;
|
||||
type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>;
|
||||
@@ -446,7 +449,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_transaction_payment::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnChargeTransaction = CurrencyAdapter<Balances, DealWithFees>;
|
||||
type OperationalFeeMultiplier = OperationalFeeMultiplier;
|
||||
type WeightToFee = IdentityFee<Balance>;
|
||||
@@ -456,7 +459,7 @@ impl pallet_transaction_payment::Config for Runtime {
|
||||
}
|
||||
|
||||
impl pallet_asset_tx_payment::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Fungibles = Assets;
|
||||
type OnChargeAssetTransaction = pallet_asset_tx_payment::FungiblesAdapter<
|
||||
pallet_assets::BalanceToAssetBalance<Balances, Runtime, ConvertInto>,
|
||||
@@ -496,7 +499,7 @@ impl_opaque_keys! {
|
||||
}
|
||||
|
||||
impl pallet_session::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type ValidatorId = <Self as frame_system::Config>::AccountId;
|
||||
type ValidatorIdOf = pallet_staking::StashOf<Self>;
|
||||
type ShouldEndSession = Babe;
|
||||
@@ -546,7 +549,7 @@ impl pallet_staking::Config for Runtime {
|
||||
type UnixTime = Timestamp;
|
||||
type CurrencyToVote = U128CurrencyToVote;
|
||||
type RewardRemainder = Treasury;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Slash = Treasury; // send the slashed funds to the treasury.
|
||||
type Reward = (); // rewards are minted from the void
|
||||
type SessionsPerEra = SessionsPerEra;
|
||||
@@ -686,7 +689,7 @@ impl pallet_election_provider_multi_phase::MinerConfig for Runtime {
|
||||
}
|
||||
|
||||
impl pallet_election_provider_multi_phase::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Currency = Balances;
|
||||
type EstimateCallFee = TransactionPayment;
|
||||
type SignedPhase = SignedPhase;
|
||||
@@ -721,7 +724,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_bags_list::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type ScoreProvider = Staking;
|
||||
type WeightInfo = pallet_bags_list::weights::SubstrateWeight<Runtime>;
|
||||
type BagThresholds = BagThresholds;
|
||||
@@ -750,7 +753,7 @@ impl Convert<sp_core::U256, Balance> for U256ToBalance {
|
||||
|
||||
impl pallet_nomination_pools::Config for Runtime {
|
||||
type WeightInfo = ();
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Currency = Balances;
|
||||
type CurrencyBalance = Balance;
|
||||
type RewardCounter = FixedU128;
|
||||
@@ -770,7 +773,7 @@ parameter_types! {
|
||||
|
||||
impl pallet_conviction_voting::Config for Runtime {
|
||||
type WeightInfo = pallet_conviction_voting::weights::SubstrateWeight<Self>;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Currency = Balances;
|
||||
type VoteLockingPeriod = VoteLockingPeriod;
|
||||
type MaxVotes = ConstU32<512>;
|
||||
@@ -827,8 +830,8 @@ impl pallet_referenda::TracksInfo<Balance, BlockNumber> for TracksInfo {
|
||||
|
||||
impl pallet_referenda::Config for Runtime {
|
||||
type WeightInfo = pallet_referenda::weights::SubstrateWeight<Self>;
|
||||
type Call = Call;
|
||||
type Event = Event;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Scheduler = Scheduler;
|
||||
type Currency = pallet_balances::Pallet<Self>;
|
||||
type SubmitOrigin = EnsureSigned<AccountId>;
|
||||
@@ -846,8 +849,8 @@ impl pallet_referenda::Config for Runtime {
|
||||
|
||||
impl pallet_referenda::Config<pallet_referenda::Instance2> for Runtime {
|
||||
type WeightInfo = pallet_referenda::weights::SubstrateWeight<Self>;
|
||||
type Call = Call;
|
||||
type Event = Event;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Scheduler = Scheduler;
|
||||
type Currency = pallet_balances::Pallet<Self>;
|
||||
type SubmitOrigin = EnsureSigned<AccountId>;
|
||||
@@ -865,7 +868,7 @@ impl pallet_referenda::Config<pallet_referenda::Instance2> for Runtime {
|
||||
|
||||
impl pallet_ranked_collective::Config for Runtime {
|
||||
type WeightInfo = pallet_ranked_collective::weights::SubstrateWeight<Self>;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type PromoteOrigin = EnsureRootWithSuccess<AccountId, ConstU16<65535>>;
|
||||
type DemoteOrigin = EnsureRootWithSuccess<AccountId, ConstU16<65535>>;
|
||||
type Polls = RankedPolls;
|
||||
@@ -875,7 +878,7 @@ impl pallet_ranked_collective::Config for Runtime {
|
||||
|
||||
impl pallet_remark::Config for Runtime {
|
||||
type WeightInfo = pallet_remark::weights::SubstrateWeight<Self>;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -889,8 +892,8 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_democracy::Config for Runtime {
|
||||
type Proposal = Call;
|
||||
type Event = Event;
|
||||
type Proposal = RuntimeCall;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Currency = Balances;
|
||||
type EnactmentPeriod = EnactmentPeriod;
|
||||
type LaunchPeriod = LaunchPeriod;
|
||||
@@ -948,8 +951,8 @@ parameter_types! {
|
||||
type CouncilCollective = pallet_collective::Instance1;
|
||||
impl pallet_collective::Config<CouncilCollective> for Runtime {
|
||||
type Origin = Origin;
|
||||
type Proposal = Call;
|
||||
type Event = Event;
|
||||
type Proposal = RuntimeCall;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type MotionDuration = CouncilMotionDuration;
|
||||
type MaxProposals = CouncilMaxProposals;
|
||||
type MaxMembers = CouncilMaxMembers;
|
||||
@@ -975,7 +978,7 @@ parameter_types! {
|
||||
const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get());
|
||||
|
||||
impl pallet_elections_phragmen::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type PalletId = ElectionsPhragmenPalletId;
|
||||
type Currency = Balances;
|
||||
type ChangeMembers = Council;
|
||||
@@ -1005,8 +1008,8 @@ parameter_types! {
|
||||
type TechnicalCollective = pallet_collective::Instance2;
|
||||
impl pallet_collective::Config<TechnicalCollective> for Runtime {
|
||||
type Origin = Origin;
|
||||
type Proposal = Call;
|
||||
type Event = Event;
|
||||
type Proposal = RuntimeCall;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type MotionDuration = TechnicalMotionDuration;
|
||||
type MaxProposals = TechnicalMaxProposals;
|
||||
type MaxMembers = TechnicalMaxMembers;
|
||||
@@ -1019,7 +1022,7 @@ type EnsureRootOrHalfCouncil = EitherOfDiverse<
|
||||
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>,
|
||||
>;
|
||||
impl pallet_membership::Config<pallet_membership::Instance1> for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type AddOrigin = EnsureRootOrHalfCouncil;
|
||||
type RemoveOrigin = EnsureRootOrHalfCouncil;
|
||||
type SwapOrigin = EnsureRootOrHalfCouncil;
|
||||
@@ -1056,7 +1059,7 @@ impl pallet_treasury::Config for Runtime {
|
||||
EnsureRoot<AccountId>,
|
||||
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>,
|
||||
>;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type OnSlash = ();
|
||||
type ProposalBond = ProposalBond;
|
||||
type ProposalBondMinimum = ProposalBondMinimum;
|
||||
@@ -1082,7 +1085,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_bounties::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type BountyDepositBase = BountyDepositBase;
|
||||
type BountyDepositPayoutDelay = BountyDepositPayoutDelay;
|
||||
type BountyUpdatePeriod = BountyUpdatePeriod;
|
||||
@@ -1101,14 +1104,14 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_child_bounties::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type MaxActiveChildBountyCount = ConstU32<5>;
|
||||
type ChildBountyValueMinimum = ChildBountyValueMinimum;
|
||||
type WeightInfo = pallet_child_bounties::weights::SubstrateWeight<Runtime>;
|
||||
}
|
||||
|
||||
impl pallet_tips::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type DataDepositPerByte = DataDepositPerByte;
|
||||
type MaximumReasonLength = MaximumReasonLength;
|
||||
type Tippers = Elections;
|
||||
@@ -1136,8 +1139,8 @@ impl pallet_contracts::Config for Runtime {
|
||||
type Time = Timestamp;
|
||||
type Randomness = RandomnessCollectiveFlip;
|
||||
type Currency = Balances;
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
/// The safest default is to allow no calls at all.
|
||||
///
|
||||
/// Runtimes should whitelist dispatchables that are allowed to be called from contracts
|
||||
@@ -1162,8 +1165,8 @@ impl pallet_contracts::Config for Runtime {
|
||||
}
|
||||
|
||||
impl pallet_sudo::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -1178,14 +1181,14 @@ parameter_types! {
|
||||
|
||||
impl<LocalCall> frame_system::offchain::CreateSignedTransaction<LocalCall> for Runtime
|
||||
where
|
||||
Call: From<LocalCall>,
|
||||
RuntimeCall: From<LocalCall>,
|
||||
{
|
||||
fn create_transaction<C: frame_system::offchain::AppCrypto<Self::Public, Self::Signature>>(
|
||||
call: Call,
|
||||
call: RuntimeCall,
|
||||
public: <Signature as traits::Verify>::Signer,
|
||||
account: AccountId,
|
||||
nonce: Index,
|
||||
) -> Option<(Call, <UncheckedExtrinsic as traits::Extrinsic>::SignaturePayload)> {
|
||||
) -> Option<(RuntimeCall, <UncheckedExtrinsic as traits::Extrinsic>::SignaturePayload)> {
|
||||
let tip = 0;
|
||||
// take the biggest period possible.
|
||||
let period =
|
||||
@@ -1225,15 +1228,15 @@ impl frame_system::offchain::SigningTypes for Runtime {
|
||||
|
||||
impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime
|
||||
where
|
||||
Call: From<C>,
|
||||
RuntimeCall: From<C>,
|
||||
{
|
||||
type Extrinsic = UncheckedExtrinsic;
|
||||
type OverarchingCall = Call;
|
||||
type OverarchingCall = RuntimeCall;
|
||||
}
|
||||
|
||||
impl pallet_im_online::Config for Runtime {
|
||||
type AuthorityId = ImOnlineId;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type NextSessionRotation = Babe;
|
||||
type ValidatorSet = Historical;
|
||||
type ReportUnresponsiveness = Offences;
|
||||
@@ -1245,7 +1248,7 @@ impl pallet_im_online::Config for Runtime {
|
||||
}
|
||||
|
||||
impl pallet_offences::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
|
||||
type OnOffenceHandler = Staking;
|
||||
}
|
||||
@@ -1255,8 +1258,7 @@ impl pallet_authority_discovery::Config for Runtime {
|
||||
}
|
||||
|
||||
impl pallet_grandpa::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
|
||||
type KeyOwnerProofSystem = Historical;
|
||||
|
||||
@@ -1288,7 +1290,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_identity::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Currency = Balances;
|
||||
type BasicDeposit = BasicDeposit;
|
||||
type FieldDeposit = FieldDeposit;
|
||||
@@ -1310,9 +1312,9 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_recovery::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type WeightInfo = pallet_recovery::weights::SubstrateWeight<Runtime>;
|
||||
type Call = Call;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Currency = Balances;
|
||||
type ConfigDepositBase = ConfigDepositBase;
|
||||
type FriendDepositFactor = FriendDepositFactor;
|
||||
@@ -1333,7 +1335,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_society::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type PalletId = SocietyPalletId;
|
||||
type Currency = Balances;
|
||||
type Randomness = RandomnessCollectiveFlip;
|
||||
@@ -1356,7 +1358,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_vesting::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Currency = Balances;
|
||||
type BlockNumberToBalance = ConvertInto;
|
||||
type MinVestedTransfer = MinVestedTransfer;
|
||||
@@ -1383,10 +1385,10 @@ parameter_types! {
|
||||
|
||||
impl pallet_lottery::Config for Runtime {
|
||||
type PalletId = LotteryPalletId;
|
||||
type Call = Call;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Currency = Balances;
|
||||
type Randomness = RandomnessCollectiveFlip;
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type ManagerOrigin = EnsureRoot<AccountId>;
|
||||
type MaxCalls = MaxCalls;
|
||||
type ValidateCall = Lottery;
|
||||
@@ -1403,7 +1405,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_assets::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Balance = u128;
|
||||
type AssetId = u32;
|
||||
type Currency = Balances;
|
||||
@@ -1431,7 +1433,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_gilt::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Currency = Balances;
|
||||
type CurrencyBalance = Balance;
|
||||
type AdminOrigin = frame_system::EnsureRoot<AccountId>;
|
||||
@@ -1456,7 +1458,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_uniques::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type CollectionId = u32;
|
||||
type ItemId = u32;
|
||||
type Currency = Balances;
|
||||
@@ -1477,9 +1479,9 @@ impl pallet_uniques::Config for Runtime {
|
||||
}
|
||||
|
||||
impl pallet_transaction_storage::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Currency = Balances;
|
||||
type Call = Call;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type FeeDestination = ();
|
||||
type WeightInfo = pallet_transaction_storage::weights::SubstrateWeight<Runtime>;
|
||||
type MaxBlockTransactions =
|
||||
@@ -1489,8 +1491,8 @@ impl pallet_transaction_storage::Config for Runtime {
|
||||
}
|
||||
|
||||
impl pallet_whitelist::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type WhitelistOrigin = EnsureRoot<AccountId>;
|
||||
type DispatchWhitelistedOrigin = EnsureRoot<AccountId>;
|
||||
type PreimageProvider = Preimage;
|
||||
@@ -1504,7 +1506,7 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_state_trie_migration::Config for Runtime {
|
||||
type Event = Event;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type ControlOrigin = EnsureRoot<AccountId>;
|
||||
type Currency = Balances;
|
||||
type MaxKeyLen = MigrationMaxKeyLen;
|
||||
@@ -1529,8 +1531,8 @@ parameter_types! {
|
||||
type AllianceCollective = pallet_collective::Instance3;
|
||||
impl pallet_collective::Config<AllianceCollective> for Runtime {
|
||||
type Origin = Origin;
|
||||
type Proposal = Call;
|
||||
type Event = Event;
|
||||
type Proposal = RuntimeCall;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type MotionDuration = AllianceMotionDuration;
|
||||
type MaxProposals = AllianceMaxProposals;
|
||||
type MaxMembers = AllianceMaxMembers;
|
||||
@@ -1547,8 +1549,8 @@ parameter_types! {
|
||||
}
|
||||
|
||||
impl pallet_alliance::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Proposal = Call;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Proposal = RuntimeCall;
|
||||
type AdminOrigin = EitherOfDiverse<
|
||||
EnsureRoot<AccountId>,
|
||||
pallet_collective::EnsureProportionMoreThan<AccountId, AllianceCollective, 2, 3>,
|
||||
@@ -1673,12 +1675,14 @@ pub type SignedExtra = (
|
||||
frame_system::CheckWeight<Runtime>,
|
||||
pallet_asset_tx_payment::ChargeAssetTxPayment<Runtime>,
|
||||
);
|
||||
|
||||
/// Unchecked extrinsic type as expected by this runtime.
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
|
||||
pub type UncheckedExtrinsic =
|
||||
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
|
||||
/// The payload being signed in transactions.
|
||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||
pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;
|
||||
/// Extrinsic type that has already been checked.
|
||||
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;
|
||||
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;
|
||||
/// Executive: handles dispatch to the various modules.
|
||||
pub type Executive = frame_executive::Executive<
|
||||
Runtime,
|
||||
@@ -1977,13 +1981,13 @@ impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, Call>
|
||||
impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi<Block, Balance, RuntimeCall>
|
||||
for Runtime
|
||||
{
|
||||
fn query_call_info(call: Call, len: u32) -> RuntimeDispatchInfo<Balance> {
|
||||
fn query_call_info(call: RuntimeCall, len: u32) -> RuntimeDispatchInfo<Balance> {
|
||||
TransactionPayment::query_call_info(call, len)
|
||||
}
|
||||
fn query_call_fee_details(call: Call, len: u32) -> FeeDetails<Balance> {
|
||||
fn query_call_fee_details(call: RuntimeCall, len: u32) -> FeeDetails<Balance> {
|
||||
TransactionPayment::query_call_fee_details(call, len)
|
||||
}
|
||||
}
|
||||
@@ -2178,7 +2182,7 @@ mod tests {
|
||||
fn validate_transaction_submitter_bounds() {
|
||||
fn is_submit_signed_transaction<T>()
|
||||
where
|
||||
T: CreateSignedTransaction<Call>,
|
||||
T: CreateSignedTransaction<RuntimeCall>,
|
||||
{
|
||||
}
|
||||
|
||||
@@ -2198,11 +2202,11 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn call_size() {
|
||||
let size = core::mem::size_of::<Call>();
|
||||
let size = core::mem::size_of::<RuntimeCall>();
|
||||
assert!(
|
||||
size <= 208,
|
||||
"size of Call {} is more than 208 bytes: some calls have too big arguments, use Box to reduce the
|
||||
size of Call.
|
||||
"size of RuntimeCall {} is more than 208 bytes: some calls have too big arguments, use Box to reduce the
|
||||
size of RuntimeCall.
|
||||
If the limit is too strong, maybe consider increase the limit to 300.",
|
||||
size,
|
||||
);
|
||||
|
||||
@@ -35,8 +35,8 @@ use crate::{
|
||||
use codec::{Decode, Encode};
|
||||
use futures::executor;
|
||||
use kitchensink_runtime::{
|
||||
constants::currency::DOLLARS, AccountId, BalancesCall, Call, CheckedExtrinsic, MinimumPeriod,
|
||||
Signature, SystemCall, UncheckedExtrinsic,
|
||||
constants::currency::DOLLARS, AccountId, BalancesCall, CheckedExtrinsic, MinimumPeriod,
|
||||
RuntimeCall, Signature, SystemCall, UncheckedExtrinsic,
|
||||
};
|
||||
use node_primitives::Block;
|
||||
use sc_block_builder::BlockBuilderProvider;
|
||||
@@ -308,12 +308,12 @@ impl<'a> Iterator for BlockContentIterator<'a> {
|
||||
)),
|
||||
function: match self.content.block_type {
|
||||
BlockType::RandomTransfersKeepAlive =>
|
||||
Call::Balances(BalancesCall::transfer_keep_alive {
|
||||
RuntimeCall::Balances(BalancesCall::transfer_keep_alive {
|
||||
dest: sp_runtime::MultiAddress::Id(receiver),
|
||||
value: kitchensink_runtime::ExistentialDeposit::get() + 1,
|
||||
}),
|
||||
BlockType::RandomTransfersReaping => {
|
||||
Call::Balances(BalancesCall::transfer {
|
||||
RuntimeCall::Balances(BalancesCall::transfer {
|
||||
dest: sp_runtime::MultiAddress::Id(receiver),
|
||||
// Transfer so that ending balance would be 1 less than existential
|
||||
// deposit so that we kill the sender account.
|
||||
@@ -321,7 +321,8 @@ impl<'a> Iterator for BlockContentIterator<'a> {
|
||||
(kitchensink_runtime::ExistentialDeposit::get() - 1),
|
||||
})
|
||||
},
|
||||
BlockType::Noop => Call::System(SystemCall::remark { remark: Vec::new() }),
|
||||
BlockType::Noop =>
|
||||
RuntimeCall::System(SystemCall::remark { remark: Vec::new() }),
|
||||
},
|
||||
},
|
||||
self.runtime_version.spec_version,
|
||||
|
||||
Reference in New Issue
Block a user