diff --git a/rpc/block.go b/rpc/block.go index 2902978078..302ccdac42 100644 --- a/rpc/block.go +++ b/rpc/block.go @@ -226,8 +226,10 @@ func (h *Handler) BlockWithReceipts(id BlockID) (*BlockWithReceipts, *jsonrpc.Er for index, txn := range block.Transactions { r := block.Receipts[index] + t := AdaptTransaction(txn) + t.Hash = nil txsWithReceipts[index] = TransactionWithReceipt{ - Transaction: AdaptTransaction(txn), + Transaction: t, // block_hash, block_number are optional in BlockWithReceipts response Receipt: AdaptReceipt(r, txn, finalityStatus, nil, 0), } diff --git a/rpc/block_test.go b/rpc/block_test.go index a6fa1d28ac..99af2bf3d9 100644 --- a/rpc/block_test.go +++ b/rpc/block_test.go @@ -606,6 +606,7 @@ func TestBlockWithReceipts(t *testing.T) { for i, tx := range block0.Transactions { receipt := block0.Receipts[i] adaptedTx := rpc.AdaptTransaction(tx) + adaptedTx.Hash = nil txsWithReceipt = append(txsWithReceipt, rpc.TransactionWithReceipt{ Transaction: adaptedTx, @@ -650,6 +651,7 @@ func TestBlockWithReceipts(t *testing.T) { for i, tx := range block1.Transactions { receipt := block1.Receipts[i] adaptedTx := rpc.AdaptTransaction(tx) + adaptedTx.Hash = nil transactions = append(transactions, rpc.TransactionWithReceipt{ Transaction: adaptedTx,