Documentation ¶
Index ¶
- func GetDefaultConfig() *types.ChainConfig
- type ChainMock
- func (mock *ChainMock) Close()
- func (mock *ChainMock) GetAPI() client.QueueProtocolAPI
- func (mock *ChainMock) GetAccount(stateHash []byte, addr string) *types.Account
- func (mock *ChainMock) GetBlock(height int64) *types.Block
- func (mock *ChainMock) GetBlockChain() *blockchain.BlockChain
- func (mock *ChainMock) GetCfg() *types.Config
- func (mock *ChainMock) GetClient() queue.Client
- func (mock *ChainMock) GetExecAccount(stateHash []byte, execer, addr string) *types.Account
- func (mock *ChainMock) GetGenesisAddress() string
- func (mock *ChainMock) GetGenesisKey() crypto.PrivKey
- func (mock *ChainMock) GetHotAddress() string
- func (mock *ChainMock) GetHotKey() crypto.PrivKey
- func (mock *ChainMock) GetJSONC() *jsonclient.JSONClient
- func (mock *ChainMock) GetLastBlock() *types.Block
- func (mock *ChainMock) GetLastSendTx() []byte
- func (mock *ChainMock) GetRPC() *rpc.RPC
- func (mock *ChainMock) Listen()
- func (mock *ChainMock) SendAndSign(priv crypto.PrivKey, hextx string) ([]byte, error)
- func (mock *ChainMock) SendAndSignNonce(priv crypto.PrivKey, hextx string, nonce int64) ([]byte, error)
- func (mock *ChainMock) SendHot() error
- func (mock *ChainMock) SendTx(tx *types.Transaction) []byte
- func (mock *ChainMock) SendTxRPC(tx *types.Transaction) []byte
- func (mock *ChainMock) SetLastSend(hash []byte)
- func (mock *ChainMock) Wait() error
- func (mock *ChainMock) WaitHeight(height int64) error
- func (mock *ChainMock) WaitHeightTimeout(height int64, timeout int64) error
- func (mock *ChainMock) WaitTx(hash []byte) (*rpctypes.TransactionDetail, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChainMock ¶
type ChainMock struct {
// contains filtered or unexported fields
}
ChainMock :
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) GetAccount ¶
GetAccount :
func (*ChainMock) GetBlockChain ¶
func (mock *ChainMock) GetBlockChain() *blockchain.BlockChain
GetBlockChain :
func (*ChainMock) GetExecAccount ¶
GetExecAccount :get execer account info
func (*ChainMock) GetGenesisAddress ¶
GetGenesisAddress :
func (*ChainMock) GetGenesisKey ¶
GetGenesisKey :
func (*ChainMock) SendAndSign ¶
SendAndSign :
func (*ChainMock) SendAndSignNonce ¶
func (mock *ChainMock) SendAndSignNonce(priv crypto.PrivKey, hextx string, nonce int64) ([]byte, error)
SendAndSignNonce 用外部传入的nonce 重写nonce
func (*ChainMock) SendTxRPC ¶
func (mock *ChainMock) SendTxRPC(tx *types.Transaction) []byte
SendTxRPC :
func (*ChainMock) WaitHeightTimeout ¶
WaitHeightTimeout wait with timeout
Click to show internal directories.
Click to hide internal directories.