Skip to content

Commit

Permalink
Pass EventIdl & fix EventSignature
Browse files Browse the repository at this point in the history
  • Loading branch information
reductionista committed Feb 10, 2025
1 parent 3fd4356 commit 92676cf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/solana/chainreader/chain_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,8 @@ func (s *ContractReaderService) addMultiAccountRead(namespace string, readDefini
func (s *ContractReaderService) addEventRead(
namespace, genericName string,
contractAddress solana.PublicKey,
_ codec.IDL,
_ codec.IdlEvent,
idl codec.IDL,
eventIdl codec.IdlEvent,
readDefinition config.ReadDefinition,
events EventsReader,
) error {
Expand All @@ -474,7 +474,7 @@ func (s *ContractReaderService) addEventRead(
applyIndexedFieldTuple(mappedTuples, subKeys, readDefinition.IndexedField2, 2)
applyIndexedFieldTuple(mappedTuples, subKeys, readDefinition.IndexedField3, 3)

filter := toLPFilter(readDefinition.PollingFilter, contractAddress, subKeys[:])
filter := toLPFilter(readDefinition.PollingFilter, contractAddress, subKeys[:], codec.EventIDLTypes{eventIdl, idl.Types})

s.filters = append(s.filters, filter)
s.bdRegistry.AddReadBinding(namespace, genericName, newEventReadBinding(
Expand All @@ -492,11 +492,13 @@ func toLPFilter(
f *config.PollingFilter,
address solana.PublicKey,
subKeyPaths [][]string,
eventIdl codec.EventIDLTypes,
) logpoller.Filter {
return logpoller.Filter{
Address: logpoller.PublicKey(address),
EventName: f.EventName,
EventSig: logpoller.EventSignature([]byte(f.EventName)[:logpoller.EventSignatureLength]),
EventSig: logpoller.NewEventSignatureFromName(f.EventName),
EventIdl: logpoller.EventIdl(eventIdl),
SubkeyPaths: subKeyPaths,
Retention: f.Retention,
MaxLogsKept: f.MaxLogsKept,
Expand Down

0 comments on commit 92676cf

Please sign in to comment.