diff --git a/Cargo.lock b/Cargo.lock index 1b21ea3e36..158a9148a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11920,8 +11920,10 @@ name = "sp-evm-tracker" version = "0.1.0" dependencies = [ "async-trait", + "domain-runtime-primitives", "parity-scale-codec", "sp-api", + "sp-domains", "sp-inherents", ] diff --git a/crates/pallet-domains/src/lib.rs b/crates/pallet-domains/src/lib.rs index 7e69b969cf..0f611cf99a 100644 --- a/crates/pallet-domains/src/lib.rs +++ b/crates/pallet-domains/src/lib.rs @@ -34,6 +34,7 @@ use alloc::collections::btree_map::BTreeMap; #[cfg(not(feature = "std"))] use alloc::vec::Vec; use codec::{Decode, Encode}; +use domain_runtime_primitives::EthereumAccountId; use frame_support::ensure; use frame_support::pallet_prelude::StorageVersion; use frame_support::traits::fungible::{Inspect, InspectHold}; @@ -205,7 +206,7 @@ mod pallet { #[cfg(not(feature = "std"))] use alloc::vec::Vec; use codec::FullCodec; - use domain_runtime_primitives::EVMChainId; + use domain_runtime_primitives::{EVMChainId, EthereumAccountId}; use frame_support::pallet_prelude::*; use frame_support::traits::fungible::{Inspect, InspectHold, Mutate, MutateHold}; use frame_support::traits::tokens::Preservation; @@ -1785,8 +1786,9 @@ mod pallet { pub fn send_evm_domain_set_contract_creation_allowed_by_call( origin: OriginFor, domain_id: DomainId, - // TODO: contract_creation_allowed_by: sp_domains::PermissionedActionAllowedBy, - call: Vec, + contract_creation_allowed_by: sp_domains::PermissionedActionAllowedBy< + EthereumAccountId, + >, ) -> DispatchResult { let maybe_owner = ensure_signed(origin)?; @@ -1812,7 +1814,7 @@ mod pallet { domain_runtime_call( domain_runtime, StatelessDomainRuntimeCall::IsValidEvmDomainContractCreationAllowedByCall( - call.clone() + contract_creation_allowed_by.clone() ), ) .unwrap_or(false), @@ -1822,7 +1824,7 @@ mod pallet { EvmDomainContractCreationAllowedByCalls::::set( domain_id, EvmDomainContractCreationAllowedByCall { - maybe_call: Some(call), + maybe_call: Some(contract_creation_allowed_by), }, ); @@ -3156,7 +3158,9 @@ impl Pallet { } /// Returns EVM domain's "set contract creation allowed by" call, if any. - pub fn evm_domain_contract_creation_allowed_by_call(domain_id: DomainId) -> Option> { + pub fn evm_domain_contract_creation_allowed_by_call( + domain_id: DomainId, + ) -> Option> { EvmDomainContractCreationAllowedByCalls::::get(domain_id).maybe_call } } diff --git a/crates/sp-domains-fraud-proof/src/host_functions.rs b/crates/sp-domains-fraud-proof/src/host_functions.rs index 20265c6c2d..6e7109d978 100644 --- a/crates/sp-domains-fraud-proof/src/host_functions.rs +++ b/crates/sp-domains-fraud-proof/src/host_functions.rs @@ -395,9 +395,9 @@ where .ok() } StatelessDomainRuntimeCall::IsValidEvmDomainContractCreationAllowedByCall( - encoded_extrinsic, + decoded_argument, ) => domain_stateless_runtime - .is_valid_evm_contract_creation_allowed_by_call(encoded_extrinsic) + .is_valid_evm_contract_creation_allowed_by_call(decoded_argument) .ok(), } } diff --git a/crates/sp-domains-fraud-proof/src/lib.rs b/crates/sp-domains-fraud-proof/src/lib.rs index bc7de1c647..37d47cdab7 100644 --- a/crates/sp-domains-fraud-proof/src/lib.rs +++ b/crates/sp-domains-fraud-proof/src/lib.rs @@ -25,6 +25,7 @@ use crate::storage_proof::FraudProofStorageKeyRequest; #[cfg(not(feature = "std"))] use alloc::vec::Vec; use codec::{Decode, Encode}; +use domain_runtime_primitives::EthereumAccountId; #[cfg(feature = "std")] pub use host_functions::{ FraudProofExtension, FraudProofHostFunctions, FraudProofHostFunctionsImpl, @@ -34,7 +35,7 @@ pub use runtime_interface::fraud_proof_runtime_interface; pub use runtime_interface::fraud_proof_runtime_interface::HostFunctions; use scale_info::TypeInfo; use sp_core::H256; -use sp_domains::DomainAllowlistUpdates; +use sp_domains::{DomainAllowlistUpdates, PermissionedActionAllowedBy}; use sp_runtime::traits::{Header as HeaderT, NumberFor}; use sp_runtime::transaction_validity::{InvalidTransaction, TransactionValidity}; use sp_runtime::OpaqueExtrinsic; @@ -102,7 +103,8 @@ pub struct DomainInherentExtrinsicData { pub consensus_transaction_byte_fee: Balance, pub domain_chain_allowlist: DomainAllowlistUpdates, pub maybe_sudo_runtime_call: Option>, - pub maybe_evm_domain_contract_creation_allowed_by_call: Option>, + pub maybe_evm_domain_contract_creation_allowed_by_call: + Option>, } impl PassBy for DomainInherentExtrinsicData { @@ -139,7 +141,7 @@ pub enum StatelessDomainRuntimeCall { IsInherentExtrinsic(OpaqueExtrinsic), IsDecodableExtrinsic(OpaqueExtrinsic), IsValidDomainSudoCall(Vec), - IsValidEvmDomainContractCreationAllowedByCall(Vec), + IsValidEvmDomainContractCreationAllowedByCall(PermissionedActionAllowedBy), } impl PassBy for StatelessDomainRuntimeCall { diff --git a/crates/sp-domains/src/lib.rs b/crates/sp-domains/src/lib.rs index fcb3f6aed1..a67a8c8560 100644 --- a/crates/sp-domains/src/lib.rs +++ b/crates/sp-domains/src/lib.rs @@ -1536,7 +1536,7 @@ impl DomainSudoCall { /// there is an empty runtime call inside #[derive(Default, Debug, Encode, Decode, PartialEq, Eq, Clone, TypeInfo)] pub struct EvmDomainContractCreationAllowedByCall { - pub maybe_call: Option>, + pub maybe_call: Option>, } impl EvmDomainContractCreationAllowedByCall { @@ -1685,7 +1685,7 @@ sp_api::decl_runtime_apis! { /// Returns the "set contract creation allowed by" call for the given EVM domain, if any. /// Only present in API versions 4 and later. - fn evm_domain_contract_creation_allowed_by_call(domain_id: DomainId) -> Option>; + fn evm_domain_contract_creation_allowed_by_call(domain_id: DomainId) -> Option>; /// Returns the last confirmed domain block execution receipt. fn last_confirmed_domain_block_receipt(domain_id: DomainId) ->Option>; diff --git a/crates/subspace-fake-runtime-api/src/lib.rs b/crates/subspace-fake-runtime-api/src/lib.rs index 6c550a8288..b93cafd8d3 100644 --- a/crates/subspace-fake-runtime-api/src/lib.rs +++ b/crates/subspace-fake-runtime-api/src/lib.rs @@ -1,7 +1,9 @@ //! Provides "fake" runtime API implementation as a workaround for compile-time checks. use domain_runtime_primitives::opaque::Header as DomainHeader; -use domain_runtime_primitives::{BlockNumber as DomainNumber, Hash as DomainHash}; +use domain_runtime_primitives::{ + BlockNumber as DomainNumber, EthereumAccountId, Hash as DomainHash, +}; use frame_support::weights::Weight; use sp_consensus_subspace::{ChainConstants, PotParameters, SignedVote, SolutionRanges}; use sp_core::crypto::KeyTypeId; @@ -9,7 +11,7 @@ use sp_core::{OpaqueMetadata, H256}; use sp_domains::bundle_producer_election::BundleProducerElectionParams; use sp_domains::{ DomainAllowlistUpdates, DomainId, DomainInstanceData, ExecutionReceiptFor, OperatorId, - OperatorPublicKey, + OperatorPublicKey, PermissionedActionAllowedBy, }; use sp_domains_fraud_proof::fraud_proof::FraudProof; use sp_domains_fraud_proof::storage_proof::FraudProofStorageKeyRequest; @@ -278,7 +280,7 @@ sp_api::impl_runtime_apis! { unreachable!() } - fn evm_domain_contract_creation_allowed_by_call(_domain_id: DomainId) -> Option>{ + fn evm_domain_contract_creation_allowed_by_call(_domain_id: DomainId) -> Option>{ unreachable!() } diff --git a/crates/subspace-runtime/src/lib.rs b/crates/subspace-runtime/src/lib.rs index 66adc83d91..22a6e249df 100644 --- a/crates/subspace-runtime/src/lib.rs +++ b/crates/subspace-runtime/src/lib.rs @@ -34,7 +34,7 @@ use core::num::NonZeroU64; use domain_runtime_primitives::opaque::Header as DomainHeader; use domain_runtime_primitives::{ maximum_domain_block_weight, AccountIdConverter, BlockNumber as DomainNumber, - Hash as DomainHash, MAX_OUTGOING_MESSAGES, + EthereumAccountId, Hash as DomainHash, MAX_OUTGOING_MESSAGES, }; use frame_support::genesis_builder_helper::{build_state, get_preset}; use frame_support::inherent::ProvideInherent; @@ -61,8 +61,8 @@ use sp_core::{ConstBool, OpaqueMetadata, H256}; use sp_domains::bundle_producer_election::BundleProducerElectionParams; use sp_domains::{ ChannelId, DomainAllowlistUpdates, DomainId, DomainInstanceData, ExecutionReceiptFor, - OperatorId, OperatorPublicKey, OperatorRewardSource, DOMAIN_STORAGE_FEE_MULTIPLIER, - INITIAL_DOMAIN_TX_RANGE, + OperatorId, OperatorPublicKey, OperatorRewardSource, PermissionedActionAllowedBy, + DOMAIN_STORAGE_FEE_MULTIPLIER, INITIAL_DOMAIN_TX_RANGE, }; use sp_domains_fraud_proof::fraud_proof::FraudProof; use sp_domains_fraud_proof::storage_proof::{ @@ -1367,7 +1367,7 @@ impl_runtime_apis! { Domains::domain_sudo_call(domain_id) } - fn evm_domain_contract_creation_allowed_by_call(domain_id: DomainId) -> Option> { + fn evm_domain_contract_creation_allowed_by_call(domain_id: DomainId) -> Option> { Domains::evm_domain_contract_creation_allowed_by_call(domain_id) } diff --git a/domains/client/block-preprocessor/src/stateless_runtime.rs b/domains/client/block-preprocessor/src/stateless_runtime.rs index c5474ca1a0..7f18cc2cb0 100644 --- a/domains/client/block-preprocessor/src/stateless_runtime.rs +++ b/domains/client/block-preprocessor/src/stateless_runtime.rs @@ -1,6 +1,8 @@ use codec::{Codec, Encode}; use domain_runtime_primitives::opaque::AccountId; -use domain_runtime_primitives::{Balance, CheckExtrinsicsValidityError, DecodeExtrinsicError}; +use domain_runtime_primitives::{ + Balance, CheckExtrinsicsValidityError, DecodeExtrinsicError, EthereumAccountId, +}; use sc_client_api::execution_extensions::ExtensionsFactory; use sc_executor::RuntimeVersionOf; use sp_api::{ApiError, Core}; @@ -8,7 +10,7 @@ use sp_core::traits::{CallContext, CodeExecutor, FetchRuntimeCode, RuntimeCode}; use sp_core::Hasher; use sp_domain_sudo::DomainSudoApi; use sp_domains::core_api::DomainCoreApi; -use sp_domains::{ChainId, ChannelId, DomainAllowlistUpdates}; +use sp_domains::{ChainId, ChannelId, DomainAllowlistUpdates, PermissionedActionAllowedBy}; use sp_evm_tracker::EvmTrackerApi; use sp_messenger::messages::MessageKey; use sp_messenger::{MessengerApi, RelayerApi}; @@ -388,12 +390,12 @@ where pub fn is_valid_evm_contract_creation_allowed_by_call( &self, - extrinsic: Vec, + decoded_argument: PermissionedActionAllowedBy, ) -> Result { >::is_valid_evm_contract_creation_allowed_by_call( self, Default::default(), - extrinsic, + decoded_argument, ) } @@ -410,7 +412,7 @@ where pub fn construct_evm_contract_creation_allowed_by_extrinsic( &self, - inner_call: Vec, + inner_call: PermissionedActionAllowedBy, ) -> Result { >::construct_evm_contract_creation_allowed_by_extrinsic( self, diff --git a/domains/primitives/evm-tracker/Cargo.toml b/domains/primitives/evm-tracker/Cargo.toml index e164965f86..05cae654b7 100644 --- a/domains/primitives/evm-tracker/Cargo.toml +++ b/domains/primitives/evm-tracker/Cargo.toml @@ -15,7 +15,9 @@ include = [ [dependencies] async-trait = { version = "0.1.83", optional = true } codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = ["derive"] } +domain-runtime-primitives = { version = "0.1.0", default-features = false, path = "../runtime" } sp-api = { default-features = false, git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305" } +sp-domains = { version = "0.1.0", default-features = false, path = "../../../crates/sp-domains" } sp-inherents = { default-features = false, git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305" } [features] @@ -23,6 +25,8 @@ default = ["std"] std = [ "async-trait", "codec/std", + "domain-runtime-primitives/std", "sp-api/std", + "sp-domains/std", "sp-inherents/std", ] diff --git a/domains/primitives/evm-tracker/src/lib.rs b/domains/primitives/evm-tracker/src/lib.rs index 972256c408..3a359c091e 100644 --- a/domains/primitives/evm-tracker/src/lib.rs +++ b/domains/primitives/evm-tracker/src/lib.rs @@ -1,12 +1,9 @@ //! Inherents for EVM tracker #![cfg_attr(not(feature = "std"), no_std)] -#[cfg(not(feature = "std"))] -extern crate alloc; - -#[cfg(not(feature = "std"))] -use alloc::vec::Vec; use codec::{Decode, Encode}; +use domain_runtime_primitives::EthereumAccountId; +use sp_domains::PermissionedActionAllowedBy; #[cfg(feature = "std")] use sp_inherents::{Error, InherentData}; use sp_inherents::{InherentIdentifier, IsFatalError}; @@ -32,7 +29,7 @@ impl IsFatalError for InherentError { #[derive(Debug, Encode, Decode)] pub struct InherentType { /// EVM tracker "set contract creation allowed by" call - pub maybe_call: Option>, + pub maybe_call: Option>, } /// Provides the set code inherent data. @@ -44,7 +41,7 @@ pub struct InherentDataProvider { #[cfg(feature = "std")] impl InherentDataProvider { /// Create new inherent data provider from the given `data`. - pub fn new(maybe_call: Option>) -> Self { + pub fn new(maybe_call: Option>) -> Self { Self { data: InherentType { maybe_call }, } @@ -80,16 +77,16 @@ impl sp_inherents::InherentDataProvider for InherentDataProvider { /// Trait to convert Unchecked extrinsic into a Pallet-specific call pub trait IntoEvmTrackerCall { - fn into_evm_tracker_call(call: Vec) -> Call; + fn into_evm_tracker_call(call: PermissionedActionAllowedBy) -> Call; } sp_api::decl_runtime_apis! { /// Api to check and verify the evm-tracker extrinsic calls pub trait EvmTrackerApi { - /// Returns true if evm-tracker exists in the runtime, and extrinsic is valid. - fn is_valid_evm_contract_creation_allowed_by_call(extrinsic: Vec) -> bool; + /// Returns true if evm-tracker exists in the runtime, and the decoded argument is valid. + fn is_valid_evm_contract_creation_allowed_by_call(decoded_argument: PermissionedActionAllowedBy) -> bool; /// Returns an encoded extrinsic for domain "set contract creation allowed by" call. - fn construct_evm_contract_creation_allowed_by_extrinsic(extrinsic: Vec) -> Block::Extrinsic; + fn construct_evm_contract_creation_allowed_by_extrinsic(decoded_argument: PermissionedActionAllowedBy) -> Block::Extrinsic; } } diff --git a/domains/runtime/evm/src/lib.rs b/domains/runtime/evm/src/lib.rs index 17fbafb2f0..268e7096a8 100644 --- a/domains/runtime/evm/src/lib.rs +++ b/domains/runtime/evm/src/lib.rs @@ -55,7 +55,9 @@ use pallet_transporter::EndpointHandler; use sp_api::impl_runtime_apis; use sp_core::crypto::KeyTypeId; use sp_core::{Get, OpaqueMetadata, H160, H256, U256}; -use sp_domains::{ChannelId, DomainAllowlistUpdates, DomainId, Transfers}; +use sp_domains::{ + ChannelId, DomainAllowlistUpdates, DomainId, PermissionedActionAllowedBy, Transfers, +}; use sp_messenger::endpoint::{Endpoint, EndpointHandler as EndpointHandlerT, EndpointId}; use sp_messenger::messages::{ BlockMessagesWithStorageKey, ChainId, CrossDomainMessage, FeeModel, MessageId, MessageKey, @@ -722,12 +724,11 @@ impl MaybeIntoEvmCall for RuntimeCall { pub struct IntoEvmTrackerCall; impl sp_evm_tracker::IntoEvmTrackerCall> for IntoEvmTrackerCall { - fn into_evm_tracker_call(call: Vec) -> pallet_evm_tracker::Call { - use sp_domain_sudo::IntoRuntimeCall; - - match crate::IntoRuntimeCall::runtime_call(call) { - RuntimeCall::EVMNoncetracker(call) => call, - _ => unreachable!("must always be a valid pallet-evm-tracker domain extrinsic as checked by consensus chain; qed"), + fn into_evm_tracker_call( + call: PermissionedActionAllowedBy, + ) -> pallet_evm_tracker::Call { + pallet_evm_tracker::Call::inherent_set_contract_creation_allowed_by { + contract_creation_allowed_by: call, } } } @@ -929,34 +930,23 @@ fn construct_sudo_call_extrinsic(encoded_ext: Vec) -> ::Ext /// Returns `true` if this is a valid pallet-evm-tracker "contract creation allowed by" inherent /// call. -fn is_valid_evm_contract_creation_allowed_by_call(encoded_ext: Vec) -> bool { - let Ok(ext) = UncheckedExtrinsic::decode(&mut encoded_ext.as_slice()) else { - return false; - }; - - matches!( - ext.0.function, - RuntimeCall::EVMNoncetracker( - pallet_evm_tracker::Call::inherent_set_contract_creation_allowed_by { .. } - ) - ) +fn is_valid_evm_contract_creation_allowed_by_call( + _decoded_argument: PermissionedActionAllowedBy, +) -> bool { + // All possible argument values are valid + true } -/// Constructs an evm-tracker call extrinsic from the given encoded extrinsic. +/// Constructs an evm-tracker call extrinsic from the given extrinsic. fn construct_evm_contract_creation_allowed_by_extrinsic( - encoded_ext: Vec, + decoded_argument: PermissionedActionAllowedBy, ) -> ::Extrinsic { - let ext = UncheckedExtrinsic::decode(&mut encoded_ext.as_slice()) - .expect("must always be an valid evm-tracker extrinsic due to the check above; qed"); - - match ext.0.function { - RuntimeCall::EVMNoncetracker( - inner_call @ pallet_evm_tracker::Call::inherent_set_contract_creation_allowed_by { - .. - }, - ) => UncheckedExtrinsic::new_unsigned(inner_call.into()), - _ => panic!("must always be an valid evm-tracker extrinsic due to the check above; qed"), - } + UncheckedExtrinsic::new_unsigned( + pallet_evm_tracker::Call::inherent_set_contract_creation_allowed_by { + contract_creation_allowed_by: decoded_argument, + } + .into(), + ) } fn extract_signer_inner( @@ -1676,12 +1666,12 @@ impl_runtime_apis! { } impl sp_evm_tracker::EvmTrackerApi for Runtime { - fn is_valid_evm_contract_creation_allowed_by_call(extrinsic: Vec) -> bool { - is_valid_evm_contract_creation_allowed_by_call(extrinsic) + fn is_valid_evm_contract_creation_allowed_by_call(decoded_argument: PermissionedActionAllowedBy) -> bool { + is_valid_evm_contract_creation_allowed_by_call(decoded_argument) } - fn construct_evm_contract_creation_allowed_by_extrinsic(extrinsic: Vec) -> ::Extrinsic { - construct_evm_contract_creation_allowed_by_extrinsic(extrinsic) + fn construct_evm_contract_creation_allowed_by_extrinsic(decoded_argument: PermissionedActionAllowedBy) -> ::Extrinsic { + construct_evm_contract_creation_allowed_by_extrinsic(decoded_argument) } } diff --git a/domains/test/runtime/evm/src/lib.rs b/domains/test/runtime/evm/src/lib.rs index 2b41f63ee7..99d464dff1 100644 --- a/domains/test/runtime/evm/src/lib.rs +++ b/domains/test/runtime/evm/src/lib.rs @@ -725,12 +725,11 @@ impl pallet_evm::OnChargeEVMTransaction for EVMCurrencyAdapter { pub struct IntoEvmTrackerCall; impl sp_evm_tracker::IntoEvmTrackerCall> for IntoEvmTrackerCall { - fn into_evm_tracker_call(call: Vec) -> pallet_evm_tracker::Call { - use sp_domain_sudo::IntoRuntimeCall; - - match crate::IntoRuntimeCall::runtime_call(call) { - RuntimeCall::EVMNoncetracker(call) => call, - _ => unreachable!("must always be a valid pallet-evm-tracker domain extrinsic as checked by consensus chain; qed"), + fn into_evm_tracker_call( + call: PermissionedActionAllowedBy, + ) -> pallet_evm_tracker::Call { + pallet_evm_tracker::Call::inherent_set_contract_creation_allowed_by { + contract_creation_allowed_by: call, } } } @@ -968,34 +967,23 @@ fn construct_sudo_call_extrinsic(encoded_ext: Vec) -> ::Ext /// Returns `true` if this is a valid pallet-evm-tracker "contract creation allowed by" inherent /// call. -fn is_valid_evm_contract_creation_allowed_by_call(encoded_ext: Vec) -> bool { - let Ok(ext) = UncheckedExtrinsic::decode(&mut encoded_ext.as_slice()) else { - return false; - }; - - matches!( - ext.0.function, - RuntimeCall::EVMNoncetracker( - pallet_evm_tracker::Call::inherent_set_contract_creation_allowed_by { .. } - ) - ) +fn is_valid_evm_contract_creation_allowed_by_call( + _decoded_argument: PermissionedActionAllowedBy, +) -> bool { + // All possible argument values are valid + true } -/// Constructs an evm-tracker call extrinsic from the given encoded extrinsic. +/// Constructs an evm-tracker call extrinsic from the given extrinsic. fn construct_evm_contract_creation_allowed_by_extrinsic( - encoded_ext: Vec, + decoded_argument: PermissionedActionAllowedBy, ) -> ::Extrinsic { - let ext = UncheckedExtrinsic::decode(&mut encoded_ext.as_slice()) - .expect("must always be an valid evm-tracker extrinsic due to the check above; qed"); - - match ext.0.function { - RuntimeCall::EVMNoncetracker( - inner_call @ pallet_evm_tracker::Call::inherent_set_contract_creation_allowed_by { - .. - }, - ) => UncheckedExtrinsic::new_unsigned(inner_call.into()), - _ => panic!("must always be an valid evm-tracker extrinsic due to the check above; qed"), - } + UncheckedExtrinsic::new_unsigned( + pallet_evm_tracker::Call::inherent_set_contract_creation_allowed_by { + contract_creation_allowed_by: decoded_argument, + } + .into(), + ) } fn extract_signer_inner( @@ -1715,12 +1703,12 @@ impl_runtime_apis! { } impl sp_evm_tracker::EvmTrackerApi for Runtime { - fn is_valid_evm_contract_creation_allowed_by_call(extrinsic: Vec) -> bool { - is_valid_evm_contract_creation_allowed_by_call(extrinsic) + fn is_valid_evm_contract_creation_allowed_by_call(decoded_argument: PermissionedActionAllowedBy) -> bool { + is_valid_evm_contract_creation_allowed_by_call(decoded_argument) } - fn construct_evm_contract_creation_allowed_by_extrinsic(extrinsic: Vec) -> ::Extrinsic { - construct_evm_contract_creation_allowed_by_extrinsic(extrinsic) + fn construct_evm_contract_creation_allowed_by_extrinsic(decoded_argument: PermissionedActionAllowedBy) -> ::Extrinsic { + construct_evm_contract_creation_allowed_by_extrinsic(decoded_argument) } } diff --git a/test/subspace-test-runtime/src/lib.rs b/test/subspace-test-runtime/src/lib.rs index 7a762d5b1f..773cff4da3 100644 --- a/test/subspace-test-runtime/src/lib.rs +++ b/test/subspace-test-runtime/src/lib.rs @@ -41,7 +41,8 @@ use core::mem; use core::num::NonZeroU64; use domain_runtime_primitives::opaque::Header as DomainHeader; use domain_runtime_primitives::{ - AccountIdConverter, BlockNumber as DomainNumber, Hash as DomainHash, MAX_OUTGOING_MESSAGES, + AccountIdConverter, BlockNumber as DomainNumber, EthereumAccountId, Hash as DomainHash, + MAX_OUTGOING_MESSAGES, }; use frame_support::genesis_builder_helper::{build_state, get_preset}; use frame_support::inherent::ProvideInherent; @@ -67,7 +68,7 @@ use sp_domains::bundle_producer_election::BundleProducerElectionParams; use sp_domains::{ DomainAllowlistUpdates, DomainId, DomainInstanceData, ExecutionReceiptFor, OpaqueBundle, OpaqueBundles, OperatorId, OperatorPublicKey, OperatorRewardSource, - DOMAIN_STORAGE_FEE_MULTIPLIER, INITIAL_DOMAIN_TX_RANGE, + PermissionedActionAllowedBy, DOMAIN_STORAGE_FEE_MULTIPLIER, INITIAL_DOMAIN_TX_RANGE, }; use sp_domains_fraud_proof::fraud_proof::FraudProof; use sp_domains_fraud_proof::storage_proof::{ @@ -1420,7 +1421,7 @@ impl_runtime_apis! { Domains::domain_sudo_call(domain_id) } - fn evm_domain_contract_creation_allowed_by_call(domain_id: DomainId) -> Option> { + fn evm_domain_contract_creation_allowed_by_call(domain_id: DomainId) -> Option> { Domains::evm_domain_contract_creation_allowed_by_call(domain_id) }