From d881b160c58c3386775363d0c0e4eebccf0f5372 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Thu, 24 Jun 2021 19:46:46 +0000 Subject: [PATCH] feat: enable sponsorship primitives --- --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -46,6 +46,7 @@ 'pallet-contracts/std', 'pallet-contracts-primitives/std', 'pallet-contracts-rpc-runtime-api/std', + 'pallet-contract-helpers/std', 'pallet-randomness-collective-flip/std', 'pallet-sudo/std', 'pallet-timestamp/std', @@ -372,8 +373,9 @@ [dependencies] pallet-nft = { path = '../pallets/nft', default-features = false, version = '3.0.0' } pallet-inflation = { path = '../pallets/inflation', default-features = false, version = '3.0.0' } -nft-data-structs = { path = '../primitives', default-features = false, version = '0.9.0' } +nft-data-structs = { path = '../primitives/nft', default-features = false, version = '0.9.0' } pallet-scheduler = { path = '../pallets/scheduler', default-features = false, version = '3.0.0' } +pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' } pallet-nft-transaction-payment = { path = '../pallets/nft-transaction-payment', default-features = false, version = '3.0.0' } pallet-nft-charge-transaction = { path = '../pallets/nft-charge-transaction', default-features = false, version = '3.0.0' } --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -734,6 +734,11 @@ } } +type SponsorshipHandler = ( + pallet_nft::NftSponsorshipHandler, + pallet_contract_helpers::ContractSponsorshipHandler, +); + impl pallet_scheduler::Config for Runtime { type Event = Event; type Origin = Origin; @@ -742,16 +747,18 @@ type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureSigned; type MaxScheduledPerBlock = MaxScheduledPerBlock; - type Sponsoring = Sponsoring; + type SponsorshipHandler = SponsorshipHandler; type WeightInfo = (); } impl pallet_nft_transaction_payment::Config for Runtime { + type SponsorshipHandler = SponsorshipHandler; } -impl pallet_nft_charge_transaction::Config for Runtime { -} +impl pallet_nft_charge_transaction::Config for Runtime {} +impl pallet_contract_helpers::Config for Runtime {} + construct_runtime!( pub enum Runtime where Block = Block, @@ -791,6 +798,7 @@ Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event}, NftPayment: pallet_nft_transaction_payment::{Pallet, Call, Storage}, Charging: pallet_nft_charge_transaction::{Pallet, Call, Storage }, + ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage}, } ); @@ -829,6 +837,7 @@ system::CheckNonce, system::CheckWeight, pallet_nft_charge_transaction::ChargeTransactionPayment, + pallet_contract_helpers::ContractHelpersExtension, ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; -- gitstuff