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:
Sergej Sakac
2022-09-13 00:03:31 +02:00
committed by GitHub
parent 472b5746e5
commit 6e8795afe6
228 changed files with 1791 additions and 1672 deletions
+7 -6
View File
@@ -27,7 +27,7 @@ use sp_runtime::{traits::Hash, DispatchError};
#[test]
fn test_whitelist_call_and_remove() {
new_test_ext().execute_with(|| {
let call = Call::System(frame_system::Call::remark { remark: vec![] });
let call = RuntimeCall::System(frame_system::Call::remark { remark: vec![] });
let encoded_call = call.encode();
let call_hash = <Test as frame_system::Config>::Hashing::hash(&encoded_call[..]);
@@ -69,7 +69,7 @@ fn test_whitelist_call_and_remove() {
#[test]
fn test_whitelist_call_and_execute() {
new_test_ext().execute_with(|| {
let call = Call::System(frame_system::Call::remark_with_event { remark: vec![1] });
let call = RuntimeCall::System(frame_system::Call::remark_with_event { remark: vec![1] });
let call_weight = call.get_dispatch_info().weight;
let encoded_call = call.encode();
let call_hash = <Test as frame_system::Config>::Hashing::hash(&encoded_call[..]);
@@ -118,7 +118,7 @@ fn test_whitelist_call_and_execute() {
#[test]
fn test_whitelist_call_and_execute_failing_call() {
new_test_ext().execute_with(|| {
let call = Call::Whitelist(crate::Call::dispatch_whitelisted_call {
let call = RuntimeCall::Whitelist(crate::Call::dispatch_whitelisted_call {
call_hash: Default::default(),
call_weight_witness: Weight::zero(),
});
@@ -137,8 +137,9 @@ fn test_whitelist_call_and_execute_failing_call() {
#[test]
fn test_whitelist_call_and_execute_without_note_preimage() {
new_test_ext().execute_with(|| {
let call =
Box::new(Call::System(frame_system::Call::remark_with_event { remark: vec![1] }));
let call = Box::new(RuntimeCall::System(frame_system::Call::remark_with_event {
remark: vec![1],
}));
let call_hash = <Test as frame_system::Config>::Hashing::hash_of(&call);
assert_ok!(Whitelist::whitelist_call(Origin::root(), call_hash));
@@ -161,7 +162,7 @@ fn test_whitelist_call_and_execute_without_note_preimage() {
#[test]
fn test_whitelist_call_and_execute_decode_consumes_all() {
new_test_ext().execute_with(|| {
let call = Call::System(frame_system::Call::remark_with_event { remark: vec![1] });
let call = RuntimeCall::System(frame_system::Call::remark_with_event { remark: vec![1] });
let call_weight = call.get_dispatch_info().weight;
let mut call = call.encode();
// Appending something does not make the encoded call invalid.