good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 4dae6739 authored by Jaynti Kanani's avatar Jaynti Kanani
Browse files

new: add filter for block logs

parent 432749d6
No related branches found
No related tags found
Loading
package filters
import (
"context"
"github.com/maticnetwork/bor/common"
"github.com/maticnetwork/bor/core/rawdb"
"github.com/maticnetwork/bor/core/types"
)
func (b *testBackend) GetBorBlockReceipt(ctx context.Context, hash common.Hash) (*types.BorReceipt, error) {
number := rawdb.ReadHeaderNumber(b.db, hash)
if number == nil {
return nil, nil
}
receipt := rawdb.ReadBorReceipt(b.db, hash, *number)
if receipt == nil {
return nil, nil
}
return receipt, nil
}
func (b *testBackend) GetBorBlockLogs(ctx context.Context, hash common.Hash) ([]*types.Log, error) {
receipt, err := b.GetBorBlockReceipt(ctx, hash)
if receipt == nil || err != nil {
return nil, nil
}
return receipt.Logs, nil
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment