Documentation ¶
Index ¶
- Constants
- func CompileSolStr(s string) (code, rtCode string, _abi abi.ABI, err error)
- func GenKeyAndAddr() (string, common.Address)
- func GetIntEvn(env string, defaultVal int) (val int)
- func HexPrivKeyToAddr(keyHex string) common.Address
- func HexToBytes(s string) []byte
- func HexToHash32(s string) common.Hash
- func HexToU256(s string) *uint256.Int
- func JoinBytes(a ...[]byte) []byte
- func KeysToGenesisAlloc(balance *uint256.Int, keys []string) gethcore.GenesisAlloc
- func MustCompileSolStr(s string) (code, rtCode string, _abi abi.ABI)
- func MustEncodeTx(tx *gethtypes.Transaction) []byte
- func MustHexToPrivKey(key string) *ecdsa.PrivateKey
- func MustSignTx(tx *gethtypes.Transaction, chainID *big.Int, privKey string) *gethtypes.Transaction
- func NewAddressFilter(addrs ...gethcmn.Address) gethfilters.FilterCriteria
- func NewBlockHashFilter(hash *gethcmn.Hash, addresses ...gethcmn.Address) gethfilters.FilterCriteria
- func NewBlockRangeFilter(from, to int64) gethfilters.FilterCriteria
- func NewTopicsFilter(topics [][]gethcmn.Hash) gethfilters.FilterCriteria
- func ReadKeysFromFile(fname string, count int) (res []string)
- func ToHexutilBig(n int64) *hexutil.Big
- func ToHexutilBytes(s []byte) *hexutil.Bytes
- func ToHexutilU64(n uint64) *hexutil.Uint64
- func ToJSON(v interface{}) string
- func ToPrettyJSON(v interface{}) string
- func UintToBytes32(n uint64) []byte
- type FilterBuilder
- func (fb *FilterBuilder) Addresses(addrs ...gethcmn.Address) *FilterBuilder
- func (fb *FilterBuilder) BlockHash(blockHash gethcmn.Hash) *FilterBuilder
- func (fb *FilterBuilder) BlockRange(from, to int64) *FilterBuilder
- func (fb *FilterBuilder) Build() gethfilters.FilterCriteria
- func (fb *FilterBuilder) Topics(topics [][]gethcmn.Hash) *FilterBuilder
- type MdbBlockBuilder
- func (bb *MdbBlockBuilder) Build() *modbtypes.Block
- func (bb *MdbBlockBuilder) FailedTx(txHash gethcmn.Hash, statusStr string, outData []byte) *MdbBlockBuilder
- func (bb *MdbBlockBuilder) Hash(hash gethcmn.Hash) *MdbBlockBuilder
- func (bb *MdbBlockBuilder) Height(h int64) *MdbBlockBuilder
- func (bb *MdbBlockBuilder) Tx(txHash gethcmn.Hash, logs ...types.Log) *MdbBlockBuilder
- func (bb *MdbBlockBuilder) TxWithAddr(txHash gethcmn.Hash, fromAddr, toAddr gethcmn.Address) *MdbBlockBuilder
- type TestApp
- func (_app *TestApp) AddBlocksToHistory(blocks ...*modbtypes.Block)
- func (_app *TestApp) AddTxsInBlock(height int64, txs ...*gethtypes.Transaction) int64
- func (_app *TestApp) Call(sender, contractAddr gethcmn.Address, data []byte) (int, string, []byte)
- func (_app *TestApp) CallAtHeight(sender, contractAddr gethcmn.Address, data []byte, height int64) (int, string, []byte)
- func (_app *TestApp) CallWithABI(sender, contractAddr gethcmn.Address, abi ethutils.ABIWrapper, ...) []interface{}
- func (_app *TestApp) CheckNewTxABCI(tx *gethtypes.Transaction) uint32
- func (_app *TestApp) CheckTxABCI(tx *gethtypes.Transaction, newTx bool) (uint32, string)
- func (_app *TestApp) DeployContractInBlock(privKey string, data []byte) (*gethtypes.Transaction, int64, gethcmn.Address)
- func (_app *TestApp) Destroy()
- func (_app *TestApp) DestroyWithoutCheck()
- func (_app *TestApp) EnsureTxFailed(hash gethcmn.Hash, msg string)
- func (_app *TestApp) EnsureTxFailedWithOutData(hash gethcmn.Hash, statusStr, outData string)
- func (_app *TestApp) EnsureTxSuccess(hash gethcmn.Hash)
- func (_app *TestApp) EstimateGas(sender gethcmn.Address, tx *gethtypes.Transaction) (int, string, int64)
- func (_app *TestApp) ExecTxInBlock(tx *gethtypes.Transaction) int64
- func (_app *TestApp) ExecTxsInBlock(txs ...*gethtypes.Transaction) int64
- func (_app *TestApp) GetBalance(addr gethcmn.Address) *big.Int
- func (_app *TestApp) GetBlock(h int64) *motypes.Block
- func (_app *TestApp) GetCode(addr gethcmn.Address) []byte
- func (_app *TestApp) GetDynamicArray(addr gethcmn.Address, arrSlot string) [][]byte
- func (_app *TestApp) GetMinGasPrice(isLast bool) uint64
- func (_app *TestApp) GetNonce(addr gethcmn.Address) uint64
- func (_app *TestApp) GetSep20FromAddressCount(contract, addr gethcmn.Address) int64
- func (_app *TestApp) GetSep20ToAddressCount(contract, addr gethcmn.Address) int64
- func (_app *TestApp) GetSeq(addr gethcmn.Address) uint64
- func (_app *TestApp) GetStorageAt(addr gethcmn.Address, key []byte) []byte
- func (_app *TestApp) GetTestPubkey() crypto.PubKey
- func (_app *TestApp) GetToAddressCount(addr gethcmn.Address) int64
- func (_app *TestApp) GetTx(h gethcmn.Hash) (tx *motypes.Transaction)
- func (_app *TestApp) GetTxsByAddr(addr gethcmn.Address) []*motypes.Transaction
- func (_app *TestApp) MakeAndExecTxInBlock(privKey string, toAddr gethcmn.Address, val int64, data []byte) (*gethtypes.Transaction, int64)
- func (_app *TestApp) MakeAndExecTxInBlockWithGas(privKey string, toAddr gethcmn.Address, val int64, data []byte, ...) (*gethtypes.Transaction, int64)
- func (_app *TestApp) MakeAndSignTx(hexPrivKey string, toAddr *gethcmn.Address, val int64, data []byte) (*gethtypes.Transaction, gethcmn.Address)
- func (_app *TestApp) MakeAndSignTxWithAllArgs(hexPrivKey string, toAddr *gethcmn.Address, val int64, data []byte, ...) (*gethtypes.Transaction, gethcmn.Address)
- func (_app *TestApp) MakeAndSignTxWithGas(hexPrivKey string, toAddr *gethcmn.Address, val int64, data []byte, ...) (*gethtypes.Transaction, gethcmn.Address)
- func (_app *TestApp) MakeAndSignTxWithNonce(hexPrivKey string, toAddr *gethcmn.Address, val int64, data []byte, ...) (*gethtypes.Transaction, gethcmn.Address)
- func (_app *TestApp) RecheckTxABCI(tx *gethtypes.Transaction) uint32
- func (_app *TestApp) ReloadApp() *TestApp
- func (_app *TestApp) SetMinGasPrice(gp uint64)
- func (_app *TestApp) StoreBlocks(blocks ...*modbtypes.Block)
- func (_app *TestApp) WaitMS(n int64)
- func (_app *TestApp) WaitNextBlock(currHeight int64)
- type TestAppInitArgs
Constants ¶
View Source
const ( DefaultGasLimit = 1000000 DefaultGasPrice = 0 DefaultInitBalance = uint64(10000000) BlockInterval = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func GenKeyAndAddr ¶
func HexPrivKeyToAddr ¶ added in v0.3.6
func HexToBytes ¶
func HexToHash32 ¶
func KeysToGenesisAlloc ¶
func KeysToGenesisAlloc(balance *uint256.Int, keys []string) gethcore.GenesisAlloc
func MustEncodeTx ¶ added in v0.1.2
func MustEncodeTx(tx *gethtypes.Transaction) []byte
func MustHexToPrivKey ¶ added in v0.1.1
func MustHexToPrivKey(key string) *ecdsa.PrivateKey
func MustSignTx ¶ added in v0.1.1
func MustSignTx(tx *gethtypes.Transaction, chainID *big.Int, privKey string) *gethtypes.Transaction
func NewAddressFilter ¶
func NewAddressFilter(addrs ...gethcmn.Address) gethfilters.FilterCriteria
func NewBlockHashFilter ¶
func NewBlockHashFilter(hash *gethcmn.Hash, addresses ...gethcmn.Address) gethfilters.FilterCriteria
func NewBlockRangeFilter ¶
func NewBlockRangeFilter(from, to int64) gethfilters.FilterCriteria
func NewTopicsFilter ¶
func NewTopicsFilter(topics [][]gethcmn.Hash) gethfilters.FilterCriteria
func ReadKeysFromFile ¶ added in v0.1.6
read private keys from a file
func ToHexutilBig ¶
func ToHexutilBytes ¶
func ToHexutilU64 ¶
func ToPrettyJSON ¶
func ToPrettyJSON(v interface{}) string
func UintToBytes32 ¶ added in v0.3.6
Types ¶
type FilterBuilder ¶
type FilterBuilder struct {
// contains filtered or unexported fields
}
func NewFilterBuilder ¶
func NewFilterBuilder() *FilterBuilder
func (*FilterBuilder) Addresses ¶
func (fb *FilterBuilder) Addresses(addrs ...gethcmn.Address) *FilterBuilder
func (*FilterBuilder) BlockHash ¶
func (fb *FilterBuilder) BlockHash(blockHash gethcmn.Hash) *FilterBuilder
func (*FilterBuilder) BlockRange ¶
func (fb *FilterBuilder) BlockRange(from, to int64) *FilterBuilder
func (*FilterBuilder) Build ¶
func (fb *FilterBuilder) Build() gethfilters.FilterCriteria
func (*FilterBuilder) Topics ¶
func (fb *FilterBuilder) Topics(topics [][]gethcmn.Hash) *FilterBuilder
type MdbBlockBuilder ¶
type MdbBlockBuilder struct {
// contains filtered or unexported fields
}
func NewMdbBlockBuilder ¶
func NewMdbBlockBuilder() *MdbBlockBuilder
func (*MdbBlockBuilder) Build ¶
func (bb *MdbBlockBuilder) Build() *modbtypes.Block
func (*MdbBlockBuilder) FailedTx ¶ added in v0.3.0
func (bb *MdbBlockBuilder) FailedTx(txHash gethcmn.Hash, statusStr string, outData []byte) *MdbBlockBuilder
func (*MdbBlockBuilder) Hash ¶
func (bb *MdbBlockBuilder) Hash(hash gethcmn.Hash) *MdbBlockBuilder
func (*MdbBlockBuilder) Height ¶
func (bb *MdbBlockBuilder) Height(h int64) *MdbBlockBuilder
func (*MdbBlockBuilder) Tx ¶
func (bb *MdbBlockBuilder) Tx(txHash gethcmn.Hash, logs ...types.Log) *MdbBlockBuilder
func (*MdbBlockBuilder) TxWithAddr ¶
func (bb *MdbBlockBuilder) TxWithAddr(txHash gethcmn.Hash, fromAddr, toAddr gethcmn.Address) *MdbBlockBuilder
type TestApp ¶ added in v0.1.2
type TestApp struct { *app.App TestPubkey crypto.PubKey StateRoot []byte StartTime time.Time CfgCopy *param.ChainConfig // contains filtered or unexported fields }
func CreateTestApp ¶ added in v0.1.2
func CreateTestAppInArchiveMode ¶ added in v0.4.0
func CreateTestAppWithArgs ¶ added in v0.3.6
func CreateTestAppWithArgs(args TestAppInitArgs) *TestApp
func CreateTestAppWithSyncDB ¶ added in v0.4.3
func (*TestApp) AddBlocksToHistory ¶ added in v0.1.5
func (*TestApp) AddTxsInBlock ¶ added in v0.1.3
func (_app *TestApp) AddTxsInBlock(height int64, txs ...*gethtypes.Transaction) int64
func (*TestApp) CallAtHeight ¶ added in v0.4.0
func (*TestApp) CallWithABI ¶ added in v0.3.6
func (*TestApp) CheckNewTxABCI ¶ added in v0.1.3
func (_app *TestApp) CheckNewTxABCI(tx *gethtypes.Transaction) uint32
func (*TestApp) CheckTxABCI ¶ added in v0.3.6
func (*TestApp) DeployContractInBlock ¶ added in v0.1.2
func (*TestApp) DestroyWithoutCheck ¶ added in v0.3.3
func (_app *TestApp) DestroyWithoutCheck()
func (*TestApp) EnsureTxFailed ¶ added in v0.1.3
func (*TestApp) EnsureTxFailedWithOutData ¶ added in v0.3.0
func (*TestApp) EnsureTxSuccess ¶ added in v0.1.3
func (*TestApp) EstimateGas ¶ added in v0.1.2
func (*TestApp) ExecTxInBlock ¶ added in v0.1.2
func (_app *TestApp) ExecTxInBlock(tx *gethtypes.Transaction) int64
func (*TestApp) ExecTxsInBlock ¶ added in v0.1.3
func (_app *TestApp) ExecTxsInBlock(txs ...*gethtypes.Transaction) int64
func (*TestApp) GetBalance ¶ added in v0.1.2
func (*TestApp) GetDynamicArray ¶ added in v0.4.0
func (*TestApp) GetMinGasPrice ¶ added in v0.3.0
func (*TestApp) GetSep20FromAddressCount ¶ added in v0.1.2
func (*TestApp) GetSep20ToAddressCount ¶ added in v0.1.2
func (*TestApp) GetStorageAt ¶ added in v0.1.2
func (*TestApp) GetTestPubkey ¶ added in v0.1.6
func (*TestApp) GetToAddressCount ¶ added in v0.1.2
func (*TestApp) GetTx ¶ added in v0.1.2
func (_app *TestApp) GetTx(h gethcmn.Hash) (tx *motypes.Transaction)
func (*TestApp) GetTxsByAddr ¶ added in v0.1.2
func (_app *TestApp) GetTxsByAddr(addr gethcmn.Address) []*motypes.Transaction
func (*TestApp) MakeAndExecTxInBlock ¶ added in v0.1.2
func (*TestApp) MakeAndExecTxInBlockWithGas ¶ added in v0.3.0
func (*TestApp) MakeAndSignTx ¶ added in v0.1.2
func (*TestApp) MakeAndSignTxWithAllArgs ¶ added in v0.3.6
func (*TestApp) MakeAndSignTxWithGas ¶ added in v0.3.0
func (*TestApp) MakeAndSignTxWithNonce ¶ added in v0.3.6
func (*TestApp) RecheckTxABCI ¶ added in v0.3.0
func (_app *TestApp) RecheckTxABCI(tx *gethtypes.Transaction) uint32
func (*TestApp) SetMinGasPrice ¶ added in v0.3.6
func (*TestApp) StoreBlocks ¶ added in v0.1.5
func (*TestApp) WaitNextBlock ¶ added in v0.1.3
Click to show internal directories.
Click to hide internal directories.