Skip to content

Commit

Permalink
add contract abi to stacks transaction for scan output
Browse files Browse the repository at this point in the history
  • Loading branch information
MicaiahReid committed Aug 15, 2023
1 parent a11a6f5 commit f96e05e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/chainhook-sdk/src/indexer/stacks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ pub struct NewTransaction {
pub raw_result: String,
pub raw_tx: String,
pub execution_cost: Option<StacksTransactionExecutionCost>,
pub contract_abi: Option<JsonValue>,
}

#[derive(Deserialize, Debug)]
Expand All @@ -89,6 +90,7 @@ pub struct NewMicroblockTransaction {
pub microblock_sequence: usize,
pub microblock_hash: String,
pub microblock_parent_hash: String,
pub contract_abi: Option<JsonValue>,
}

#[derive(Debug, Deserialize)]
Expand Down Expand Up @@ -311,6 +313,7 @@ pub fn standardize_stacks_block(
description,
position: StacksTransactionPosition::anchor_block(tx.tx_index),
proof: None,
contract_abi: tx.contract_abi.clone(),
},
});
}
Expand Down Expand Up @@ -449,6 +452,7 @@ pub fn standardize_stacks_microblock_trail(
tx.tx_index,
),
proof: None,
contract_abi: tx.contract_abi.clone(),
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pub fn generate_test_tx_stacks_contract_call(
sponsor: None,
position: chainhook_types::StacksTransactionPosition::anchor_block(0),
proof: None,
contract_abi: None,
},
}
}
Expand Down
2 changes: 2 additions & 0 deletions components/chainhook-types-rs/src/rosetta.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::bitcoin::{TxIn, TxOut};
use crate::events::*;
use schemars::JsonSchema;
use serde_json::Value;
use std::cmp::Ordering;
use std::collections::HashSet;
use std::fmt::Display;
Expand Down Expand Up @@ -209,6 +210,7 @@ pub struct StacksTransactionMetadata {
pub execution_cost: Option<StacksTransactionExecutionCost>,
pub position: StacksTransactionPosition,
pub proof: Option<String>,
pub contract_abi: Option<Value>,
}

/// TODO
Expand Down

0 comments on commit f96e05e

Please sign in to comment.