mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
internal/era: rename GetReceipts to GetReceiptsByNumber
This commit is contained in:
parent
48248e68f8
commit
28802690c1
2 changed files with 3 additions and 3 deletions
|
|
@ -177,8 +177,8 @@ func (e *Era) GetBlockByNumber(num uint64) (*types.Block, error) {
|
||||||
return types.NewBlockWithHeader(&header).WithBody(body), nil
|
return types.NewBlockWithHeader(&header).WithBody(body), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetReceipts returns the receipts for the given block number.
|
// GetReceiptsByNumber returns the receipts for the given block number.
|
||||||
func (e *Era) GetReceipts(num uint64) (types.Receipts, error) {
|
func (e *Era) GetReceiptsByNumber(num uint64) (types.Receipts, error) {
|
||||||
if e.m.start > num || e.m.start+e.m.count <= num {
|
if e.m.start > num || e.m.start+e.m.count <= num {
|
||||||
return nil, errors.New("out-of-bounds")
|
return nil, errors.New("out-of-bounds")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ func TestEra1Builder(t *testing.T) {
|
||||||
if !bytes.Equal(rawReceipts, chain.receipts[i]) {
|
if !bytes.Equal(rawReceipts, chain.receipts[i]) {
|
||||||
t.Fatalf("mismatched receipts: want %s, got %s", chain.receipts[i], rawReceipts)
|
t.Fatalf("mismatched receipts: want %s, got %s", chain.receipts[i], rawReceipts)
|
||||||
}
|
}
|
||||||
receipts, err := e.GetReceipts(i)
|
receipts, err := e.GetReceiptsByNumber(i)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("error reading receipts: %v", err)
|
t.Fatalf("error reading receipts: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue