QueryTx query transaction detail by transaction hash from blockchain
(param *types.ReqHash)
| 243 | |
| 244 | // QueryTx query transaction detail by transaction hash from blockchain |
| 245 | func (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 |
| 263 | func (q *QueueProtocol) GetTransactionByAddr(param *types.ReqAddr) (*types.ReplyTxInfos, error) { |