Trait PendingTransaction

Source
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§

Source

fn address(&self) -> &Address

Returns the address of the current contract instance.

Source

fn sender(&self) -> &Address

Returns the address of the sender of the transaction.

Source

fn value(&self) -> u128

Returns the value sent to the current transaction.

Source

fn input(&self) -> &[u8]

Returns the input provided by the calling context.

Source

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.

Source

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.

Source

fn ret(&mut self, data: &[u8])

Returns data to the calling transaction.

Source

fn err(&mut self, data: &[u8])

Returns error data to the calling context.

Source

fn emit(&mut self, topics: &[&[u8]], data: &[u8])

Publishes a broadcast message in this block.

Source

fn state(&self) -> &dyn KVStore

Returns the state of the current account.

Source

fn state_mut(&mut self) -> &mut dyn KVStoreMut

Returns the mutable state of the current account.

Source

fn code_at(&self, addr: &Address) -> Option<&[u8]>

Returns the bytecode stored at addr or None if the account does not exist.

Source

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.

Implementors§