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

Update tx.rs to include return_code in server respone #141

Merged
merged 3 commits into from
Feb 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/server/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,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 @@ -189,9 +190,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 = row.try_get("return_code")?;

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