Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove transaction_hash from getBlockWithReceipts #2294

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion rpc/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down
2 changes: 2 additions & 0 deletions rpc/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down