pub trait Block {
// Required methods
fn height(&self) -> u64;
fn transact(
&mut self,
caller: Address,
callee: Address,
payer: Address,
value: u128,
input: &[u8],
gas: u64,
gas_price: u64,
) -> Box<dyn Receipt>;
fn code_at(&self, addr: &Address) -> Option<&[u8]>;
fn account_meta_at(&self, addr: &Address) -> Option<AccountMeta>;
fn state_at(&self, addr: &Address) -> Option<&dyn KVStore>;
fn events(&self) -> Vec<&Event>;
fn receipts(&self) -> Vec<&dyn Receipt>;
}Required Methods§
Sourcefn transact(
&mut self,
caller: Address,
callee: Address,
payer: Address,
value: u128,
input: &[u8],
gas: u64,
gas_price: u64,
) -> Box<dyn Receipt>
fn transact( &mut self, caller: Address, callee: Address, payer: Address, value: u128, input: &[u8], gas: u64, gas_price: u64, ) -> Box<dyn Receipt>
Executes a RPC to callee with provided input and gas computational resources.
value tokens will be transferred from the caller to the callee.
The caller is charged gas * gas_price for the computation.
A transaction that aborts (panics) will have its changes rolled back.
This transact should be called by an Externally Owned Account (EOA).
Sourcefn code_at(&self, addr: &Address) -> Option<&[u8]>
fn code_at(&self, addr: &Address) -> Option<&[u8]>
Returns the bytecode stored at addr or None if the account does not exist.
Sourcefn account_meta_at(&self, addr: &Address) -> Option<AccountMeta>
fn account_meta_at(&self, addr: &Address) -> Option<AccountMeta>
Returns the metadata of the account stored at addr, or
None if the account does not exist.