-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use msg.data @type instead of msg_event.type in all_ecocredit_tx…
…es pg fn
- Loading branch information
Showing
2 changed files
with
39 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--! Previous: - | ||
--! Hash: sha1:5ad90bce5c5fb68d0a8f886b6c07fb280ccd2c42 | ||
|
||
CREATE INDEX IF NOT EXISTS msg_data_type_idx ON msg USING BTREE ((DATA -> '@type')); | ||
|
||
DROP FUNCTION IF EXISTS all_ecocredit_txes; | ||
|
||
CREATE FUNCTION public.all_ecocredit_txes() RETURNS SETOF public.tx | ||
LANGUAGE sql STABLE | ||
AS $$ | ||
select tx.* | ||
from tx | ||
inner join msg using (chain_num, block_height, tx_idx) | ||
where | ||
tx.data ->'tx_response'->'code' = '0' and | ||
msg.data->>'@type' like '/regen.ecocredit.%' | ||
order by tx.block_height desc | ||
$$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters