Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
dev::test::FakeExtVM Class Reference

#include <vm.h>

Inheritance diagram for dev::test::FakeExtVM:
[legend]
Collaboration diagram for dev::test::FakeExtVM:
[legend]

Public Member Functions

 FakeExtVM ()=delete
 
 FakeExtVM (eth::EnvInfo const &_envInfo, unsigned _depth=0)
 
virtual u256 store (u256 _n) override
 Read storage location. More...
 
virtual void setStore (u256 _n, u256 _v) override
 Write a value in storage. More...
 
virtual bool exists (Address _a) override
 Does the account exist? More...
 
virtual u256 balance (Address _a) override
 Read address's balance. More...
 
virtual void suicide (Address _a) override
 Suicide the associated contract and give proceeds to the given address. More...
 
virtual bytes const & codeAt (Address _a) override
 Read address's code. More...
 
virtual size_t codeSizeAt (Address _a) override
 
virtual h160 create (u256 _endowment, u256 &io_gas, bytesConstRef _init, eth::OnOpFunc const &) override
 Create a new (contract) account. More...
 
virtual boost::optional< eth::owning_bytes_refcall (eth::CallParameters &) override
 Make a new message call. More...
 
void setTransaction (Address _caller, u256 _value, u256 _gasPrice, bytes const &_data)
 
void setContract (Address _myAddress, u256 _myBalance, u256 _myNonce, std::map< u256, u256 > const &_storage, bytes const &_code)
 
void set (Address _a, u256 _myBalance, u256 _myNonce, std::map< u256, u256 > const &_storage, bytes const &_code)
 
void reset (u256 _myBalance, u256 _myNonce, std::map< u256, u256 > const &_storage)
 
u256 doPosts ()
 
json_spirit::mObject exportEnv ()
 
json_spirit::mObject exportState ()
 
void importState (json_spirit::mObject &_object)
 
json_spirit::mObject exportExec ()
 
void importExec (json_spirit::mObject &_o)
 
json_spirit::mArray exportCallCreates ()
 
void importCallCreates (json_spirit::mArray &_callcreates)
 
eth::OnOpFunc simpleTrace () const
 
- Public Member Functions inherited from dev::eth::ExtVMFace
 ExtVMFace ()=default
 Null constructor. More...
 
 ExtVMFace (EnvInfo const &_envInfo, Address _myAddress, Address _caller, Address _origin, u256 _value, u256 _gasPrice, bytesConstRef _data, bytes _code, h256 const &_codeHash, unsigned _depth)
 Full constructor. More...
 
virtual ~ExtVMFace ()=default
 
 ExtVMFace (ExtVMFace const &)=delete
 
ExtVMFaceoperator= (ExtVMFace const &)=delete
 
virtual void log (h256s &&_topics, bytesConstRef _data)
 Revert any changes made (by any of the other calls). More...
 
h256 blockHash (u256 _number)
 Hash of a block if within the last 256 blocks, or h256() otherwise. More...
 
EnvInfo const & envInfo () const
 Get the execution environment information. More...
 
virtual EVMSchedule const & evmSchedule () const
 Return the EVM gas-price schedule for this execution context. More...
 

Static Public Member Functions

static dev::eth::EnvInfo importEnv (json_spirit::mObject &_o)
 

Public Attributes

std::map< Address, std::tuple< u256, u256, std::map< u256, u256 >, bytes > > addresses
 
eth::Transactions callcreates
 
bytes thisTxData
 
bytes thisTxCode
 
u256 gas
 
u256 execGas
 
- Public Attributes inherited from dev::eth::ExtVMFace
Address myAddress
 Address associated with executing code (a contract, or contract-to-be). More...
 
Address caller
 Address which sent the message (either equal to origin or a contract). More...
 
Address origin
 Original transactor. More...
 
u256 value
 Value (in Wei) that was passed to this address. More...
 
u256 gasPrice
 Price of gas (that we already paid). More...
 
bytesConstRef data
 Current input data. More...
 
bytes code
 Current code that is executing. More...
 
h256 codeHash
 SHA3 hash of the executing code. More...
 
SubState sub
 Sub-band VM state (suicides, refund counter, logs). More...
 
unsigned depth = 0
 Depth of the present call. More...
 

Detailed Description

Definition at line 44 of file vm.h.

Constructor & Destructor Documentation

