Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

BREAKING: Rename Call & Event #11981

Merged
merged 96 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
af009b3
rename Event to RuntimeEvent
Szegoo Aug 5, 2022
077acde
rename Call
Szegoo Aug 5, 2022
6f7d309
rename in runtimes
Szegoo Aug 5, 2022
a9da5e0
Merge branch 'master' into rename-outer-enums
Szegoo Aug 5, 2022
cf619fc
small fix
Szegoo Aug 5, 2022
0b95e23
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Aug 6, 2022
6ab11ff
rename Event
Szegoo Aug 6, 2022
7f14aca
small fix & rename RuntimeCall back to Call for now
Szegoo Aug 6, 2022
c9b7f08
small fixes
Szegoo Aug 6, 2022
bb71d37
more renaming
Szegoo Aug 7, 2022
c9b7f2f
a bit more renaming
Szegoo Aug 8, 2022
7b84a0d
fmt
Szegoo Aug 8, 2022
ec65df5
small fix
Szegoo Aug 8, 2022
7613696
commit
Szegoo Aug 8, 2022
02b5ea2
prep for renaming associated types
Szegoo Aug 8, 2022
4410148
fix
Szegoo Aug 8, 2022
f814ecb
rename associated Event type
Szegoo Aug 8, 2022
ca9d2a4
rename to RuntimeEvent
Szegoo Aug 9, 2022
e917961
commit
Szegoo Aug 21, 2022
0825ee5
Merge branch 'master' into rename-outer-enums
Szegoo Aug 21, 2022
afb5a9e
merge conflict fixes & fmt
Szegoo Aug 21, 2022
9892a96
additional renaming
Szegoo Aug 21, 2022
d4c28cf
fix.
Szegoo Aug 21, 2022
dffa487
fix decl_event
Szegoo Aug 21, 2022
100c7e4
rename in tests
Szegoo Aug 21, 2022
1903504
remove warnings
Szegoo Aug 21, 2022
6a33348
remove accidental rename
Szegoo Aug 21, 2022
8df4b49
.
Szegoo Aug 21, 2022
b040a45
commit
Szegoo Aug 21, 2022
e52ced1
update .stderr
Szegoo Aug 22, 2022
e95fecb
fix in test
Szegoo Aug 22, 2022
1372722
update .stderr
Szegoo Aug 22, 2022
29a85b3
TRYBUILD=overwrite
Szegoo Aug 22, 2022
16ff851
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Aug 22, 2022
add05af
docs
Szegoo Aug 22, 2022
f0bb989
fmt
Szegoo Aug 22, 2022
474e32b
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Aug 22, 2022
9a9e5f9
small change in docs
Szegoo Aug 22, 2022
53f6759
rename PalletEvent to Event
Szegoo Aug 24, 2022
e467bfe
rename Call to RuntimeCall
Szegoo Aug 24, 2022
d5b7975
renamed at wrong places :P
Szegoo Aug 24, 2022
795553f
rename Call
Szegoo Aug 24, 2022
32989ee
rename
Szegoo Aug 24, 2022
7bb2347
rename associated type
Szegoo Aug 24, 2022
740e980
fix
Szegoo Aug 24, 2022
5eddd0d
fix & fmt
Szegoo Aug 24, 2022
e1abbf8
commit
Szegoo Aug 24, 2022
064b312
frame-support-test
Szegoo Aug 24, 2022
40a139a
passing tests
Szegoo Aug 24, 2022
22e41f7
update docs
Szegoo Aug 24, 2022
9e91367
rustdoc fix
Szegoo Aug 24, 2022
3103f83
update .stderr
Szegoo Aug 24, 2022
a59c90e
wrong code in docs
Szegoo Aug 25, 2022
8f692ad
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Aug 25, 2022
747aff1
merge fix
Szegoo Aug 25, 2022
53c11e6
Merge branch 'master' into rename-outer-enums
Szegoo Aug 25, 2022
62a2c14
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Aug 25, 2022
eb1ae1b
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Aug 25, 2022
72e54f6
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Aug 26, 2022
164d6d7
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Aug 27, 2022
d575f5b
fix in error message
Szegoo Aug 27, 2022
85a31f4
update .stderr
Szegoo Aug 27, 2022
60f50a0
docs & error message
Szegoo Aug 28, 2022
e2fee69
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Aug 28, 2022
39927f3
.
Szegoo Aug 28, 2022
6d354ec
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Aug 29, 2022
feb0f13
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Aug 29, 2022
fcaebe0
Merge branch 'master' into rename-outer-enums
Szegoo Aug 29, 2022
3a517cc
merge fix
Szegoo Aug 29, 2022
f0569fc
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Aug 30, 2022
af03bf4
Merge branch 'master' into rename-outer-enums
Szegoo Aug 31, 2022
8ae1258
merge fix
Szegoo Aug 31, 2022
77b6181
fmt
Szegoo Aug 31, 2022
4920f92
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Sep 1, 2022
b3b7e33
Merge branch 'master' into rename-outer-enums
Szegoo Sep 1, 2022
fe00ba4
fmt
Szegoo Sep 1, 2022
a92411d
merge fix
Szegoo Sep 1, 2022
8c14f8b
more fixing
Szegoo Sep 1, 2022
2302824
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Sep 1, 2022
a179c08
Merge branch 'master' into rename-outer-enums
Szegoo Sep 2, 2022
e4e9d37
fmt
Szegoo Sep 2, 2022
f87d844
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Sep 2, 2022
79119db
Merge branch 'master' into rename-outer-enums
Szegoo Sep 3, 2022
d2edc1d
Merge branch 'master' into rename-outer-enums
Szegoo Sep 3, 2022
42e504d
remove unused
Szegoo Sep 4, 2022
64336d3
Merge branch 'master' into rename-outer-enums
Szegoo Sep 5, 2022
4395316
fmt
Szegoo Sep 5, 2022
c3de9a6
fix
Szegoo Sep 5, 2022
e6cdd18
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Sep 5, 2022
ba42526
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Sep 6, 2022
b407782
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Sep 7, 2022
3db9639
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Sep 8, 2022
1a3eb8f
Merge branch 'master' into rename-outer-enums
Szegoo Sep 9, 2022
9b25a24
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Sep 11, 2022
695de2c
Merge branch 'paritytech:master' into rename-outer-enums
Szegoo Sep 12, 2022
db3fb26
Merge branch 'master' into pr/11981
shawntabrizi Sep 12, 2022
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
2 changes: 1 addition & 1 deletion bin/node-template/node/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder {
pub fn create_benchmark_extrinsic(
client: &FullClient,
sender: sp_core::sr25519::Pair,
call: runtime::Call,
call: runtime::RuntimeCall,
nonce: u32,
) -> runtime::UncheckedExtrinsic {
let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed");
Expand Down
2 changes: 1 addition & 1 deletion bin/node-template/pallets/template/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {
/// Because this pallet emits events, it depends on the runtime's definition of an event.
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
}

// The pallet's runtime storage items.
Expand Down
6 changes: 3 additions & 3 deletions bin/node-template/pallets/template/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ impl system::Config for Test {
type BlockLength = ();
type DbWeight = ();
type Origin = Origin;
type Call = Call;
type RuntimeCall = RuntimeCall;
type Index = u64;
type BlockNumber = u64;
type Hash = H256;
type Hashing = BlakeTwo256;
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = ConstU64<250>;
type Version = ();
type PalletInfo = PalletInfo;
Expand All @@ -50,7 +50,7 @@ impl system::Config for Test {
}

impl pallet_template::Config for Test {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
}

// Build genesis storage according to the mock runtime.
Expand Down
29 changes: 15 additions & 14 deletions bin/node-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl frame_system::Config for Runtime {
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
/// The aggregated dispatch type that is available for extrinsics.
type Call = Call;
type RuntimeCall = RuntimeCall;
/// The lookup mechanism to get account ID from whatever is passed in dispatchers.
type Lookup = AccountIdLookup<AccountId, ()>;
/// The index type for storing how many extrinsics an account has signed.
Expand All @@ -170,7 +170,7 @@ impl frame_system::Config for Runtime {
/// The header type.
type Header = generic::Header<BlockNumber, BlakeTwo256>;
/// The ubiquitous event type.
type Event = Event;
type RuntimeEvent = RuntimeEvent;
/// The ubiquitous origin type.
type Origin = Origin;
/// Maximum number of block number to block hash mappings to keep (oldest pruned first).
Expand Down Expand Up @@ -207,8 +207,7 @@ impl pallet_aura::Config for Runtime {
}

impl pallet_grandpa::Config for Runtime {
type Event = Event;
type Call = Call;
type RuntimeEvent = RuntimeEvent;

type KeyOwnerProofSystem = ();

Expand Down Expand Up @@ -244,15 +243,15 @@ impl pallet_balances::Config for Runtime {
/// The type for recording an account's balance.
type Balance = Balance;
/// The ubiquitous event type.
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DustRemoval = ();
type ExistentialDeposit = ConstU128<EXISTENTIAL_DEPOSIT>;
type AccountStore = System;
type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>;
}

impl pallet_transaction_payment::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type OnChargeTransaction = CurrencyAdapter<Balances, ()>;
type OperationalFeeMultiplier = ConstU8<5>;
type WeightToFee = IdentityFee<Balance>;
Expand All @@ -261,13 +260,13 @@ impl pallet_transaction_payment::Config for Runtime {
}

impl pallet_sudo::Config for Runtime {
type Event = Event;
type Call = Call;
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
}

/// Configure the pallet-template in pallets/template.
impl pallet_template::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
}

// Create the runtime by composing the FRAME pallets that were previously configured.
Expand Down Expand Up @@ -308,10 +307,12 @@ pub type SignedExtra = (
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<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>;
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Runtime,
Expand Down Expand Up @@ -467,17 +468,17 @@ 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,
call: RuntimeCall,
len: u32,
) -> pallet_transaction_payment::RuntimeDispatchInfo<Balance> {
TransactionPayment::query_call_info(call, len)
}
fn query_call_fee_details(
call: Call,
call: RuntimeCall,
len: u32,
) -> pallet_transaction_payment::FeeDetails<Balance> {
TransactionPayment::query_call_fee_details(call, len)
Expand Down
2 changes: 1 addition & 1 deletion bin/node/cli/benches/block_production.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
10 changes: 6 additions & 4 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions bin/node/executor/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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,
}),
Expand Down
Loading