testnode

package
v0.0.0-...-3c905e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2023 License: BSD-3-Clause Imports: 29 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultConfig

func GetDefaultConfig() *types.ChainConfig

GetDefaultConfig :

Types

type ChainMock

type ChainMock struct {
	// contains filtered or unexported fields
}

ChainMock :

func New

func New(cfgpath string, mockapi client.QueueProtocolAPI) *ChainMock

New :

func NewWithConfig

func NewWithConfig(cfg *types.ChainConfig, mockapi client.QueueProtocolAPI) *ChainMock

NewWithConfig :

func NewWithRPC

func NewWithRPC(cfg *types.ChainConfig, mockapi client.QueueProtocolAPI) *ChainMock

NewWithRPC 创建测试节点 并开放rpc服务

func (*ChainMock) Close

func (mock *ChainMock) Close()

Close :

func (*ChainMock) GetAPI

func (mock *ChainMock) GetAPI() client.QueueProtocolAPI

GetAPI :

func (*ChainMock) GetAccount

func (mock *ChainMock) GetAccount(stateHash []byte, addr string) *types.Account

GetAccount :

func (*ChainMock) GetBlock

func (mock *ChainMock) GetBlock(height int64) *types.Block

GetBlock :

func (*ChainMock) GetBlockChain

func (mock *ChainMock) GetBlockChain() *blockchain.BlockChain

GetBlockChain :

func (*ChainMock) GetCfg

func (mock *ChainMock) GetCfg() *types.Config

GetCfg :

func (*ChainMock) GetClient

func (mock *ChainMock) GetClient() queue.Client

GetClient :

func (*ChainMock) GetExecAccount

func (mock *ChainMock) GetExecAccount(stateHash []byte, execer, addr string) *types.Account

GetExecAccount :get execer account info

func (*ChainMock) GetGenesisAddress

func (mock *ChainMock) GetGenesisAddress() string

GetGenesisAddress :

func (*ChainMock) GetGenesisKey

func (mock *ChainMock) GetGenesisKey() crypto.PrivKey

GetGenesisKey :

func (*ChainMock) GetHotAddress

func (mock *ChainMock) GetHotAddress() string

GetHotAddress :

func (*ChainMock) GetHotKey

func (mock *ChainMock) GetHotKey() crypto.PrivKey

GetHotKey :

func (*ChainMock) GetJSONC

func (mock *ChainMock) GetJSONC() *jsonclient.JSONClient

GetJSONC :

func (*ChainMock) GetLastBlock

func (mock *ChainMock) GetLastBlock() *types.Block

GetLastBlock :

func (*ChainMock) GetLastSendTx

func (mock *ChainMock) GetLastSendTx() []byte

GetLastSendTx :

func (*ChainMock) GetRPC

func (mock *ChainMock) GetRPC() *rpc.RPC

GetRPC :

func (*ChainMock) Listen

func (mock *ChainMock) Listen()

Listen :

func (*ChainMock) SendAndSign

func (mock *ChainMock) SendAndSign(priv crypto.PrivKey, hextx string) ([]byte, error)

SendAndSign :

func (*ChainMock) SendAndSignNonce

func (mock *ChainMock) SendAndSignNonce(priv crypto.PrivKey, hextx string, nonce int64) ([]byte, error)

SendAndSignNonce 用外部传入的nonce 重写nonce

func (*ChainMock) SendHot

func (mock *ChainMock) SendHot() error

SendHot :

func (*ChainMock) SendTx

func (mock *ChainMock) SendTx(tx *types.Transaction) []byte

SendTx :

func (*ChainMock) SendTxRPC

func (mock *ChainMock) SendTxRPC(tx *types.Transaction) []byte

SendTxRPC :

func (*ChainMock) SetLastSend

func (mock *ChainMock) SetLastSend(hash []byte)

SetLastSend :

func (*ChainMock) Wait

func (mock *ChainMock) Wait() error

Wait :

func (*ChainMock) WaitHeight

func (mock *ChainMock) WaitHeight(height int64) error

WaitHeight :

func (*ChainMock) WaitHeightTimeout

func (mock *ChainMock) WaitHeightTimeout(height int64, timeout int64) error

WaitHeightTimeout wait with timeout

func (*ChainMock) WaitTx

func (mock *ChainMock) WaitTx(hash []byte) (*rpctypes.TransactionDetail, error)

WaitTx :

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL