MCPcopy Create free account
hub / github.com/33cn/chain33 / QueryTx

Method QueryTx

client/queueprotocol.go:245–260  ·  view source on GitHub ↗

QueryTx query transaction detail by transaction hash from blockchain

(param *types.ReqHash)

Source from the content-addressed store, hash-verified

243
244// QueryTx query transaction detail by transaction hash from blockchain
245func (q *QueueProtocol) QueryTx(param *types.ReqHash) (*types.TransactionDetail, error) {
246 if param == nil {
247 err := types.ErrInvalidParam
248 log.Debug("QueryTx", "Error", err)
249 return nil, err
250 }
251 msg, err := q.send(blockchainKey, types.EventQueryTx, param)
252 if err != nil {
253 log.Debug("QueryTx", "Error", err.Error())
254 return nil, err
255 }
256 if reply, ok := msg.GetData().(*types.TransactionDetail); ok {
257 return reply, nil
258 }
259 return nil, types.ErrTypeAsset
260}
261
262// GetTransactionByAddr get transaction by address
263func (q *QueueProtocol) GetTransactionByAddr(param *types.ReqAddr) (*types.ReplyTxInfos, error) {

Callers

nothing calls this directly

Calls 4

sendMethod · 0.95
DebugMethod · 0.65
ErrorMethod · 0.65
GetDataMethod · 0.65

Tested by

no test coverage detected