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.rsdiffbeforeafterboth110use polkadot_parachain::primitives::Sibling;110use polkadot_parachain::primitives::Sibling;111use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*};111use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*};112use xcm_builder::{112use xcm_builder::{113 AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter,113 AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter,114 EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser,114 EnsureXcmOrigin, FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser,115 RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,115 RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,116 SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,116 SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,967967968pub struct SchedulerPaymentExecutor;968pub struct SchedulerPaymentExecutor;969970#[cfg(feature = "scheduler")]969impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>971impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>970 DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor972 DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor971where973where1066 }1068 }1067}1069}106810701071#[cfg(feature = "scheduler")]1069impl pallet_unique_scheduler::Config for Runtime {1072impl pallet_unique_scheduler::Config for Runtime {1070 type Event = Event;1073 type Event = Event;1071 type Origin = Origin;1074 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.rsdiffbeforeafterboth--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -28,13 +28,22 @@
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 +78,10 @@
WeightToFee,
},
};
+
+#[cfg(feature = "scheduler")]
use pallet_unique_scheduler::DispatchCall;
+
use up_data_structs::{
CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits,
CollectionStats, RpcCollection,
@@ -93,12 +105,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 +119,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,
@@ -949,8 +959,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(),
@@ -965,92 +978,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;
-// extrinsic.apply::<Runtime>(&dispatch_info, 0)
-// }
+#[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(),
+ };
-// 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());
+ extrinsic.apply::<Runtime>(&dispatch_info, 0)
+ }
-// <Balances as NamedReservableCurrency<AccountId>>::reserve_named(
-// &id,
-// &(sponsor.into()),
-// weight,
-// )
-// }
+ 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 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,
-// ),
-// )
-// }
+ <Balances as NamedReservableCurrency<AccountId>>::reserve_named(
+ &id,
+ &(sponsor.into()),
+ weight,
+ )
+ }
-// 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 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,
+ ),
+ )
+ }
+
+ 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);
@@ -1066,21 +1082,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>,
@@ -1166,7 +1183,7 @@
frame_system::CheckEra<Runtime>,
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
- pallet_charge_transaction::ChargeTransactionPayment<Runtime>,
+ ChargeTransactionPayment,
//pallet_contract_helpers::ContractHelpersExtension<Runtime>,
pallet_ethereum::FakeTransactionFinalizer<Runtime>,
);