git.delta.rocks / unique-network / refs/commits / ec0960098e79

difftreelog

test upgrade to new polkadot

Yaroslav Bolyukin2022-05-04parent: #9d1133e.patch.diff
in: master

3 files changed

modifiedpallets/scheduler/src/lib.rsdiffbeforeafterboth
704 use frame_system::{EnsureRoot, EnsureSignedBy};704 use frame_system::{EnsureRoot, EnsureSignedBy};
705 use crate as scheduler;705 use crate as scheduler;
706706
707 #[frame_support::pallet]
707 mod logger {708 pub mod logger {
708 use super::*;709 use super::{OriginCaller, OriginTrait};
710 use frame_support::pallet_prelude::*;
711 use frame_system::pallet_prelude::*;
709 use std::cell::RefCell;712 use std::cell::RefCell;
710713
711 thread_local! {714 thread_local! {
712 static LOG: RefCell<Vec<(OriginCaller, u32)>> = RefCell::new(Vec::new());715 static LOG: RefCell<Vec<(OriginCaller, u32)>> = RefCell::new(Vec::new());
713 }716 }
717 pub fn log() -> Vec<(OriginCaller, u32)> {
718 LOG.with(|log| log.borrow().clone())
719 }
720
721 #[pallet::pallet]
722 #[pallet::generate_store(pub(super) trait Store)]
723 pub struct Pallet<T>(PhantomData<T>);
724
725 #[pallet::hooks]
726 impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
727
728 #[pallet::config]
714 pub trait Config: system::Config {729 pub trait Config: frame_system::Config {
715 type Event: From<Event> + Into<<Self as system::Config>::Event>;730 type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
716 }731 }
717 decl_event! {732
733 #[pallet::event]
734 #[pallet::generate_deposit(pub(super) fn deposit_event)]
718 pub enum Event {735 pub enum Event<T: Config> {
719 Logged(u32, Weight),736 Logged(u32, Weight),
720 }737 }
721 }738
722 decl_module! {739 #[pallet::call]
723 pub struct Module<T: Config> for enum Call740 impl<T: Config> Pallet<T>
724 where741 where
725 origin: <T as system::Config>::Origin,742 <T as frame_system::Config>::Origin: OriginTrait<PalletsOrigin = OriginCaller>,
726 <T as system::Config>::Origin: OriginTrait<PalletsOrigin = OriginCaller>
727 {743 {
728 fn deposit_event() = default;
729
730 #[weight = *weight]744 #[pallet::weight(*weight)]
731 fn log(origin, i: u32, weight: Weight) {745 pub fn log(origin: OriginFor<T>, i: u32, weight: Weight) -> DispatchResult {
732 Self::deposit_event(Event::Logged(i, weight));746 Self::deposit_event(Event::Logged(i, weight));
733 LOG.with(|log| {747 LOG.with(|log| {
734 log.borrow_mut().push((origin.caller().clone(), i));748 log.borrow_mut().push((origin.caller().clone(), i));
735 })749 });
750 Ok(())
736 }751 }
737752
738 #[weight = *weight]753 #[pallet::weight(*weight)]
739 fn log_without_filter(origin, i: u32, weight: Weight) {754 pub fn log_without_filter(
755 origin: OriginFor<T>,
756 i: u32,
757 weight: Weight,
758 ) -> DispatchResult {
740 Self::deposit_event(Event::Logged(i, weight));759 Self::deposit_event(Event::Logged(i, weight));
741 LOG.with(|log| {760 LOG.with(|log| {
742 log.borrow_mut().push((origin.caller().clone(), i));761 log.borrow_mut().push((origin.caller().clone(), i));
743 })762 });
763 Ok(())
744 }764 }
745 }765 }
746 }
747 }766 }
748767
749 type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;768 type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
756 UncheckedExtrinsic = UncheckedExtrinsic,775 UncheckedExtrinsic = UncheckedExtrinsic,
757 {776 {
758 System: frame_system::{Pallet, Call, Config, Storage, Event<T>},777 System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
759 Logger: logger::{Pallet, Call, Event},778 Logger: logger::{Pallet, Call, Event<T>},
760 Scheduler: scheduler::{Pallet, Call, Storage, Event<T>},779 Scheduler: scheduler::{Pallet, Call, Storage, Event<T>},
761 }780 }
762 );781 );
modifiedpallets/unique/src/mock.rsdiffbeforeafterboth
--- a/pallets/unique/src/mock.rs
+++ b/pallets/unique/src/mock.rs
@@ -101,13 +101,12 @@
 }
 
 parameter_types! {
-	pub const TransactionByteFee: u64 = 1;
 	pub const OperationalFeeMultiplier: u8 = 5;
 }
 
 impl pallet_transaction_payment::Config for Test {
 	type OnChargeTransaction = CurrencyAdapter<pallet_balances::Pallet<Test>, ()>;
-	type TransactionByteFee = TransactionByteFee;
+	type LengthToFee = IdentityFee<u64>;
 	type WeightToFee = IdentityFee<u64>;
 	type FeeMultiplierUpdate = ();
 	type OperationalFeeMultiplier = OperationalFeeMultiplier;
@@ -176,12 +175,7 @@
 
 pub struct TestEtheremTransactionSender;
 impl pallet_ethereum::EthereumTransactionSender for TestEtheremTransactionSender {
-	fn submit_logs_transaction(
-		_source: H160,
-		_tx: pallet_ethereum::Transaction,
-		_logs: Vec<MaybeMirroredLog>,
-	) {
-	}
+	fn submit_logs_transaction(_source: H160, _logs: Vec<MaybeMirroredLog>) {}
 }
 
 impl pallet_evm_coder_substrate::Config for Test {
modifiedpallets/unique/src/tests.rsdiffbeforeafterboth
--- a/pallets/unique/src/tests.rs
+++ b/pallets/unique/src/tests.rs
@@ -18,7 +18,6 @@
 use super::*;
 use crate::mock::*;
 use crate::{AccessMode, CollectionMode};
-use sp_runtime::AccountId32;
 use up_data_structs::{
 	COLLECTION_NUMBER_LIMIT, CollectionId, CreateItemData, CreateFungibleData, CreateNftData,
 	CreateReFungibleData, MAX_DECIMAL_POINTS, COLLECTION_ADMINS_LIMIT, MetaUpdatePermission,