chain_client

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitChainClient

func InitChainClient() error

InitChainClient 初始化链客户端

@return error

func InitChainClientMock

func InitChainClientMock() error

InitChainClientMock 初始化链客户端

@return error

Types

type ChainClient

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

ChainClient 链客户端结构体

func (*ChainClient) CheckChain

func (c *ChainClient) CheckChain() bool

CheckChain 检查链的连通性

@receiver c
@return bool

func (*ChainClient) GetTxProve

func (c *ChainClient) GetTxProve(blockHeight uint64, chainRid string, tx *common.TransactionInfo) string

GetTxProve 获取交易证明

@receiver c
@param blockHeight
@param chainRid
@param tx
@return string

func (*ChainClient) InvokeContract

func (c *ChainClient) InvokeContract(chainRid, contractName,
	method string, withSyncResult bool, kvJsonStr string, timeout int64) ([]byte, *common.TransactionInfo, error)

InvokeContract invoke合约

@receiver c
@param chainRid
@param contractName
@param method
@param withSyncResult
@param kvJsonStr
@param timeout
@return []byte
@return *common.TransactionInfo
@return error

type ChainClientItfc

type ChainClientItfc interface {
	InvokeContract(chainRid, contractName,
		method string, withSyncResult bool, kvJsonStr string, timeout int64) ([]byte, *common.TransactionInfo, error)
	GetTxProve(blockHeight uint64, chainRid string, tx *common.TransactionInfo) string
	CheckChain() bool
}

ChainClientItfc 链客户端接口

var ChainClientV1 ChainClientItfc

ChainClientV1 连交互模块对象

type ChainClientMock

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

ChainClientMock 链客户端结构体Mock

func (*ChainClientMock) CheckChain

func (c *ChainClientMock) CheckChain() bool

CheckChain 检查链的连通性

@receiver c
@return bool

func (*ChainClientMock) GetTxProve

func (c *ChainClientMock) GetTxProve(blockHeight uint64, chainId string, tx *common.TransactionInfo) string

GetTxProve 获取交易证明

@receiver c
@param blockHeight
@param chainId
@param tx
@return string

func (*ChainClientMock) InvokeContract

func (c *ChainClientMock) InvokeContract(chainId, contractName,
	method string, withSyncResult bool, kvJsonStr string, timeout int64) ([]byte, *common.TransactionInfo, error)

InvokeContract invoke合约

@receiver c
@param chainId
@param contractName
@param method
@param withSyncResult
@param kvJsonStr
@param timeout
@return []byte
@return *common.TransactionInfo
@return error

Jump to

Keyboard shortcuts

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