Trait Host

Source
pub trait Host: ContextTr {
    // Provided methods
    fn set_error(&mut self, error: <Self::Db as Database>::Error) { ... }
    fn block_hash(&mut self, requested_number: u64) -> Option<FixedBytes<32>> { ... }
    fn load_account_delegated(
        &mut self,
        address: Address,
    ) -> Option<StateLoad<AccountLoad>> { ... }
    fn balance(&mut self, address: Address) -> Option<StateLoad<Uint<256, 4>>> { ... }
    fn code(&mut self, address: Address) -> Option<StateLoad<Bytes>> { ... }
    fn code_hash(
        &mut self,
        address: Address,
    ) -> Option<StateLoad<FixedBytes<32>>> { ... }
    fn sload(
        &mut self,
        address: Address,
        index: Uint<256, 4>,
    ) -> Option<StateLoad<Uint<256, 4>>> { ... }
    fn sstore(
        &mut self,
        address: Address,
        index: Uint<256, 4>,
        value: Uint<256, 4>,
    ) -> Option<StateLoad<SStoreResult>> { ... }
    fn tload(&mut self, address: Address, index: Uint<256, 4>) -> Uint<256, 4> { ... }
    fn tstore(
        &mut self,
        address: Address,
        index: Uint<256, 4>,
        value: Uint<256, 4>,
    ) { ... }
    fn log(&mut self, log: Log) { ... }
    fn selfdestruct(
        &mut self,
        address: Address,
        target: Address,
    ) -> Option<StateLoad<SelfDestructResult>> { ... }
}
Expand description

EVM context host.

Provided Methods§

Source

fn set_error(&mut self, error: <Self::Db as Database>::Error)

Source

fn block_hash(&mut self, requested_number: u64) -> Option<FixedBytes<32>>

Gets the block hash of the given block number.

Source

fn load_account_delegated( &mut self, address: Address, ) -> Option<StateLoad<AccountLoad>>

Source

fn balance(&mut self, address: Address) -> Option<StateLoad<Uint<256, 4>>>

Gets balance of address and if the account is cold.

Source

fn code(&mut self, address: Address) -> Option<StateLoad<Bytes>>

Gets code of address and if the account is cold.

Source

fn code_hash(&mut self, address: Address) -> Option<StateLoad<FixedBytes<32>>>

Gets code hash of address and if the account is cold.

Source

fn sload( &mut self, address: Address, index: Uint<256, 4>, ) -> Option<StateLoad<Uint<256, 4>>>

Gets storage value of address at index and if the account is cold.

Source

fn sstore( &mut self, address: Address, index: Uint<256, 4>, value: Uint<256, 4>, ) -> Option<StateLoad<SStoreResult>>

Sets storage value of account address at index.

Returns StateLoad with SStoreResult that contains original/new/old storage value.

Source

fn tload(&mut self, address: Address, index: Uint<256, 4>) -> Uint<256, 4>

Gets the transient storage value of address at index.

Source

fn tstore(&mut self, address: Address, index: Uint<256, 4>, value: Uint<256, 4>)

Sets the transient storage value of address at index.

Source

fn log(&mut self, log: Log)

Emits a log owned by address with given LogData.

Source

fn selfdestruct( &mut self, address: Address, target: Address, ) -> Option<StateLoad<SelfDestructResult>>

Marks address to be deleted, with funds transferred to target.

Implementors§

Source§

impl<T> Host for T
where T: ContextTr,