From 73c24c3b1c43d64c2534a2e04bac00b8db0c1334 Mon Sep 17 00:00:00 2001 From: arnaudberger Date: Wed, 30 Oct 2024 15:40:46 -0400 Subject: [PATCH] add evt_sig to filter --- evm-events-calls/state.go | 4 +++- evm-events-calls/templates/substreams.yaml.gotmpl | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/evm-events-calls/state.go b/evm-events-calls/state.go index dfb2afa..4d69dfe 100644 --- a/evm-events-calls/state.go +++ b/evm-events-calls/state.go @@ -342,7 +342,9 @@ type DynamicContract struct { func (d DynamicContract) FactoryInitialBlock() uint64 { return *d.parentContract.InitialBlock } - +func (d DynamicContract) GenerateStoreQuery() string { + return fmt.Sprintf("evt_addr:%s || evt_sig:%s", d.parentContract.Address, "0x"+d.parentContract.FactoryCreationEvent) +} func (d DynamicContract) ParentContract() *Contract { return d.parentContract } func (d DynamicContract) Identifier() string { return d.Name } func (d DynamicContract) IdentifierSnakeCase() string { return kace.Snake(d.Name) } diff --git a/evm-events-calls/templates/substreams.yaml.gotmpl b/evm-events-calls/templates/substreams.yaml.gotmpl index 596ac30..0af7026 100644 --- a/evm-events-calls/templates/substreams.yaml.gotmpl +++ b/evm-events-calls/templates/substreams.yaml.gotmpl @@ -30,7 +30,7 @@ modules: blockFilter: module: ethcommon:index_events query: - string: evt_addr:{{ $ddsContract.ParentContract.Address }} + string: {{ $ddsContract.GenerateStoreQuery }} inputs: - source: sf.ethereum.type.v2.Block {{- end}}