BREAKING: Rename Origin (#12258)

* BREAKING: Rename Origin

* more renaming

* a bit more renaming

* fix

* more fixing

* fix in frame_support

* even more fixes

* fix

* small fix

* ...

* update .stderr

* docs

* update docs

* update docs

* docs
This commit is contained in:
Sergej Sakac
2022-09-21 00:13:09 +02:00
committed by GitHub
parent 986d20b352
commit e4b6f4a66d
221 changed files with 5233 additions and 4200 deletions
@@ -95,7 +95,7 @@ pub mod pallet {
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// A dispatchable call.
type RuntimeCall: Parameter
+ Dispatchable<Origin = Self::Origin>
+ Dispatchable<RuntimeOrigin = Self::RuntimeOrigin>
+ GetDispatchInfo
+ From<frame_system::Call<Self>>;
/// The currency trait.
@@ -51,7 +51,7 @@ impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
type Origin = Origin;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type Index = u64;
type BlockNumber = u64;
@@ -116,7 +116,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
pub fn run_to_block(n: u64, f: impl Fn() -> Option<TransactionStorageProof>) {
while System::block_number() < n {
if let Some(proof) = f() {
TransactionStorage::check_proof(Origin::none(), proof).unwrap();
TransactionStorage::check_proof(RuntimeOrigin::none(), proof).unwrap();
}
TransactionStorage::on_finalize(System::block_number());
System::on_finalize(System::block_number());
@@ -95,7 +95,7 @@ fn checks_proof() {
let proof =
build_proof(parent_hash.as_ref(), vec![vec![0u8; MAX_DATA_SIZE as usize]]).unwrap();
assert_noop!(
TransactionStorage::<Test>::check_proof(Origin::none(), proof,),
TransactionStorage::<Test>::check_proof(RuntimeOrigin::none(), proof,),
Error::<Test>::UnexpectedProof,
);
run_to_block(11, || None);
@@ -103,13 +103,13 @@ fn checks_proof() {
let invalid_proof = build_proof(parent_hash.as_ref(), vec![vec![0u8; 1000]]).unwrap();
assert_noop!(
TransactionStorage::<Test>::check_proof(Origin::none(), invalid_proof,),
TransactionStorage::<Test>::check_proof(RuntimeOrigin::none(), invalid_proof,),
Error::<Test>::InvalidProof,
);
let proof =
build_proof(parent_hash.as_ref(), vec![vec![0u8; MAX_DATA_SIZE as usize]]).unwrap();
assert_ok!(TransactionStorage::<Test>::check_proof(Origin::none(), proof));
assert_ok!(TransactionStorage::<Test>::check_proof(RuntimeOrigin::none(), proof));
});
}