Skip to content

Commit

Permalink
Return EventFilterer from Events() on Blockchain
Browse files Browse the repository at this point in the history
  • Loading branch information
IronGauntlets committed Nov 22, 2024
1 parent 1519d46 commit 9b033c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type Reader interface {

BlockCommitmentsByNumber(blockNumber uint64) (*core.BlockCommitments, error)

EventFilter(from *felt.Felt, keys [][]felt.Felt) (*EventFilter, error)
EventFilter(from *felt.Felt, keys [][]felt.Felt) (EventFilterer, error)

Pending() (Pending, error)

Expand Down Expand Up @@ -844,7 +844,7 @@ func (b *Blockchain) StateAtBlockHash(blockHash *felt.Felt) (core.StateReader, S
}

// EventFilter returns an EventFilter object that is tied to a snapshot of the blockchain
func (b *Blockchain) EventFilter(from *felt.Felt, keys [][]felt.Felt) (*EventFilter, error) {
func (b *Blockchain) EventFilter(from *felt.Felt, keys [][]felt.Felt) (EventFilterer, error) {
b.listener.OnRead("EventFilter")
txn, err := b.database.NewTransaction(false)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions mocks/mock_blockchain.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rpc/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (h *Handler) unsubscribe(sub *subscription, id uint64) {
h.mu.Unlock()
}

func setEventFilterRange(filter *blockchain.EventFilter, fromID, toID *BlockID, latestHeight uint64) error {
func setEventFilterRange(filter blockchain.EventFilterer, fromID, toID *BlockID, latestHeight uint64) error {
set := func(filterRange blockchain.EventFilterRange, id *BlockID) error {
if id == nil {
return nil
Expand Down

0 comments on commit 9b033c5

Please sign in to comment.