From 2f445d5fbd3cebea306b11763e4a26a395d84156 Mon Sep 17 00:00:00 2001 From: opsecx <108930243+opsecx@users.noreply.github.com> Date: Wed, 10 Apr 2024 09:20:15 +0200 Subject: [PATCH] fix: Update views tx_vote_proposal and tx_transfer (#185) The views tx_vote_proposal and tx_transfer took in all transactions regardless of status (failed/succeeded). Updated views to only use successful transactions, as in former version tables. Note: An alternate approach might be to make the views richer and include fail/success status in tables. For now this is a quick fix. --- src/views.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views.rs b/src/views.rs index 817aefd..0d0b783 100644 --- a/src/views.rs +++ b/src/views.rs @@ -229,7 +229,7 @@ pub fn get_create_tx_transfer_view_query(network: &str) -> String { data->>'amount' AS amount, data->>'key' AS key, data->>'shielded' AS shielded - FROM {network}.transactions WHERE code = '\\x0960374d23acbac1feb27b3888095859217936c900cef54e559d215cec3206ef';") + FROM {network}.transactions WHERE code = '\\x0960374d23acbac1feb27b3888095859217936c900cef54e559d215cec3206ef' AND return_code = 0;") } pub fn get_drop_tx_unbond_view_query(network: &str) -> String { @@ -298,7 +298,7 @@ pub fn get_create_tx_vote_proposal_view_query(network: &str) -> String { data->>'vote' AS vote, data->>'voter' AS voter, data->>'delegations' AS delegations - FROM {network}.transactions WHERE code = '\\xccdbe81f664ca6c2caa11426927093dc10ed95e75b3f2f45bffd8514fee47cd0';") + FROM {network}.transactions WHERE code = '\\xccdbe81f664ca6c2caa11426927093dc10ed95e75b3f2f45bffd8514fee47cd0' AND return_code = 0;") } pub fn get_drop_tx_withdraw_view_query(network: &str) -> String {