Skip to content

Commit

Permalink
refactor: use runtime prefix for all events, origins, calls
Browse files Browse the repository at this point in the history
  • Loading branch information
wischli committed Dec 6, 2022
1 parent 91d932b commit fde113c
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion pallets/attestation/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ pub(crate) mod runtime {
}

impl mock_origin::Config for Test {
type Origin = RuntimeOrigin;
type RuntimeOrigin = RuntimeOrigin;
type AccountId = AccountId;
type SubjectId = SubjectId;
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/ctype/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub mod runtime {
}

impl mock_origin::Config for Test {
type Origin = RuntimeOrigin;
type RuntimeOrigin = RuntimeOrigin;
type AccountId = AccountId;
type SubjectId = SubjectId;
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/delegation/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ pub(crate) mod runtime {
}

impl mock_origin::Config for Test {
type Origin = RuntimeOrigin;
type RuntimeOrigin = RuntimeOrigin;
type AccountId = AccountId;
type SubjectId = SubjectId;
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/did/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fn generate_base_did_call_operation<T: Config>(
did: DidIdentifierOf<T>,
submitter: AccountIdOf<T>,
) -> DidAuthorizedCallOperation<T> {
let test_call = <T as Config>::Call::get_call_for_did_call_benchmark();
let test_call = <T as Config>::RuntimeCall::get_call_for_did_call_benchmark();

DidAuthorizedCallOperation {
did,
Expand Down
10 changes: 5 additions & 5 deletions pallets/did/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ pub mod pallet {
pub type BlockNumberOf<T> = <T as frame_system::Config>::BlockNumber;

/// Type for a runtime extrinsic callable under DID-based authorisation.
pub type DidCallableOf<T> = <T as Config>::Call;
pub type DidCallableOf<T> = <T as Config>::RuntimeCall;

/// Type for origin that supports a DID sender.
#[pallet::origin]
Expand All @@ -187,8 +187,8 @@ pub mod pallet {
pub trait Config: frame_system::Config + Debug {
/// Type for a dispatchable call that can be proxied through the DID
/// pallet to support DID-based authorisation.
type Call: Parameter
+ Dispatchable<PostInfo = PostDispatchInfo, RuntimeOrigin = <Self as Config>::Origin>
type RuntimeCall: Parameter
+ Dispatchable<PostInfo = PostDispatchInfo, RuntimeOrigin = <Self as Config>::RuntimeOrigin>
+ GetDispatchInfo
+ DeriveDidCallAuthorizationVerificationKeyRelationship;

Expand All @@ -197,9 +197,9 @@ pub mod pallet {

/// Origin type expected by the proxied dispatchable calls.
#[cfg(not(feature = "runtime-benchmarks"))]
type Origin: From<DidRawOrigin<DidIdentifierOf<Self>, AccountIdOf<Self>>>;
type RuntimeOrigin: From<DidRawOrigin<DidIdentifierOf<Self>, AccountIdOf<Self>>>;
#[cfg(feature = "runtime-benchmarks")]
type Origin: From<RawOrigin<DidIdentifierOf<Self>>>;
type RuntimeOrigin: From<RawOrigin<DidIdentifierOf<Self>>>;

/// The origin check for all DID calls inside this pallet.
type EnsureOrigin: EnsureOrigin<
Expand Down
4 changes: 2 additions & 2 deletions pallets/did/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ where

impl Config for Test {
type DidIdentifier = DidIdentifier;
type Origin = RuntimeOrigin;
type Call = RuntimeCall;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type EnsureOrigin = EnsureSigned<DidIdentifier>;
type OriginSuccess = AccountId;
type RuntimeEvent = ();
Expand Down
2 changes: 1 addition & 1 deletion pallets/pallet-did-lookup/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl pallet_did_lookup::Config for Test {
}

impl mock_origin::Config for Test {
type Origin = RuntimeOrigin;
type RuntimeOrigin = RuntimeOrigin;
type AccountId = AccountId;
type SubjectId = SubjectId;
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/pallet-web3-names/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub(crate) mod runtime {
}

impl mock_origin::Config for Test {
type Origin = RuntimeOrigin;
type RuntimeOrigin = RuntimeOrigin;
type AccountId = AccountId;
type SubjectId = SubjectId;
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/public-credentials/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ pub(crate) mod runtime {
);

impl mock_origin::Config for Test {
type Origin = RuntimeOrigin;
type RuntimeOrigin = RuntimeOrigin;
type AccountId = AccountId;
type SubjectId = SubjectId;
}
Expand Down
4 changes: 2 additions & 2 deletions runtimes/peregrine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,8 @@ impl ctype::Config for Runtime {
impl did::Config for Runtime {
type DidIdentifier = DidIdentifier;
type RuntimeEvent = RuntimeEvent;
type Call = RuntimeCall;
type Origin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeOrigin = RuntimeOrigin;
type Currency = Balances;
type Deposit = constants::did::DidDeposit;
type Fee = constants::did::DidFee;
Expand Down
4 changes: 2 additions & 2 deletions runtimes/spiritnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,8 @@ impl ctype::Config for Runtime {
impl did::Config for Runtime {
type DidIdentifier = DidIdentifier;
type RuntimeEvent = RuntimeEvent;
type Call = RuntimeCall;
type Origin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeOrigin = RuntimeOrigin;
type Currency = Balances;
type Deposit = constants::did::DidDeposit;
type Fee = constants::did::DidFee;
Expand Down
4 changes: 2 additions & 2 deletions runtimes/standalone/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ parameter_types! {
impl did::Config for Runtime {
type DidIdentifier = DidIdentifier;
type RuntimeEvent = RuntimeEvent;
type Call = RuntimeCall;
type Origin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeOrigin = RuntimeOrigin;
type Currency = Balances;
type Deposit = DidDeposit;
type Fee = DidFee;
Expand Down
2 changes: 1 addition & 1 deletion support/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub mod mock_origin {

#[pallet::config]
pub trait Config: frame_system::Config {
type Origin: From<Origin<Self>>;
type RuntimeOrigin: From<Origin<Self>>;
type AccountId: Parameter;
type SubjectId: Parameter;
}
Expand Down

0 comments on commit fde113c

Please sign in to comment.