Documentation ¶
Index ¶
- func CanTransfer(db vm.StateDB, addr common.Address, amount *big.Int) bool
- func GetHashFn() func(n uint64) common.Hash
- func NewEVMContext(from common.Address, blockNum, timeStamp, difficulty int64) vm.Context
- func Transfer(db vm.StateDB, sender, recipient common.Address, amount *big.Int)
- type AccountState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanTransfer ¶
func CanTransfer(db vm.StateDB, addr common.Address, amount *big.Int) bool
CanTransfer checks wether there are enough funds in the address' account to make a transfer. This does not take the necessary gas in to account to make the transfer valid.
func GetHashFn ¶
func GetHashFn() func(n uint64) common.Hash
GetHashFn returns a GetHashFunc which retrieves header hashes by number 获取块号码对于的块hash
func NewEVMContext ¶
func NewEVMContext(from common.Address, blockNum, timeStamp, difficulty int64) vm.Context
NewEVMContext creates a new context for use in the EVM.
Types ¶
type AccountState ¶
type AccountState struct {
Accounts map[common.Address]*accountObject `json:"accounts,omitempty"`
}
AccountState 实现vm的StateDB的接口 用于进行测试
Directories ¶
Path | Synopsis |
---|---|
Package abi implements the Ethereum ABI (Application Binary Interface).
|
Package abi implements the Ethereum ABI (Application Binary Interface). |
bind
Package bind generates Ethereum contract Go bindings.
|
Package bind generates Ethereum contract Go bindings. |
Package common contains various helper functions.
|
Package common contains various helper functions. |
bitutil
Package bitutil implements fast bitwise operations.
|
Package bitutil implements fast bitwise operations. |
compiler
Package compiler wraps the Solidity compiler executable (solc).
|
Package compiler wraps the Solidity compiler executable (solc). |
hexutil
Package hexutil implements hex encoding with 0x prefix.
|
Package hexutil implements hex encoding with 0x prefix. |
math
Package math provides integer math utilities.
|
Package math provides integer math utilities. |
mclock
Package mclock is a wrapper for a monotonic clock source
|
Package mclock is a wrapper for a monotonic clock source |
Package vm implements the Ethereum Virtual Machine.
|
Package vm implements the Ethereum Virtual Machine. |
runtime
Package runtime provides a basic execution model for executing EVM code.
|
Package runtime provides a basic execution model for executing EVM code. |
Click to show internal directories.
Click to hide internal directories.