pub trait EthExtra {
type Config: Config + TxConfig;
type Extension: TransactionExtension<<Self::Config as Config>::RuntimeCall>;
// Required method
fn get_eth_extension(
nonce: <Self::Config as Config>::Nonce,
tip: BalanceOf<Self::Config>,
) -> Self::Extension;
// Provided method
fn try_into_checked_extrinsic(
payload: &[u8],
encoded_len: usize,
) -> Result<CheckedExtrinsic<<Self::Config as Config>::AccountId, <Self::Config as Config>::RuntimeCall, Self::Extension>, InvalidTransaction>
where <Self::Config as Config>::Nonce: TryFrom<U256>,
<Self::Config as Config>::RuntimeCall: SetWeightLimit { ... }
}Expand description
EthExtra convert an unsigned crate::Call::eth_transact into a [CheckedExtrinsic].
Required Associated Types§
Sourcetype Extension: TransactionExtension<<Self::Config as Config>::RuntimeCall>
type Extension: TransactionExtension<<Self::Config as Config>::RuntimeCall>
The Runtime’s transaction extension. It should include at least:
- [
frame_system::CheckNonce] to ensure that the nonce from the Ethereum transaction is correct.
Required Methods§
Sourcefn get_eth_extension(
nonce: <Self::Config as Config>::Nonce,
tip: BalanceOf<Self::Config>,
) -> Self::Extension
fn get_eth_extension( nonce: <Self::Config as Config>::Nonce, tip: BalanceOf<Self::Config>, ) -> Self::Extension
Get the transaction extension to apply to an unsigned crate::Call::eth_transact
extrinsic.
§Parameters
nonce: The nonce extracted from the Ethereum transaction.tip: The transaction tip calculated from the Ethereum transaction.
Provided Methods§
Sourcefn try_into_checked_extrinsic(
payload: &[u8],
encoded_len: usize,
) -> Result<CheckedExtrinsic<<Self::Config as Config>::AccountId, <Self::Config as Config>::RuntimeCall, Self::Extension>, InvalidTransaction>where
<Self::Config as Config>::Nonce: TryFrom<U256>,
<Self::Config as Config>::RuntimeCall: SetWeightLimit,
fn try_into_checked_extrinsic(
payload: &[u8],
encoded_len: usize,
) -> Result<CheckedExtrinsic<<Self::Config as Config>::AccountId, <Self::Config as Config>::RuntimeCall, Self::Extension>, InvalidTransaction>where
<Self::Config as Config>::Nonce: TryFrom<U256>,
<Self::Config as Config>::RuntimeCall: SetWeightLimit,
Convert the unsigned crate::Call::eth_transact into a [CheckedExtrinsic].
and ensure that the fees from the Ethereum transaction correspond to the fees computed from
the encoded_len and the injected weight_limit.
§Parameters
payload: The RLP-encoded Ethereum transaction.encoded_len: The encoded length of the extrinsic.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.