diff --git a/pallets/ethereum-transactions/src/mock.rs b/pallets/ethereum-transactions/src/mock.rs index 30b7195f0..28e92d6d0 100644 --- a/pallets/ethereum-transactions/src/mock.rs +++ b/pallets/ethereum-transactions/src/mock.rs @@ -64,8 +64,8 @@ parameter_types! { } impl Config for TestRuntime { - type Event = Event; - type Call = Call; + type RuntimeEvent = RuntimeEvent; + type Call = RuntimeCall; type AccountToBytesConvert = U64To32BytesConverter; type ValidatorManagerContractAddress = TestValidatorManagerContractAddress; type WeightInfo = (); @@ -84,8 +84,8 @@ impl system::Config for TestRuntime { type BlockWeights = (); type BlockLength = (); type DbWeight = (); - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -93,7 +93,7 @@ impl system::Config for TestRuntime { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = Event; + type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); type PalletInfo = PalletInfo; @@ -106,13 +106,13 @@ impl system::Config for TestRuntime { type MaxConsumers = frame_support::traits::ConstU32<16>; } -pub type Extrinsic = TestXt; +pub type Extrinsic = TestXt; impl frame_system::offchain::SendTransactionTypes for TestRuntime where - Call: From, + RuntimeCall: From, { - type OverarchingCall = Call; + type OverarchingCall = RuntimeCall; type Extrinsic = Extrinsic; } @@ -150,7 +150,7 @@ impl session::Config for TestRuntime { type Keys = UintAuthorityId; type ShouldEndSession = session::PeriodicSessions; type SessionHandler = (AVN,); - type Event = Event; + type RuntimeEvent = RuntimeEvent; type ValidatorId = u64; type ValidatorIdOf = ConvertInto; type NextSessionRotation = session::PeriodicSessions; @@ -212,7 +212,7 @@ impl EthereumTransactions { // TODO [TYPE: test refactoring][PRI: medium]: move this to a centralized pallet of test // utilities, when we do that refactoring, and apply it to all emitted system event // assertions. - pub fn event_emitted(event: &Event) -> bool { + pub fn event_emitted(event: &RuntimeEvent) -> bool { return System::events().iter().any(|a| a.event == *event) } diff --git a/pallets/ethereum-transactions/src/tests/test_set_publish_root_contract.rs b/pallets/ethereum-transactions/src/tests/test_set_publish_root_contract.rs index 963b932c3..d49a5405c 100644 --- a/pallets/ethereum-transactions/src/tests/test_set_publish_root_contract.rs +++ b/pallets/ethereum-transactions/src/tests/test_set_publish_root_contract.rs @@ -10,7 +10,7 @@ mod test_set_publish_root_contract { use super::*; struct Context { - origin: Origin, + origin: RuntimeOrigin, new_contract_address: H160, } @@ -70,8 +70,10 @@ mod test_set_publish_root_contract { fn origin_is_not_root() { let mut ext = ExtBuilder::build_default().with_genesis_config().as_externality(); ext.execute_with(|| { - let context: Context = - Context { origin: Origin::signed(Default::default()), ..Default::default() }; + let context: Context = Context { + origin: RuntimeOrigin::signed(Default::default()), + ..Default::default() + }; assert_noop!(context.dispatch_set_publish_root_contract(), BadOrigin); assert_ne!( diff --git a/pallets/ethereum-transactions/src/tests/tests.rs b/pallets/ethereum-transactions/src/tests/tests.rs index 8c32a6dda..ce16484c9 100644 --- a/pallets/ethereum-transactions/src/tests/tests.rs +++ b/pallets/ethereum-transactions/src/tests/tests.rs @@ -471,7 +471,7 @@ mod submit_candidate_for_tier1 { assert_eq!(EthereumTransactions::event_count(), 0); assert_ok!(call_submit_candidate_for_tier1(expected_candidate, context.from)); - let event = mock::Event::EthereumTransactions( + let event = mock::RuntimeEvent::EthereumTransactions( crate::Event::::TransactionReadyToSend { transaction_id: context.tx_id, sender: context.from, @@ -509,7 +509,7 @@ mod set_eth_tx_hash_for_dispatched_tx { } fn call_set_eth_tx_hash_for_dispatched_tx( - origin: Origin, + origin: RuntimeOrigin, tx_id: TransactionId, submitter: AccountId, eth_tx_hash: EthereumTransactionHash, @@ -569,7 +569,7 @@ mod set_eth_tx_hash_for_dispatched_tx { context.hash )); - let event = mock::Event::EthereumTransactions( + let event = mock::RuntimeEvent::EthereumTransactions( crate::Event::::EthereumTransactionHashAdded { transaction_id: context.tx_id, transaction_hash: context.hash, @@ -600,7 +600,7 @@ mod set_eth_tx_hash_for_dispatched_tx { // untouched assert_noop!( call_set_eth_tx_hash_for_dispatched_tx( - Origin::signed(Default::default()), + RuntimeOrigin::signed(Default::default()), context.tx_id, context.submitter, context.hash, @@ -1264,7 +1264,7 @@ mod unreserve_transaction_tests { ); assert_noop!( EthereumTransactions::unreserve_transaction( - Origin::signed(Default::default()), + RuntimeOrigin::signed(Default::default()), context.transaction_type.clone() ), BadOrigin