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§
sourcefn initialize_block(&self, params: &CommonParams) -> BlockNumber
fn initialize_block(&self, params: &CommonParams) -> BlockNumber
Time point to run new_contract_with_admin
for such a internal contract
Provided Methods§
sourcefn execute(
&self,
params: &ActionParams,
context: &mut InternalRefContext<'_>
) -> InternalTrapResult<GasLeft>
fn execute( &self, params: &ActionParams, context: &mut InternalRefContext<'_> ) -> InternalTrapResult<GasLeft>
execute this internal contract on the given parameters.