Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
fix: Update views tx_vote_proposal and tx_transfer (#185)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
opsecx authored Apr 10, 2024
1 parent fae0154 commit 2f445d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/views.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2f445d5

Please sign in to comment.