pub trait InternalContractTrait: Send + Sync + IsActive {
    // Required methods
    fn address(&self) -> &Address;
    fn initialize_block(&self, params: &CommonParams) -> BlockNumber;
    fn get_func_table(
        &self
    ) -> &HashMap<[u8; 4], Box<dyn SolidityFunctionTrait>>;

    // Provided methods
    fn execute(
        &self,
        params: &ActionParams,
        context: &mut InternalRefContext<'_>
    ) -> InternalTrapResult<GasLeft> { ... }
    fn code(&self) -> Arc<Bytes> { ... }
    fn code_hash(&self) -> H256 { ... }
    fn code_size(&self) -> usize { ... }
}
Expand description

Native implementation of an internal contract.

Required Methods§

source

fn address(&self) -> &Address

Address of the internal contract

source

fn initialize_block(&self, params: &CommonParams) -> BlockNumber

Time point to run new_contract_with_admin for such a internal contract

source

fn get_func_table(&self) -> &HashMap<[u8; 4], Box<dyn SolidityFunctionTrait>>

A hash-map for solidity function sig and execution handler.

Provided Methods§

source

fn execute( &self, params: &ActionParams, context: &mut InternalRefContext<'_> ) -> InternalTrapResult<GasLeft>

execute this internal contract on the given parameters.

source

fn code(&self) -> Arc<Bytes>

source

fn code_hash(&self) -> H256

source

fn code_size(&self) -> usize

Implementors§