Skip to content

Commit

Permalink
Update tx.rs to include return_code in server respone (Zondax#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
msobh13 authored and tq-tuan15 committed Feb 23, 2024
1 parent 31612f7 commit ec8ba0b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/server/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ pub struct TxInfo {
code: Option<Vec<u8>>,
#[serde(serialize_with = "serialize_optional_hex")]
data: Option<Vec<u8>>,
return_code: Option<i32>, // New field for return_code
/// Inner transaction type
tx: Option<TxDecoded>,

Expand Down Expand Up @@ -204,10 +205,10 @@ impl TryFrom<Row> for TxInfo {
let gas_limit_multiplier = row.try_get("gas_limit_multiplier")?;
let code: Option<Vec<u8>> = row.try_get("code")?;
let data: Option<Vec<u8>> = row.try_get("data")?;
let return_code: Option<i32> = row.try_get("return_code")?;
let return_code = row.try_get("return_code")?;

Ok(Self {
hash,
hash,
block_id,
tx_type,
wrapper_id,
Expand All @@ -216,7 +217,7 @@ impl TryFrom<Row> for TxInfo {
gas_limit_multiplier,
code,
data,
return_code,
return_code, // Assigning return_code to the struct field
tx: None,
})
}
Expand Down

0 comments on commit ec8ba0b

Please sign in to comment.