dev::test::FakeExtVM::FakeExtVM ( )
delete
FakeExtVM::FakeExtVM ( eth::EnvInfo const &  _envInfo,
unsigned  _depth = 0 
)

Definition at line 36 of file vm.cpp.

Member Function Documentation

virtual u256 dev::test::FakeExtVM::balance ( Address  )
inlineoverridevirtual

Read address's balance.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 53 of file vm.h.

boost::optional< eth::owning_bytes_ref > FakeExtVM::call ( eth::CallParameters )
overridevirtual

Make a new message call.

Implements dev::eth::ExtVMFace.

Definition at line 49 of file vm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bytes const& dev::test::FakeExtVM::codeAt ( Address  )
inlineoverridevirtual

Read address's code.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 55 of file vm.h.

virtual size_t dev::test::FakeExtVM::codeSizeAt ( Address  )
inlineoverridevirtual
Returns
the size of the code in bytes at the given address.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 56 of file vm.h.

Here is the call graph for this function:

h160 FakeExtVM::create ( u256  ,
u256 ,
bytesConstRef  ,
eth::OnOpFunc const &   
)
overridevirtual

Create a new (contract) account.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 40 of file vm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

u256 dev::test::FakeExtVM::doPosts ( )

Here is the caller graph for this function:

virtual bool dev::test::FakeExtVM::exists ( Address  )
inlineoverridevirtual

Does the account exist?

Reimplemented from dev::eth::ExtVMFace.

Definition at line 52 of file vm.h.

mArray FakeExtVM::exportCallCreates ( )

Definition at line 190 of file vm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

mObject FakeExtVM::exportEnv ( )

Definition at line 71 of file vm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

mObject FakeExtVM::exportExec ( )

Definition at line 144 of file vm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

mObject FakeExtVM::exportState ( )

Definition at line 103 of file vm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void FakeExtVM::importCallCreates ( json_spirit::mArray _callcreates)

Definition at line 205 of file vm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

EnvInfo FakeExtVM::importEnv ( json_spirit::mObject _o)
static

Definition at line 82 of file vm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void FakeExtVM::importExec ( json_spirit::mObject _o)

Definition at line 158 of file vm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void FakeExtVM::importState ( json_spirit::mObject _object)

Definition at line 123 of file vm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void FakeExtVM::reset ( u256  _myBalance,
u256  _myNonce,
std::map< u256, u256 > const &  _storage 
)

Definition at line 64 of file vm.cpp.

Here is the caller graph for this function:

void FakeExtVM::set ( Address  _a,
u256  _myBalance,
u256  _myNonce,
std::map< u256, u256 > const &  _storage,
bytes const &  _code 
)

Definition at line 56 of file vm.cpp.

void dev::test::FakeExtVM::setContract ( Address  _myAddress,
u256  _myBalance,
u256  _myNonce,
std::map< u256, u256 > const &  _storage,
bytes const &  _code 
)

Here is the caller graph for this function:

virtual void dev::test::FakeExtVM::setStore ( u256  ,
u256   
)
inlineoverridevirtual

Write a value in storage.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 51 of file vm.h.

void dev::test::FakeExtVM::setTransaction ( Address  _caller,
u256  _value,
u256  _gasPrice,
bytes const &  _data 
)

Here is the caller graph for this function:

eth::OnOpFunc FakeExtVM::simpleTrace ( ) const

Definition at line 221 of file vm.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual u256 dev::test::FakeExtVM::store ( u256  )
inlineoverridevirtual

Read storage location.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 50 of file vm.h.

Here is the caller graph for this function:

virtual void dev::test::FakeExtVM::suicide ( Address  )
inlineoverridevirtual

Suicide the associated contract and give proceeds to the given address.

Reimplemented from dev::eth::ExtVMFace.

Definition at line 54 of file vm.h.

Member Data Documentation

std::map<Address, std::tuple<u256, u256, std::map<u256, u256>, bytes> > dev::test::FakeExtVM::addresses

Definition at line 75 of file vm.h.

eth::Transactions dev::test::FakeExtVM::callcreates

Definition at line 76 of file vm.h.

u256 dev::test::FakeExtVM::execGas

Definition at line 80 of file vm.h.

u256 dev::test::FakeExtVM::gas

Definition at line 79 of file vm.h.

bytes dev::test::FakeExtVM::thisTxCode

Definition at line 78 of file vm.h.

bytes dev::test::FakeExtVM::thisTxData

Definition at line 77 of file vm.h.


The documentation for this class was generated from the following files: