Struct vm::tests::FakeExt [−][src]
pub struct FakeExt { pub store: HashMap<H256, H256>, pub suicides: HashSet<Address>, pub calls: HashSet<FakeCall>, pub sstore_clears: usize, pub depth: usize, pub blockhashes: HashMap<U256, H256>, pub codes: HashMap<Address, Arc<Bytes>>, pub logs: Vec<FakeLogEntry>, pub info: EnvInfo, pub schedule: Schedule, pub balances: HashMap<Address, U256>, pub tracing: bool, pub is_static: bool, }
Fake externalities test structure.
Can't do recursive calls.
Fields
store: HashMap<H256, H256>
suicides: HashSet<Address>
calls: HashSet<FakeCall>
sstore_clears: usize
depth: usize
blockhashes: HashMap<U256, H256>
codes: HashMap<Address, Arc<Bytes>>
logs: Vec<FakeLogEntry>
info: EnvInfo
schedule: Schedule
balances: HashMap<Address, U256>
tracing: bool
is_static: bool
Methods
impl FakeExt
[src]
impl FakeExt
pub fn new() -> Self
[src]
pub fn new() -> Self
New fake externalities
pub fn new_byzantium() -> Self
[src]
pub fn new_byzantium() -> Self
New fake externalities with byzantium schedule rules
pub fn new_constantinople() -> Self
[src]
pub fn new_constantinople() -> Self
New fake externalities with constantinople schedule rules
pub fn with_wasm(self) -> Self
[src]
pub fn with_wasm(self) -> Self
Alter fake externalities to allow wasm
Trait Implementations
impl Default for FakeExt
[src]
impl Default for FakeExt
impl Ext for FakeExt
[src]
impl Ext for FakeExt
fn storage_at(&self, key: &H256) -> Result<H256>
[src]
fn storage_at(&self, key: &H256) -> Result<H256>
Returns a value for given key.
fn set_storage(&mut self, key: H256, value: H256) -> Result<()>
[src]
fn set_storage(&mut self, key: H256, value: H256) -> Result<()>
Stores a value for given key.
fn exists(&self, address: &Address) -> Result<bool>
[src]
fn exists(&self, address: &Address) -> Result<bool>
Determine whether an account exists.
fn exists_and_not_null(&self, address: &Address) -> Result<bool>
[src]
fn exists_and_not_null(&self, address: &Address) -> Result<bool>
Determine whether an account exists and is not null (zero balance/nonce, no code).
fn origin_balance(&self) -> Result<U256>
[src]
fn origin_balance(&self) -> Result<U256>
Balance of the origin account.
fn balance(&self, address: &Address) -> Result<U256>
[src]
fn balance(&self, address: &Address) -> Result<U256>
Returns address balance.
fn blockhash(&mut self, number: &U256) -> H256
[src]
fn blockhash(&mut self, number: &U256) -> H256
Returns the hash of one of the 256 most recent complete blocks.
fn create(
&mut self,
gas: &U256,
value: &U256,
code: &[u8],
_address: CreateContractAddress
) -> ContractCreateResult
[src]
fn create(
&mut self,
gas: &U256,
value: &U256,
code: &[u8],
_address: CreateContractAddress
) -> ContractCreateResult
Creates new contract. Read more
fn call(
&mut self,
gas: &U256,
sender_address: &Address,
receive_address: &Address,
value: Option<U256>,
data: &[u8],
code_address: &Address,
_output: &mut [u8],
_call_type: CallType
) -> MessageCallResult
[src]
fn call(
&mut self,
gas: &U256,
sender_address: &Address,
receive_address: &Address,
value: Option<U256>,
data: &[u8],
code_address: &Address,
_output: &mut [u8],
_call_type: CallType
) -> MessageCallResult
Message call. Read more
fn extcode(&self, address: &Address) -> Result<Arc<Bytes>>
[src]
fn extcode(&self, address: &Address) -> Result<Arc<Bytes>>
Returns code at given address
fn extcodesize(&self, address: &Address) -> Result<usize>
[src]
fn extcodesize(&self, address: &Address) -> Result<usize>
Returns code size at given address
fn log(&mut self, topics: Vec<H256>, data: &[u8]) -> Result<()>
[src]
fn log(&mut self, topics: Vec<H256>, data: &[u8]) -> Result<()>
Creates log entry with given topics and data
fn ret(
self,
_gas: &U256,
_data: &ReturnData,
_apply_state: bool
) -> Result<U256>
[src]
fn ret(
self,
_gas: &U256,
_data: &ReturnData,
_apply_state: bool
) -> Result<U256>
Should be called when transaction calls RETURN
opcode. Returns gas_left if cost of returning the data is not too high. Read more
fn suicide(&mut self, refund_address: &Address) -> Result<()>
[src]
fn suicide(&mut self, refund_address: &Address) -> Result<()>
Should be called when contract commits suicide. Address to which funds should be refunded. Read more
fn schedule(&self) -> &Schedule
[src]
fn schedule(&self) -> &Schedule
Returns schedule.
fn env_info(&self) -> &EnvInfo
[src]
fn env_info(&self) -> &EnvInfo
Returns environment info.
fn depth(&self) -> usize
[src]
fn depth(&self) -> usize
Returns current depth of execution. Read more
fn is_static(&self) -> bool
[src]
fn is_static(&self) -> bool
Check if running in static context.
fn inc_sstore_clears(&mut self)
[src]
fn inc_sstore_clears(&mut self)
Increments sstore refunds count by 1.
fn trace_next_instruction(
&mut self,
_pc: usize,
_instruction: u8,
_gas: U256
) -> bool
[src]
fn trace_next_instruction(
&mut self,
_pc: usize,
_instruction: u8,
_gas: U256
) -> bool
Decide if any more operations should be traced. Passthrough for the VM trace.
fn trace_prepare_execute(
&mut self,
_pc: usize,
_instruction: u8,
_gas_cost: U256
)
[src]
fn trace_prepare_execute(
&mut self,
_pc: usize,
_instruction: u8,
_gas_cost: U256
)
Prepare to trace an operation. Passthrough for the VM trace.
fn trace_executed(
&mut self,
_gas_used: U256,
_stack_push: &[U256],
_mem_diff: Option<(usize, &[u8])>,
_store_diff: Option<(U256, U256)>
)
[src]
fn trace_executed(
&mut self,
_gas_used: U256,
_stack_push: &[U256],
_mem_diff: Option<(usize, &[u8])>,
_store_diff: Option<(U256, U256)>
)
Trace the finalised execution of a single instruction.