getLogs API changes to return txHash, make contract arg optional. #81
@ -492,7 +492,7 @@ func (b *Backend) GetReceipts(ctx context.Context, hash common.Hash) (types.Rece
|
||||
if err := rlp.DecodeBytes(rctBytes, rct); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
rct.TxHash = common.HexToHash(txs[i])
|
||||
rct.TxHash = txs[i]
|
||||
rcts[i] = rct
|
||||
}
|
||||
return rcts, nil
|
||||
@ -512,7 +512,7 @@ func (b *Backend) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log
|
||||
}
|
||||
|
||||
for _, log := range rct.Logs {
|
||||
log.TxHash = common.HexToHash(txs[i])
|
||||
log.TxHash = txs[i]
|
||||
}
|
||||
|
||||
logs[i] = rct.Logs
|
||||
|
@ -347,19 +347,19 @@ func (r *IPLDRetriever) RetrieveReceiptsByTxHashes(hashes []common.Hash) ([]stri
|
||||
}
|
||||
|
||||
// RetrieveReceiptsByBlockHash returns the cids and rlp bytes for the receipts corresponding to the provided block hash
|
||||
func (r *IPLDRetriever) RetrieveReceiptsByBlockHash(hash common.Hash) ([]string, [][]byte, []string, error) {
|
||||
func (r *IPLDRetriever) RetrieveReceiptsByBlockHash(hash common.Hash) ([]string, [][]byte, []common.Hash, error) {
|
||||
rctResults := make([]ipldResult, 0)
|
||||
if err := r.db.Select(&rctResults, RetrieveReceiptsByBlockHashPgStr, hash.Hex()); err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
cids := make([]string, len(rctResults))
|
||||
rcts := make([][]byte, len(rctResults))
|
||||
txs := make([]string, len(rctResults))
|
||||
txs := make([]common.Hash, len(rctResults))
|
||||
|
||||
for i, res := range rctResults {
|
||||
cids[i] = res.CID
|
||||
rcts[i] = res.Data
|
||||
txs[i] = res.TxHash
|
||||
txs[i] = common.HexToHash(res.TxHash)
|
||||
}
|
||||
|
||||
return cids, rcts, txs, nil
|
||||
|
@ -1035,7 +1035,7 @@ func (r *Resolver) GetLogs(ctx context.Context, args struct {
|
||||
cid: receiptCID,
|
||||
ipldBlock: receiptBytes,
|
||||
transaction: &Transaction{
|
||||
hash: common.HexToHash(txs[index]),
|
||||
hash: txs[index],
|
||||
},
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user