mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 21:26:42 +00:00
eth/internal: MarshalReceipt use uint for txIndex
This commit is contained in:
parent
da3822dcec
commit
cd01498c2f
2 changed files with 5 additions and 5 deletions
|
|
@ -361,7 +361,7 @@ func (api *FilterAPI) TransactionReceipts(ctx context.Context, filter *Transacti
|
||||||
receiptWithTx.Receipt.BlockNumber.Uint64(),
|
receiptWithTx.Receipt.BlockNumber.Uint64(),
|
||||||
signer,
|
signer,
|
||||||
receiptWithTx.Transaction,
|
receiptWithTx.Transaction,
|
||||||
int(receiptWithTx.Receipt.TransactionIndex),
|
receiptWithTx.Receipt.TransactionIndex,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -629,7 +629,7 @@ func (api *BlockChainAPI) GetBlockReceipts(ctx context.Context, blockNrOrHash rp
|
||||||
|
|
||||||
result := make([]map[string]interface{}, len(receipts))
|
result := make([]map[string]interface{}, len(receipts))
|
||||||
for i, receipt := range receipts {
|
for i, receipt := range receipts {
|
||||||
result[i] = MarshalReceipt(receipt, block.Hash(), block.NumberU64(), signer, txs[i], i)
|
result[i] = MarshalReceipt(receipt, block.Hash(), block.NumberU64(), signer, txs[i], uint(i))
|
||||||
}
|
}
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
@ -1490,11 +1490,11 @@ func (api *TransactionAPI) GetTransactionReceipt(ctx context.Context, hash commo
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// Derive the sender.
|
// Derive the sender.
|
||||||
return MarshalReceipt(receipt, blockHash, blockNumber, api.signer, tx, int(index)), nil
|
return MarshalReceipt(receipt, blockHash, blockNumber, api.signer, tx, uint(index)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalReceipt marshals a transaction receipt into a JSON object.
|
// MarshalReceipt marshals a transaction receipt into a JSON object.
|
||||||
func MarshalReceipt(receipt *types.Receipt, blockHash common.Hash, blockNumber uint64, signer types.Signer, tx *types.Transaction, txIndex int) map[string]interface{} {
|
func MarshalReceipt(receipt *types.Receipt, blockHash common.Hash, blockNumber uint64, signer types.Signer, tx *types.Transaction, txIndex uint) map[string]interface{} {
|
||||||
from, _ := types.Sender(signer, tx)
|
from, _ := types.Sender(signer, tx)
|
||||||
|
|
||||||
fields := map[string]interface{}{
|
fields := map[string]interface{}{
|
||||||
|
|
@ -1755,7 +1755,7 @@ func (api *TransactionAPI) SendRawTransactionSync(ctx context.Context, input hex
|
||||||
rs[i].BlockNumber.Uint64(),
|
rs[i].BlockNumber.Uint64(),
|
||||||
signer,
|
signer,
|
||||||
txs[i],
|
txs[i],
|
||||||
int(rs[i].TransactionIndex),
|
rs[i].TransactionIndex,
|
||||||
), nil
|
), nil
|
||||||
}
|
}
|
||||||
return api.GetTransactionReceipt(receiptCtx, hash)
|
return api.GetTransactionReceipt(receiptCtx, hash)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue