diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index 694a3e51832b..f7ae34e22c07 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -260,7 +260,7 @@ func (b *SimulatedBackend) ForEachStorageAt(ctx context.Context, contract common // TransactionReceipt returns the receipt of a transaction. func (b *SimulatedBackend) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { - receipt, _, _, _ := core.GetReceipt(b.database, txHash) + receipt, _, _, _ := core.ReadReceipt(b.database, txHash) return receipt, nil } diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 349e76bdb9b8..210c505c741e 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -813,7 +813,7 @@ func TestChainTxReorgs(t *testing.T) { if txn, _, _, _ := rawdb.ReadTransaction(db, tx.Hash()); txn != nil { t.Errorf("drop %d: tx %v found while shouldn't have been", i, txn) } - if rcpt, _, _, _ := GetReceipt(db, tx.Hash()); rcpt != nil { + if rcpt, _, _, _ := ReadReceipt(db, tx.Hash()); rcpt != nil { t.Errorf("drop %d: receipt %v found while shouldn't have been", i, rcpt) } } @@ -822,7 +822,7 @@ func TestChainTxReorgs(t *testing.T) { if txn, _, _, _ := rawdb.ReadTransaction(db, tx.Hash()); txn == nil { t.Errorf("add %d: expected tx to be found", i) } - if rcpt, _, _, _ := GetReceipt(db, tx.Hash()); rcpt == nil { + if rcpt, _, _, _ := ReadReceipt(db, tx.Hash()); rcpt == nil { t.Errorf("add %d: expected receipt to be found", i) } } @@ -831,7 +831,7 @@ func TestChainTxReorgs(t *testing.T) { if txn, _, _, _ := rawdb.ReadTransaction(db, tx.Hash()); txn == nil { t.Errorf("share %d: expected tx to be found", i) } - if rcpt, _, _, _ := GetReceipt(db, tx.Hash()); rcpt == nil { + if rcpt, _, _, _ := ReadReceipt(db, tx.Hash()); rcpt == nil { t.Errorf("share %d: expected receipt to be found", i) } } diff --git a/core/database_util.go b/core/database_util.go index a4eee4c5905a..72491a7d0eb8 100644 --- a/core/database_util.go +++ b/core/database_util.go @@ -62,9 +62,9 @@ func blockBodyKey(hash common.Hash, number uint64) []byte { return append(append(bodyPrefix, encodeBlockNumber(number)...), hash.Bytes()...) } -// GetReceipt retrieves a specific transaction receipt from the database, along with +// ReadReceipt retrieves a specific transaction receipt from the database, along with // its added positional metadata. -func GetReceipt(db ethdb.Reader, hash common.Hash) (*types.Receipt, common.Hash, uint64, uint64) { +func ReadReceipt(db ethdb.Reader, hash common.Hash) (*types.Receipt, common.Hash, uint64, uint64) { // Retrieve the lookup metadata and resolve the receipt from the receipts blockHash, blockNumber, receiptIndex := rawdb.ReadTxLookupEntry(db, hash)