Documentation ¶
Index ¶
- func InitChainClient() error
- func InitChainClientMock() error
- type ChainClient
- func (c *ChainClient) CheckChain() bool
- func (c *ChainClient) GetTxProve(blockHeight uint64, chainRid string, tx *common.TransactionInfo) string
- func (c *ChainClient) InvokeContract(chainRid, contractName, method string, withSyncResult bool, kvJsonStr string, ...) ([]byte, *common.TransactionInfo, error)
- type ChainClientItfc
- type ChainClientMock
- func (c *ChainClientMock) CheckChain() bool
- func (c *ChainClientMock) GetTxProve(blockHeight uint64, chainId string, tx *common.TransactionInfo) string
- func (c *ChainClientMock) InvokeContract(chainId, contractName, method string, withSyncResult bool, kvJsonStr string, ...) ([]byte, *common.TransactionInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
Click to show internal directories.
Click to hide internal directories.