From a01ae4d8f44cff02e1ce4fa031f4013195cd565f Mon Sep 17 00:00:00 2001 From: "tq.tuan" Date: Sun, 11 Feb 2024 18:57:25 +0700 Subject: [PATCH] add return code --- Makefile | 2 +- src/database.rs | 2 +- src/server/tx.rs | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 51df6ff..f779e95 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ #!/bin/sh -NAMADA_VERSION := 0.31.1 +NAMADA_VERSION := 0.31.2 BASE_URL := https://raw.githubusercontent.com/anoma/namada URL := $(BASE_URL)/v$(NAMADA_VERSION)/wasm/checksums.json diff --git a/src/database.rs b/src/database.rs index 3baf259..e6a02ce 100644 --- a/src/database.rs +++ b/src/database.rs @@ -1106,7 +1106,7 @@ impl Database { // Create the SQL query let query = format!( - "SELECT * FROM {0}.{TX_TABLE_NAME} ORDER BY created_at DESC LIMIT {1} OFFSET {2}", + "SELECT * FROM {}.{TX_TABLE_NAME} ORDER BY created_at DESC LIMIT {1} OFFSET {2}", self.network, page_size, offset diff --git a/src/server/tx.rs b/src/server/tx.rs index 71b834e..ff2b8c2 100644 --- a/src/server/tx.rs +++ b/src/server/tx.rs @@ -95,6 +95,8 @@ pub struct TxInfo { data: Option>, /// Inner transaction type tx: Option, + + return_code: Option } impl TxInfo { @@ -202,6 +204,7 @@ impl TryFrom for TxInfo { let gas_limit_multiplier = row.try_get("gas_limit_multiplier")?; let code: Option> = row.try_get("code")?; let data: Option> = row.try_get("data")?; + let return_code: Option = row.try_get("return_code")?; Ok(Self { hash, @@ -213,6 +216,7 @@ impl TryFrom for TxInfo { gas_limit_multiplier, code, data, + return_code, tx: None, }) }