mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 17:31:03 +00:00
Rename Origin (#6020)
* Rename Origin
* fmt
* fixes
* more fixes
* fix
* more fixing
* small fixes
* last touches
* update lockfile for {"substrate"}
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -54,7 +54,7 @@ impl frame_system::Config for Test {
|
||||
type BlockWeights = ();
|
||||
type BlockLength = ();
|
||||
type DbWeight = ();
|
||||
type Origin = Origin;
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type Index = u64;
|
||||
type BlockNumber = u64;
|
||||
type Hash = H256;
|
||||
|
||||
@@ -60,7 +60,7 @@ impl frame_system::Config for Test {
|
||||
type BlockWeights = ();
|
||||
type BlockLength = ();
|
||||
type DbWeight = ();
|
||||
type Origin = Origin;
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type Index = u64;
|
||||
type BlockNumber = u64;
|
||||
type Hash = H256;
|
||||
@@ -103,7 +103,7 @@ impl xcm_executor::Config for XcmConfig {
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type XcmSender = DevNull;
|
||||
type AssetTransactor = NoAssetTransactor;
|
||||
type OriginConverter = AlwaysSignedByDefault<Origin>;
|
||||
type OriginConverter = AlwaysSignedByDefault<RuntimeOrigin>;
|
||||
type IsReserve = AllAssetLocationsPass;
|
||||
type IsTeleporter = ();
|
||||
type LocationInverter = xcm_builder::LocationInverter<Ancestry>;
|
||||
@@ -159,18 +159,18 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
|
||||
t.into()
|
||||
}
|
||||
|
||||
pub struct AlwaysSignedByDefault<Origin>(core::marker::PhantomData<Origin>);
|
||||
impl<Origin> ConvertOrigin<Origin> for AlwaysSignedByDefault<Origin>
|
||||
pub struct AlwaysSignedByDefault<RuntimeOrigin>(core::marker::PhantomData<RuntimeOrigin>);
|
||||
impl<RuntimeOrigin> ConvertOrigin<RuntimeOrigin> for AlwaysSignedByDefault<RuntimeOrigin>
|
||||
where
|
||||
Origin: OriginTrait,
|
||||
<Origin as OriginTrait>::AccountId: Decode,
|
||||
RuntimeOrigin: OriginTrait,
|
||||
<RuntimeOrigin as OriginTrait>::AccountId: Decode,
|
||||
{
|
||||
fn convert_origin(
|
||||
_origin: impl Into<MultiLocation>,
|
||||
_kind: OriginKind,
|
||||
) -> Result<Origin, MultiLocation> {
|
||||
Ok(Origin::signed(
|
||||
<Origin as OriginTrait>::AccountId::decode(&mut TrailingZeroInput::zeroes())
|
||||
) -> Result<RuntimeOrigin, MultiLocation> {
|
||||
Ok(RuntimeOrigin::signed(
|
||||
<RuntimeOrigin as OriginTrait>::AccountId::decode(&mut TrailingZeroInput::zeroes())
|
||||
.expect("infinite length input; no invalid inputs for type; qed"),
|
||||
))
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ pub mod pallet {
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config<I: 'static = ()>: frame_system::Config + crate::Config {
|
||||
type RuntimeCall: Dispatchable<Origin = Self::Origin>
|
||||
type RuntimeCall: Dispatchable<RuntimeOrigin = Self::RuntimeOrigin>
|
||||
+ GetDispatchInfo
|
||||
+ From<frame_system::Call<Self>>
|
||||
+ Encode;
|
||||
|
||||
Reference in New Issue
Block a user