internal/era: rename GetReceipts to GetReceiptsByNumber

This commit is contained in:
lightclient 2025-04-03 09:09:48 -06:00
parent 48248e68f8
commit 28802690c1
No known key found for this signature in database
GPG key ID: 657913021EF45A6A
2 changed files with 3 additions and 3 deletions

View file

@ -177,8 +177,8 @@ func (e *Era) GetBlockByNumber(num uint64) (*types.Block, error) {
return types.NewBlockWithHeader(&header).WithBody(body), nil
}
// GetReceipts returns the receipts for the given block number.
func (e *Era) GetReceipts(num uint64) (types.Receipts, error) {
// GetReceiptsByNumber returns the receipts for the given block number.
func (e *Era) GetReceiptsByNumber(num uint64) (types.Receipts, error) {
if e.m.start > num || e.m.start+e.m.count <= num {
return nil, errors.New("out-of-bounds")
}

View file

@ -130,7 +130,7 @@ func TestEra1Builder(t *testing.T) {
if !bytes.Equal(rawReceipts, chain.receipts[i]) {
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 {
t.Fatalf("error reading receipts: %v", err)
}