difftreelog
feat scheduler feature
in: master
6 files changed
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -119,8 +119,9 @@
"orml-vesting/std",
]
limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-opal-runtime = ['rmrk']
+opal-runtime = ['scheduler', 'rmrk']
+scheduler = []
rmrk = []
################################################################################
runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -110,7 +110,7 @@
use polkadot_parachain::primitives::Sibling;
use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*};
use xcm_builder::{
- AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter,
+ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter,
EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser,
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
@@ -966,6 +966,8 @@
}
pub struct SchedulerPaymentExecutor;
+
+#[cfg(feature = "scheduler")]
impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>
DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor
where
@@ -1066,6 +1068,7 @@
}
}
+#[cfg(feature = "scheduler")]
impl pallet_unique_scheduler::Config for Runtime {
type Event = Event;
type Origin = Origin;
runtime/quartz/Cargo.tomldiffbeforeafterboth--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -120,6 +120,7 @@
limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
quartz-runtime = []
+scheduler = []
rmrk = []
################################################################################
runtime/quartz/src/lib.rsdiffbeforeafterboth--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -28,13 +28,21 @@
use sp_api::impl_runtime_apis;
use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160};
use sp_runtime::DispatchError;
+#[cfg(feature = "scheduler")]
use fp_self_contained::*;
+
+#[cfg(feature = "scheduler")]
+use sp_runtime::{
+ traits::Member,
+ generic::Era,
+ DispatchErrorWithPostInfo
+};
// #[cfg(any(feature = "std", test))]
// pub use sp_runtime::BuildStorage;
use sp_runtime::{
Permill, Perbill, Percent, create_runtime_str, generic, impl_opaque_keys,
- traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero, Member},
+ traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero},
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult, RuntimeAppPublic,
};
@@ -69,7 +77,10 @@
WeightToFee,
},
};
+
+#[cfg(feature = "scheduler")]
use pallet_unique_scheduler::DispatchCall;
+
use up_data_structs::{
CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits,
CollectionStats, RpcCollection,
@@ -93,12 +104,10 @@
use fp_rpc::TransactionStatus;
use sp_runtime::{
traits::{
- Applyable, BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf,
+ BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf,
Saturating, CheckedConversion,
},
- generic::Era,
- transaction_validity::TransactionValidityError,
- DispatchErrorWithPostInfo, SaturatedConversion,
+ transaction_validity::TransactionValidityError, SaturatedConversion,
};
// pub use pallet_timestamp::Call as TimestampCall;
@@ -109,7 +118,7 @@
use polkadot_parachain::primitives::Sibling;
use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*};
use xcm_builder::{
- AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter,
+ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter,
EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser,
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
@@ -948,8 +957,11 @@
}
type ChargeTransactionPayment = pallet_charge_transaction::ChargeTransactionPayment<Runtime>;
+
+#[cfg(feature = "scheduler")]
use frame_support::traits::NamedReservableCurrency;
+#[cfg(feature = "scheduler")]
fn get_signed_extras(from: <Runtime as frame_system::Config>::AccountId) -> SignedExtraScheduler {
(
frame_system::CheckSpecVersion::<Runtime>::new(),
@@ -964,92 +976,95 @@
)
}
-// pub struct SchedulerPaymentExecutor;
-// impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>
-// DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor
-// where
-// <T as frame_system::Config>::Call: Member
-// + Dispatchable<Origin = Origin, Info = DispatchInfo>
-// + SelfContainedCall<SignedInfo = SelfContainedSignedInfo>
-// + GetDispatchInfo
-// + From<frame_system::Call<Runtime>>,
-// SelfContainedSignedInfo: Send + Sync + 'static,
-// Call: From<<T as frame_system::Config>::Call>
-// + From<<T as pallet_unique_scheduler::Config>::Call>
-// + SelfContainedCall<SignedInfo = SelfContainedSignedInfo>,
-// sp_runtime::AccountId32: From<<T as frame_system::Config>::AccountId>,
-// {
-// fn dispatch_call(
-// signer: <T as frame_system::Config>::AccountId,
-// call: <T as pallet_unique_scheduler::Config>::Call,
-// ) -> Result<
-// Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>,
-// TransactionValidityError,
-// > {
-// let dispatch_info = call.get_dispatch_info();
-// let extrinsic = fp_self_contained::CheckedExtrinsic::<
-// AccountId,
-// Call,
-// SignedExtraScheduler,
-// SelfContainedSignedInfo,
-// > {
-// signed:
-// CheckedSignature::<AccountId, SignedExtraScheduler, SelfContainedSignedInfo>::Signed(
-// signer.clone().into(),
-// get_signed_extras(signer.into()),
-// ),
-// function: call.into(),
-// };
+#[cfg(feature = "scheduler")]
+pub struct SchedulerPaymentExecutor;
+
+#[cfg(feature = "scheduler")]
+impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>
+ DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor
+where
+ <T as frame_system::Config>::Call: Member
+ + Dispatchable<Origin = Origin, Info = DispatchInfo>
+ + SelfContainedCall<SignedInfo = SelfContainedSignedInfo>
+ + GetDispatchInfo
+ + From<frame_system::Call<Runtime>>,
+ SelfContainedSignedInfo: Send + Sync + 'static,
+ Call: From<<T as frame_system::Config>::Call>
+ + From<<T as pallet_unique_scheduler::Config>::Call>
+ + SelfContainedCall<SignedInfo = SelfContainedSignedInfo>,
+ sp_runtime::AccountId32: From<<T as frame_system::Config>::AccountId>,
+{
+ fn dispatch_call(
+ signer: <T as frame_system::Config>::AccountId,
+ call: <T as pallet_unique_scheduler::Config>::Call,
+ ) -> Result<
+ Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>,
+ TransactionValidityError,
+ > {
+ let dispatch_info = call.get_dispatch_info();
+ let extrinsic = fp_self_contained::CheckedExtrinsic::<
+ AccountId,
+ Call,
+ SignedExtraScheduler,
+ SelfContainedSignedInfo,
+ > {
+ signed:
+ CheckedSignature::<AccountId, SignedExtraScheduler, SelfContainedSignedInfo>::Signed(
+ signer.clone().into(),
+ get_signed_extras(signer.into()),
+ ),
+ function: call.into(),
+ };
-// extrinsic.apply::<Runtime>(&dispatch_info, 0)
-// }
+ extrinsic.apply::<Runtime>(&dispatch_info, 0)
+ }
-// fn reserve_balance(
-// id: [u8; 16],
-// sponsor: <T as frame_system::Config>::AccountId,
-// call: <T as pallet_unique_scheduler::Config>::Call,
-// count: u32,
-// ) -> Result<(), DispatchError> {
-// let dispatch_info = call.get_dispatch_info();
-// let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0)
-// .saturating_mul(count.into());
+ fn reserve_balance(
+ id: [u8; 16],
+ sponsor: <T as frame_system::Config>::AccountId,
+ call: <T as pallet_unique_scheduler::Config>::Call,
+ count: u32,
+ ) -> Result<(), DispatchError> {
+ let dispatch_info = call.get_dispatch_info();
+ let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0)
+ .saturating_mul(count.into());
-// <Balances as NamedReservableCurrency<AccountId>>::reserve_named(
-// &id,
-// &(sponsor.into()),
-// weight.into(),
-// )
-// }
+ <Balances as NamedReservableCurrency<AccountId>>::reserve_named(
+ &id,
+ &(sponsor.into()),
+ weight.into(),
+ )
+ }
-// fn pay_for_call(
-// id: [u8; 16],
-// sponsor: <T as frame_system::Config>::AccountId,
-// call: <T as pallet_unique_scheduler::Config>::Call,
-// ) -> Result<u128, DispatchError> {
-// let dispatch_info = call.get_dispatch_info();
-// let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);
-// Ok(
-// <Balances as NamedReservableCurrency<AccountId>>::unreserve_named(
-// &id,
-// &(sponsor.into()),
-// weight.into(),
-// ),
-// )
-// }
+ fn pay_for_call(
+ id: [u8; 16],
+ sponsor: <T as frame_system::Config>::AccountId,
+ call: <T as pallet_unique_scheduler::Config>::Call,
+ ) -> Result<u128, DispatchError> {
+ let dispatch_info = call.get_dispatch_info();
+ let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);
+ Ok(
+ <Balances as NamedReservableCurrency<AccountId>>::unreserve_named(
+ &id,
+ &(sponsor.into()),
+ weight.into(),
+ ),
+ )
+ }
-// fn cancel_reserve(
-// id: [u8; 16],
-// sponsor: <T as frame_system::Config>::AccountId,
-// ) -> Result<u128, DispatchError> {
-// Ok(
-// <Balances as NamedReservableCurrency<AccountId>>::unreserve_named(
-// &id,
-// &(sponsor.into()),
-// u128::MAX,
-// ),
-// )
-// }
-// }
+ fn cancel_reserve(
+ id: [u8; 16],
+ sponsor: <T as frame_system::Config>::AccountId,
+ ) -> Result<u128, DispatchError> {
+ Ok(
+ <Balances as NamedReservableCurrency<AccountId>>::unreserve_named(
+ &id,
+ &(sponsor.into()),
+ u128::MAX,
+ ),
+ )
+ }
+}
parameter_types! {
pub const NoPreimagePostponement: Option<u32> = Some(10);
@@ -1065,21 +1080,22 @@
}
}
-// impl pallet_unique_scheduler::Config for Runtime {
-// type Event = Event;
-// type Origin = Origin;
-// type Currency = Balances;
-// type PalletsOrigin = OriginCaller;
-// type Call = Call;
-// type MaximumWeight = MaximumSchedulerWeight;
-// type ScheduleOrigin = EnsureSigned<AccountId>;
-// type MaxScheduledPerBlock = MaxScheduledPerBlock;
-// type WeightInfo = ();
-// type CallExecutor = SchedulerPaymentExecutor;
-// type OriginPrivilegeCmp = OriginPrivilegeCmp;
-// type PreimageProvider = ();
-// type NoPreimagePostponement = NoPreimagePostponement;
-// }
+#[cfg(feature = "scheduler")]
+impl pallet_unique_scheduler::Config for Runtime {
+ type Event = Event;
+ type Origin = Origin;
+ type Currency = Balances;
+ type PalletsOrigin = OriginCaller;
+ type Call = Call;
+ type MaximumWeight = MaximumSchedulerWeight;
+ type ScheduleOrigin = EnsureSigned<AccountId>;
+ type MaxScheduledPerBlock = MaxScheduledPerBlock;
+ type WeightInfo = ();
+ type CallExecutor = SchedulerPaymentExecutor;
+ type OriginPrivilegeCmp = OriginPrivilegeCmp;
+ type PreimageProvider = ();
+ type NoPreimagePostponement = NoPreimagePostponement;
+}
type EvmSponsorshipHandler = (
UniqueEthSponsorshipHandler<Runtime>,
runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -121,6 +121,9 @@
limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
unique-runtime = []
+scheduler = []
+rmrk = []
+
################################################################################
# Substrate Dependencies
runtime/unique/src/lib.rsdiffbeforeafterboth29use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160};29use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160};30use sp_runtime::DispatchError;30use sp_runtime::DispatchError;3132#[cfg(feature = "scheduler")]31use fp_self_contained::*;33use fp_self_contained::*;3435#[cfg(feature = "scheduler")]36use sp_runtime::{37 traits::Member,38 generic::Era,39 DispatchErrorWithPostInfo40};32// #[cfg(any(feature = "std", test))]41// #[cfg(any(feature = "std", test))]33// pub use sp_runtime::BuildStorage;42// pub use sp_runtime::BuildStorage;344335use sp_runtime::{44use sp_runtime::{36 Permill, Perbill, Percent, create_runtime_str, generic, impl_opaque_keys,45 Permill, Perbill, Percent, create_runtime_str, generic, impl_opaque_keys,37 traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero, Member},46 traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, AccountIdConversion, Zero},38 transaction_validity::{TransactionSource, TransactionValidity},47 transaction_validity::{TransactionSource, TransactionValidity},39 ApplyExtrinsicResult, RuntimeAppPublic,48 ApplyExtrinsicResult, RuntimeAppPublic,40};49};70 },79 },71};80};8182#[cfg(feature = "scheduler")]72use pallet_unique_scheduler::DispatchCall;83use pallet_unique_scheduler::DispatchCall;8473use up_data_structs::{85use up_data_structs::{93use fp_rpc::TransactionStatus;105use fp_rpc::TransactionStatus;94use sp_runtime::{106use sp_runtime::{95 traits::{107 traits::{96 Applyable, BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf,108 BlockNumberProvider, Dispatchable, PostDispatchInfoOf, DispatchInfoOf,97 Saturating, CheckedConversion,109 Saturating, CheckedConversion,98 },110 },99 generic::Era,100 transaction_validity::TransactionValidityError,111 transaction_validity::TransactionValidityError, SaturatedConversion,101 DispatchErrorWithPostInfo, SaturatedConversion,102};112};103113104// pub use pallet_timestamp::Call as TimestampCall;114// pub use pallet_timestamp::Call as TimestampCall;109use polkadot_parachain::primitives::Sibling;119use polkadot_parachain::primitives::Sibling;110use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*};120use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*};111use xcm_builder::{121use xcm_builder::{112 AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter,122 AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter,113 EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser,123 EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser,114 RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,124 RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,115 SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,125 SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,950960951type ChargeTransactionPayment = pallet_charge_transaction::ChargeTransactionPayment<Runtime>;961type ChargeTransactionPayment = pallet_charge_transaction::ChargeTransactionPayment<Runtime>;962963#[cfg(feature = "scheduler")]952use frame_support::traits::NamedReservableCurrency;964use frame_support::traits::NamedReservableCurrency;953965966#[cfg(feature = "scheduler")]954fn get_signed_extras(from: <Runtime as frame_system::Config>::AccountId) -> SignedExtraScheduler {967fn get_signed_extras(from: <Runtime as frame_system::Config>::AccountId) -> SignedExtraScheduler {955 (968 (956 frame_system::CheckSpecVersion::<Runtime>::new(),969 frame_system::CheckSpecVersion::<Runtime>::new(),965 )978 )966}979}967980968// pub struct SchedulerPaymentExecutor;981#[cfg(feature = "scheduler")]969// impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>982pub struct SchedulerPaymentExecutor;970// DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor983971// where984#[cfg(feature = "scheduler")]972// <T as frame_system::Config>::Call: Member985impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>973// + Dispatchable<Origin = Origin, Info = DispatchInfo>986 DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor974// + SelfContainedCall<SignedInfo = SelfContainedSignedInfo>987where975// + GetDispatchInfo988 <T as frame_system::Config>::Call: Member976// + From<frame_system::Call<Runtime>>,989 + Dispatchable<Origin = Origin, Info = DispatchInfo>977// SelfContainedSignedInfo: Send + Sync + 'static,990 + SelfContainedCall<SignedInfo = SelfContainedSignedInfo>978// Call: From<<T as frame_system::Config>::Call>991 + GetDispatchInfo979// + From<<T as pallet_unique_scheduler::Config>::Call>992 + From<frame_system::Call<Runtime>>,980// + SelfContainedCall<SignedInfo = SelfContainedSignedInfo>,993 SelfContainedSignedInfo: Send + Sync + 'static,981// sp_runtime::AccountId32: From<<T as frame_system::Config>::AccountId>,994 Call: From<<T as frame_system::Config>::Call>982// {995 + From<<T as pallet_unique_scheduler::Config>::Call>983// fn dispatch_call(996 + SelfContainedCall<SignedInfo = SelfContainedSignedInfo>,984// signer: <T as frame_system::Config>::AccountId,997 sp_runtime::AccountId32: From<<T as frame_system::Config>::AccountId>,985// call: <T as pallet_unique_scheduler::Config>::Call,998{986// ) -> Result<999 fn dispatch_call(987// Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>,1000 signer: <T as frame_system::Config>::AccountId,988// TransactionValidityError,1001 call: <T as pallet_unique_scheduler::Config>::Call,989// > {1002 ) -> Result<990// let dispatch_info = call.get_dispatch_info();1003 Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>,991// let extrinsic = fp_self_contained::CheckedExtrinsic::<1004 TransactionValidityError,992// AccountId,1005 > {993// Call,1006 let dispatch_info = call.get_dispatch_info();994// SignedExtraScheduler,1007 let extrinsic = fp_self_contained::CheckedExtrinsic::<995// SelfContainedSignedInfo,1008 AccountId,996// > {1009 Call,997// signed:1010 SignedExtraScheduler,998// CheckedSignature::<AccountId, SignedExtraScheduler, SelfContainedSignedInfo>::Signed(1011 SelfContainedSignedInfo,999// signer.clone().into(),1012 > {1000// get_signed_extras(signer.into()),1013 signed:1001// ),1014 CheckedSignature::<AccountId, SignedExtraScheduler, SelfContainedSignedInfo>::Signed(1002// function: call.into(),1015 signer.clone().into(),1003// };1016 get_signed_extras(signer.into()),10041017 ),1005// extrinsic.apply::<Runtime>(&dispatch_info, 0)1018 function: call.into(),1006// }1019 };100710201008// fn reserve_balance(1021 extrinsic.apply::<Runtime>(&dispatch_info, 0)1009// id: [u8; 16],1022 }1010// sponsor: <T as frame_system::Config>::AccountId,10231011// call: <T as pallet_unique_scheduler::Config>::Call,1024 fn reserve_balance(1012// count: u32,1025 id: [u8; 16],1013// ) -> Result<(), DispatchError> {1026 sponsor: <T as frame_system::Config>::AccountId,1014// let dispatch_info = call.get_dispatch_info();1027 call: <T as pallet_unique_scheduler::Config>::Call,1015// let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0)1028 count: u32,1016// .saturating_mul(count.into());1029 ) -> Result<(), DispatchError> {10171030 let dispatch_info = call.get_dispatch_info();1018// <Balances as NamedReservableCurrency<AccountId>>::reserve_named(1031 let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0)1019// &id,1032 .saturating_mul(count.into());1020// &(sponsor.into()),10331021// weight,1034 <Balances as NamedReservableCurrency<AccountId>>::reserve_named(1022// )1035 &id,1023// }1036 &(sponsor.into()),10241037 weight,1025// fn pay_for_call(1038 )1026// id: [u8; 16],1039 }1027// sponsor: <T as frame_system::Config>::AccountId,10401028// call: <T as pallet_unique_scheduler::Config>::Call,1041 fn pay_for_call(1029// ) -> Result<u128, DispatchError> {1042 id: [u8; 16],1030// let dispatch_info = call.get_dispatch_info();1043 sponsor: <T as frame_system::Config>::AccountId,1031// let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);1044 call: <T as pallet_unique_scheduler::Config>::Call,1032// Ok(1045 ) -> Result<u128, DispatchError> {1033// <Balances as NamedReservableCurrency<AccountId>>::unreserve_named(1046 let dispatch_info = call.get_dispatch_info();1034// &id,1047 let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);1035// &(sponsor.into()),1048 Ok(1036// weight,1049 <Balances as NamedReservableCurrency<AccountId>>::unreserve_named(1037// ),1050 &id,1038// )1051 &(sponsor.into()),1039// }1052 weight,10401053 ),1041// fn cancel_reserve(1054 )1042// id: [u8; 16],1055 }1043// sponsor: <T as frame_system::Config>::AccountId,10561044// ) -> Result<u128, DispatchError> {1057 fn cancel_reserve(1045// Ok(1058 id: [u8; 16],1046// <Balances as NamedReservableCurrency<AccountId>>::unreserve_named(1059 sponsor: <T as frame_system::Config>::AccountId,1047// &id,1060 ) -> Result<u128, DispatchError> {1048// &(sponsor.into()),1061 Ok(1049// u128::MAX,1062 <Balances as NamedReservableCurrency<AccountId>>::unreserve_named(1050// ),1063 &id,1051// )1064 &(sponsor.into()),1052// }1065 u128::MAX,1053// }1066 ),1067 )1068 }1069}105410701055parameter_types! {1071parameter_types! {1056 pub const NoPreimagePostponement: Option<u32> = Some(10);1072 pub const NoPreimagePostponement: Option<u32> = Some(10);1066 }1082 }1067}1083}106810841069// impl pallet_unique_scheduler::Config for Runtime {1085#[cfg(feature = "scheduler")]1070// type Event = Event;1086impl pallet_unique_scheduler::Config for Runtime {1071// type Origin = Origin;1087 type Event = Event;1072// type Currency = Balances;1088 type Origin = Origin;1073// type PalletsOrigin = OriginCaller;1089 type Currency = Balances;1074// type Call = Call;1090 type PalletsOrigin = OriginCaller;1075// type MaximumWeight = MaximumSchedulerWeight;1091 type Call = Call;1076// type ScheduleOrigin = EnsureSigned<AccountId>;1092 type MaximumWeight = MaximumSchedulerWeight;1077// type MaxScheduledPerBlock = MaxScheduledPerBlock;1093 type ScheduleOrigin = EnsureSigned<AccountId>;1078// type WeightInfo = ();1094 type MaxScheduledPerBlock = MaxScheduledPerBlock;1079// type CallExecutor = SchedulerPaymentExecutor;1095 type WeightInfo = ();1080// type OriginPrivilegeCmp = OriginPrivilegeCmp;1096 type CallExecutor = SchedulerPaymentExecutor;1081// type PreimageProvider = ();1097 type OriginPrivilegeCmp = OriginPrivilegeCmp;1082// type NoPreimagePostponement = NoPreimagePostponement;1098 type PreimageProvider = ();1083// }1099 type NoPreimagePostponement = NoPreimagePostponement;1100}108411011085type EvmSponsorshipHandler = (1102type EvmSponsorshipHandler = (1086 UniqueEthSponsorshipHandler<Runtime>,1103 UniqueEthSponsorshipHandler<Runtime>,1166 frame_system::CheckEra<Runtime>,1183 frame_system::CheckEra<Runtime>,1167 frame_system::CheckNonce<Runtime>,1184 frame_system::CheckNonce<Runtime>,1168 frame_system::CheckWeight<Runtime>,1185 frame_system::CheckWeight<Runtime>,1169 pallet_charge_transaction::ChargeTransactionPayment<Runtime>,1186 ChargeTransactionPayment,1170 //pallet_contract_helpers::ContractHelpersExtension<Runtime>,1187 //pallet_contract_helpers::ContractHelpersExtension<Runtime>,1171 pallet_ethereum::FakeTransactionFinalizer<Runtime>,1188 pallet_ethereum::FakeTransactionFinalizer<Runtime>,1172);1189);