Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew7234 committed Nov 30, 2023
1 parent 3c5fa6d commit d28ba58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion analyzer/queries/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -922,10 +922,12 @@ var (
evs.tx_index,
evs.body
FROM abi_contracts
JOIN chain.address_preimages as preimages ON
abi_contracts.addr = preimages.address
JOIN chain.runtime_events as evs ON
evs.type = 'evm.log' AND
evs.runtime = abi_contracts.runtime AND
evm_contract_address_eth = eth_preimage(abi_contracts.addr)
decode(body->>'address', 'base64') = preimages.address_data
WHERE
evs.abi_parsed_at IS NULL
LIMIT $2`
Expand Down
4 changes: 1 addition & 3 deletions storage/migrations/25_runtime_abi.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ CREATE INDEX ix_runtime_transactions_to_abi_parsed_at ON chain.runtime_transacti
WHERE abi_parsed_at IS NULL;

ALTER TABLE chain.runtime_events
-- The address of the contract that emitted the event. Only present for evm events.
ADD COLUMN evm_contract_address_eth BYTEA GENERATED ALWAYS AS DECODE(body->>'address', 'base64') STORED,
-- Internal tracking for parsing evm.Call transactions using the contract
-- abi when available.
ADD COLUMN abi_parsed_at TIMESTAMP WITH TIME ZONE;
CREATE INDEX ix_runtime_events_runtime_evm_contract_address_eth ON chain.runtime_events (runtime, evm_contract_address_eth);
CREATE INDEX ix_runtime_events_type ON chain.runtime_events (runtime, type);

COMMIT;

0 comments on commit d28ba58

Please sign in to comment.