pub trait PendingTransaction {
Show 13 methods
// Required methods
fn address(&self) -> &Address;
fn sender(&self) -> &Address;
fn value(&self) -> u128;
fn input(&self) -> &[u8] ⓘ;
fn create(&mut self, value: u128, code: &[u8]) -> Box<dyn Receipt>;
fn transact(
&mut self,
callee: Address,
value: u128,
input: &[u8],
) -> Box<dyn Receipt>;
fn ret(&mut self, data: &[u8]);
fn err(&mut self, data: &[u8]);
fn emit(&mut self, topics: &[&[u8]], data: &[u8]);
fn state(&self) -> &dyn KVStore;
fn state_mut(&mut self) -> &mut dyn KVStoreMut;
fn code_at(&self, addr: &Address) -> Option<&[u8]>;
fn account_meta_at(&self, addr: &Address) -> Option<AccountMeta>;
}Expand description
Represents the data and functionality available to a smart contract execution.
Required Methods§
Sourcefn create(&mut self, value: u128, code: &[u8]) -> Box<dyn Receipt>
fn create(&mut self, value: u128, code: &[u8]) -> Box<dyn Receipt>
Creates a new contract with the provided code and initial value. The new transaction will inherit the gas parameters and gas payer of the top level transaction. The current account will be set as the sender.
Sourcefn transact(
&mut self,
callee: Address,
value: u128,
input: &[u8],
) -> Box<dyn Receipt>
fn transact( &mut self, callee: Address, value: u128, input: &[u8], ) -> Box<dyn Receipt>
Executes a balance-transferring RPC to callee with provided input and value.
The new transaction will inherit the gas parameters and gas payer of the top level
transaction. The current account will be set as the sender.
Sourcefn state_mut(&mut self) -> &mut dyn KVStoreMut
fn state_mut(&mut self) -> &mut dyn KVStoreMut
Returns the mutable state of the current account.
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.