mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
core/rawdb: rename ReadRawReceipt
This commit is contained in:
parent
e8e199749a
commit
ca523a7da4
3 changed files with 5 additions and 5 deletions
|
|
@ -233,7 +233,7 @@ func (bc *BlockChain) GetReceiptByIndex(tx *types.Transaction, blockHash common.
|
||||||
if header.ExcessBlobGas != nil {
|
if header.ExcessBlobGas != nil {
|
||||||
blobGasPrice = eip4844.CalcBlobFee(bc.chainConfig, header)
|
blobGasPrice = eip4844.CalcBlobFee(bc.chainConfig, header)
|
||||||
}
|
}
|
||||||
receipt, ctx, err := rawdb.ReadRawReceipt(bc.db, blockHash, blockNumber, txIndex)
|
receipt, ctx, err := rawdb.ReadRawReceiptWithContext(bc.db, blockHash, blockNumber, txIndex)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1021,7 +1021,7 @@ func testChainTxReorgs(t *testing.T, scheme string) {
|
||||||
}
|
}
|
||||||
if rcpt, _, _, index := rawdb.ReadReceipt(db, tx.Hash(), blockchain.Config()); rcpt == nil {
|
if rcpt, _, _, index := rawdb.ReadReceipt(db, tx.Hash(), blockchain.Config()); rcpt == nil {
|
||||||
t.Errorf("add %d: expected receipt to be found", i)
|
t.Errorf("add %d: expected receipt to be found", i)
|
||||||
} else if rawRcpt, ctx, _ := rawdb.ReadRawReceipt(db, rcpt.BlockHash, rcpt.BlockNumber.Uint64(), index); rawRcpt == nil {
|
} else if rawRcpt, ctx, _ := rawdb.ReadRawReceiptWithContext(db, rcpt.BlockHash, rcpt.BlockNumber.Uint64(), index); rawRcpt == nil {
|
||||||
t.Errorf("add %d: expected raw receipt to be found", i)
|
t.Errorf("add %d: expected raw receipt to be found", i)
|
||||||
} else {
|
} else {
|
||||||
if rcpt.GasUsed != ctx.GasUsed {
|
if rcpt.GasUsed != ctx.GasUsed {
|
||||||
|
|
@ -1039,7 +1039,7 @@ func testChainTxReorgs(t *testing.T, scheme string) {
|
||||||
}
|
}
|
||||||
if rcpt, _, _, index := rawdb.ReadReceipt(db, tx.Hash(), blockchain.Config()); rcpt == nil {
|
if rcpt, _, _, index := rawdb.ReadReceipt(db, tx.Hash(), blockchain.Config()); rcpt == nil {
|
||||||
t.Errorf("share %d: expected receipt to be found", i)
|
t.Errorf("share %d: expected receipt to be found", i)
|
||||||
} else if rawRcpt, ctx, _ := rawdb.ReadRawReceipt(db, rcpt.BlockHash, rcpt.BlockNumber.Uint64(), index); rawRcpt == nil {
|
} else if rawRcpt, ctx, _ := rawdb.ReadRawReceiptWithContext(db, rcpt.BlockHash, rcpt.BlockNumber.Uint64(), index); rawRcpt == nil {
|
||||||
t.Errorf("add %d: expected raw receipt to be found", i)
|
t.Errorf("add %d: expected raw receipt to be found", i)
|
||||||
} else {
|
} else {
|
||||||
if rcpt.GasUsed != ctx.GasUsed {
|
if rcpt.GasUsed != ctx.GasUsed {
|
||||||
|
|
|
||||||
|
|
@ -289,10 +289,10 @@ type RawReceiptContext struct {
|
||||||
LogIndex uint // Starting index of the logs within the block
|
LogIndex uint // Starting index of the logs within the block
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadRawReceipt reads a raw receipt at the specified position. It also returns
|
// ReadRawReceiptWithContext reads a raw receipt at the specified position. It also returns
|
||||||
// the gas used by the associated transaction and the starting index of the logs
|
// the gas used by the associated transaction and the starting index of the logs
|
||||||
// within the block.
|
// within the block.
|
||||||
func ReadRawReceipt(db ethdb.Reader, blockHash common.Hash, blockNumber, txIndex uint64) (*types.Receipt, RawReceiptContext, error) {
|
func ReadRawReceiptWithContext(db ethdb.Reader, blockHash common.Hash, blockNumber, txIndex uint64) (*types.Receipt, RawReceiptContext, error) {
|
||||||
receiptIt, err := rlp.NewListIterator(ReadReceiptsRLP(db, blockHash, blockNumber))
|
receiptIt, err := rlp.NewListIterator(ReadReceiptsRLP(db, blockHash, blockNumber))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, RawReceiptContext{}, err
|
return nil, RawReceiptContext{}, err
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue