pallet_evm_tracker/
traits.rs

1//! Traits that make programming against the runtime easier.
2
3use frame_system::pallet_prelude::OriginFor;
4
5/// Type alias for the runtime's account ID.
6pub type AccountIdFor<Runtime> = <Runtime as frame_system::Config>::AccountId;
7
8/// Trait used to convert from a generated `RuntimeCall` type to `pallet_ethereum::Call<Runtime>`.
9pub trait MaybeIntoEthCall<Runtime>
10where
11    Runtime: frame_system::Config + pallet_ethereum::Config,
12    Result<pallet_ethereum::RawOrigin, OriginFor<Runtime>>: From<OriginFor<Runtime>>,
13{
14    /// If this call is a `pallet_ethereum::Call<Runtime>` call, returns the inner call.
15    fn maybe_into_eth_call(&self) -> Option<&pallet_ethereum::Call<Runtime>>;
16}
17
18/// Trait used to convert from a generated `RuntimeCall` type to `pallet_evm::Call<Runtime>`.
19pub trait MaybeIntoEvmCall<Runtime>
20where
21    Runtime: pallet_evm::Config,
22{
23    /// If this call is a `pallet_evm::Call<Runtime>` call, returns the inner call.
24    fn maybe_into_evm_call(&self) -> Option<&pallet_evm::Call<Runtime>>;
25}