Documentation ¶
Index ¶
- Variables
- type VMAccountsDB
- func (vadb *VMAccountsDB) AccountExists(address []byte) (bool, error)
- func (vadb *VMAccountsDB) AddTempAccount(address []byte, balance *big.Int, nonce uint64)
- func (vadb *VMAccountsDB) CleanTempAccounts()
- func (vadb *VMAccountsDB) GetBalance(address []byte) (*big.Int, error)
- func (vadb *VMAccountsDB) GetBlockhash(offset *big.Int) ([]byte, error)
- func (vadb *VMAccountsDB) GetCode(address []byte) ([]byte, error)
- func (vadb *VMAccountsDB) GetNonce(address []byte) (*big.Int, error)
- func (vadb *VMAccountsDB) GetStorageData(accountAddress []byte, index []byte) ([]byte, error)
- func (vadb *VMAccountsDB) IsCodeEmpty(address []byte) (bool, error)
- func (vadb *VMAccountsDB) TempAccount(address []byte) state.AccountHandler
- type VMCryptoHook
- func (vmch *VMCryptoHook) Bn128add(p1 vmcommon.Bn128Point, p2 vmcommon.Bn128Point) (vmcommon.Bn128Point, error)
- func (vmch *VMCryptoHook) Bn128ate(l1 []vmcommon.Bn128Point, l2 []vmcommon.Bn128G2Point) (bool, error)
- func (vmch *VMCryptoHook) Bn128g2valid(p vmcommon.Bn128G2Point) (bool, error)
- func (vmch *VMCryptoHook) Bn128mul(k *big.Int, p vmcommon.Bn128Point) (vmcommon.Bn128Point, error)
- func (vmch *VMCryptoHook) Bn128valid(p vmcommon.Bn128Point) (bool, error)
- func (vmch *VMCryptoHook) EcdsaRecover(hash string, v *big.Int, r string, s string) (string, error)
- func (vmch *VMCryptoHook) Keccak256(str string) (string, error)
- func (vmch *VMCryptoHook) Ripemd160(str string) (string, error)
- func (vmch *VMCryptoHook) Sha256(str string) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyCode = errors.New("empty code in provided smart contract holding account")
ErrEmptyCode signals that an account does not contain code
var ErrNotImplemented = errors.New("not implemented")
ErrNotImplemented signals that a functionality can not be used as it is not implemented
Functions ¶
This section is empty.
Types ¶
type VMAccountsDB ¶ added in v1.0.3
type VMAccountsDB struct {
// contains filtered or unexported fields
}
VMAccountsDB is a wrapper over AccountsAdapter that satisfy vmcommon.BlockchainHook interface
func NewVMAccountsDB ¶ added in v1.0.3
func NewVMAccountsDB( accounts state.AccountsAdapter, addrConv state.AddressConverter, ) (*VMAccountsDB, error)
NewVMAccountsDB creates a new VMAccountsDB instance
func (*VMAccountsDB) AccountExists ¶ added in v1.0.3
func (vadb *VMAccountsDB) AccountExists(address []byte) (bool, error)
AccountExists checks if an account exists in provided AccountAdapter
func (*VMAccountsDB) AddTempAccount ¶ added in v1.0.3
func (vadb *VMAccountsDB) AddTempAccount(address []byte, balance *big.Int, nonce uint64)
AddTempAccount will add a temporary account in temporary store
func (*VMAccountsDB) CleanTempAccounts ¶ added in v1.0.3
func (vadb *VMAccountsDB) CleanTempAccounts()
CleanTempAccounts cleans the map holding the temporary accounts
func (*VMAccountsDB) GetBalance ¶ added in v1.0.3
func (vadb *VMAccountsDB) GetBalance(address []byte) (*big.Int, error)
GetBalance returns the balance of a shard account
func (*VMAccountsDB) GetBlockhash ¶ added in v1.0.3
func (vadb *VMAccountsDB) GetBlockhash(offset *big.Int) ([]byte, error)
GetBlockhash is deprecated
func (*VMAccountsDB) GetCode ¶ added in v1.0.3
func (vadb *VMAccountsDB) GetCode(address []byte) ([]byte, error)
GetCode retrieves the account's code
func (*VMAccountsDB) GetNonce ¶ added in v1.0.3
func (vadb *VMAccountsDB) GetNonce(address []byte) (*big.Int, error)
GetNonce returns the nonce of a shard account
func (*VMAccountsDB) GetStorageData ¶ added in v1.0.3
func (vadb *VMAccountsDB) GetStorageData(accountAddress []byte, index []byte) ([]byte, error)
GetStorageData returns the storage value of a variable held in account's data trie
func (*VMAccountsDB) IsCodeEmpty ¶ added in v1.0.3
func (vadb *VMAccountsDB) IsCodeEmpty(address []byte) (bool, error)
IsCodeEmpty returns if the code is empty
func (*VMAccountsDB) TempAccount ¶ added in v1.0.3
func (vadb *VMAccountsDB) TempAccount(address []byte) state.AccountHandler
TempAccount can retrieve a temporary account from provided address
type VMCryptoHook ¶
type VMCryptoHook struct { }
VMCryptoHook is a wrapper used in vm implementation
func (*VMCryptoHook) Bn128add ¶ added in v1.0.3
func (vmch *VMCryptoHook) Bn128add(p1 vmcommon.Bn128Point, p2 vmcommon.Bn128Point) (vmcommon.Bn128Point, error)
Bn128add is deprecated and should be removed as soon as the vmcommon interface has been updated TODO remove this when the vmcommon interface has been updated
func (*VMCryptoHook) Bn128ate ¶ added in v1.0.3
func (vmch *VMCryptoHook) Bn128ate(l1 []vmcommon.Bn128Point, l2 []vmcommon.Bn128G2Point) (bool, error)
Bn128ate is deprecated and should be removed as soon as the vmcommon interface has been updated TODO remove this when the vmcommon interface has been updated
func (*VMCryptoHook) Bn128g2valid ¶ added in v1.0.3
func (vmch *VMCryptoHook) Bn128g2valid(p vmcommon.Bn128G2Point) (bool, error)
Bn128g2valid is deprecated and should be removed as soon as the vmcommon interface has been updated TODO remove this when the vmcommon interface has been updated
func (*VMCryptoHook) Bn128mul ¶ added in v1.0.3
func (vmch *VMCryptoHook) Bn128mul(k *big.Int, p vmcommon.Bn128Point) (vmcommon.Bn128Point, error)
Bn128mul is deprecated and should be removed as soon as the vmcommon interface has been updated TODO remove this when the vmcommon interface has been updated
func (*VMCryptoHook) Bn128valid ¶ added in v1.0.3
func (vmch *VMCryptoHook) Bn128valid(p vmcommon.Bn128Point) (bool, error)
Bn128valid is deprecated and should be removed as soon as the vmcommon interface has been updated TODO remove this when the vmcommon interface has been updated
func (*VMCryptoHook) EcdsaRecover ¶ added in v1.0.3
EcdsaRecover is deprecated and should be removed as soon as the vmcommon interface has been updated TODO remove this when the vmcommon interface has been updated
func (*VMCryptoHook) Keccak256 ¶
func (vmch *VMCryptoHook) Keccak256(str string) (string, error)
Keccak256 returns a keccak 256 hash of the input string. Should return in hex format.