Skip to content

Commit cd01498

Browse files
committed
eth/internal: MarshalReceipt use uint for txIndex
1 parent da3822d commit cd01498

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

eth/filters/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ func (api *FilterAPI) TransactionReceipts(ctx context.Context, filter *Transacti
361361
receiptWithTx.Receipt.BlockNumber.Uint64(),
362362
signer,
363363
receiptWithTx.Transaction,
364-
int(receiptWithTx.Receipt.TransactionIndex),
364+
receiptWithTx.Receipt.TransactionIndex,
365365
)
366366
}
367367

internal/ethapi/api.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ func (api *BlockChainAPI) GetBlockReceipts(ctx context.Context, blockNrOrHash rp
629629

630630
result := make([]map[string]interface{}, len(receipts))
631631
for i, receipt := range receipts {
632-
result[i] = MarshalReceipt(receipt, block.Hash(), block.NumberU64(), signer, txs[i], i)
632+
result[i] = MarshalReceipt(receipt, block.Hash(), block.NumberU64(), signer, txs[i], uint(i))
633633
}
634634
return result, nil
635635
}
@@ -1490,11 +1490,11 @@ func (api *TransactionAPI) GetTransactionReceipt(ctx context.Context, hash commo
14901490
return nil, err
14911491
}
14921492
// Derive the sender.
1493-
return MarshalReceipt(receipt, blockHash, blockNumber, api.signer, tx, int(index)), nil
1493+
return MarshalReceipt(receipt, blockHash, blockNumber, api.signer, tx, uint(index)), nil
14941494
}
14951495

14961496
// MarshalReceipt marshals a transaction receipt into a JSON object.
1497-
func MarshalReceipt(receipt *types.Receipt, blockHash common.Hash, blockNumber uint64, signer types.Signer, tx *types.Transaction, txIndex int) map[string]interface{} {
1497+
func MarshalReceipt(receipt *types.Receipt, blockHash common.Hash, blockNumber uint64, signer types.Signer, tx *types.Transaction, txIndex uint) map[string]interface{} {
14981498
from, _ := types.Sender(signer, tx)
14991499

15001500
fields := map[string]interface{}{
@@ -1755,7 +1755,7 @@ func (api *TransactionAPI) SendRawTransactionSync(ctx context.Context, input hex
17551755
rs[i].BlockNumber.Uint64(),
17561756
signer,
17571757
txs[i],
1758-
int(rs[i].TransactionIndex),
1758+
rs[i].TransactionIndex,
17591759
), nil
17601760
}
17611761
return api.GetTransactionReceipt(receiptCtx, hash)

0 commit comments

Comments
 (0)