pub trait PrecompileProvider<CTX: ContextTr> {
type Output;
// Required methods
fn set_spec(&mut self, spec: <CTX::Cfg as Cfg>::Spec) -> bool;
fn run(
&mut self,
context: &mut CTX,
address: &Address,
inputs: &InputsImpl,
is_static: bool,
gas_limit: u64,
) -> Result<Option<Self::Output>, String>;
fn warm_addresses(&self) -> Box<impl Iterator<Item = Address>>;
fn contains(&self, address: &Address) -> bool;
}
Required Associated Types§
Required Methods§
Sourcefn set_spec(&mut self, spec: <CTX::Cfg as Cfg>::Spec) -> bool
fn set_spec(&mut self, spec: <CTX::Cfg as Cfg>::Spec) -> bool
Sets the spec id and returns true if the spec id was changed. Initial call to set_spec will always return true.
Returned booling will determine if precompile addresses should be injected into the journal.
Sourcefn run(
&mut self,
context: &mut CTX,
address: &Address,
inputs: &InputsImpl,
is_static: bool,
gas_limit: u64,
) -> Result<Option<Self::Output>, String>
fn run( &mut self, context: &mut CTX, address: &Address, inputs: &InputsImpl, is_static: bool, gas_limit: u64, ) -> Result<Option<Self::Output>, String>
Run the precompile.
Sourcefn warm_addresses(&self) -> Box<impl Iterator<Item = Address>>
fn warm_addresses(&self) -> Box<impl Iterator<Item = Address>>
Get the warm addresses.
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.