Skip to content

Commit

Permalink
blockbook/tx-specific: support unconfirmed txs
Browse files Browse the repository at this point in the history
  • Loading branch information
dspicher committed Aug 14, 2023
1 parent baa2cd0 commit 85c9f7e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1237,16 +1237,16 @@ pub struct TransactionSpecific {
pub version: u8,
pub vin: Vec<VinSpecific>,
pub vout: Vec<VoutSpecific>,
pub blockhash: BlockHash,
pub blocktime: Time,
pub blockhash: Option<BlockHash>,
pub blocktime: Option<Time>,
#[serde(rename = "hash")]
pub wtxid: Wtxid,
pub confirmations: u32,
pub confirmations: Option<u32>,
pub locktime: LockTime,
#[serde(rename = "hex")]
pub script: ScriptBuf,
pub size: u32,
pub time: Time,
pub time: Option<Time>,
pub vsize: u32,
pub weight: u32,
}
Expand Down
16 changes: 8 additions & 8 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ async fn test_tx_specific() {
.parse()
.unwrap(),
size: 402,
time: Time::from_consensus(1_669_723_092).unwrap(),
time: Some(Time::from_consensus(1_669_723_092).unwrap()),
vsize: 240,
weight: 957,
blockhash: "00000000000000000006b7e2a7110c174f21633adbe955c8f86f36699bba6716"
blockhash: Some("00000000000000000006b7e2a7110c174f21633adbe955c8f86f36699bba6716"
.parse()
.unwrap(),
blocktime: Time::from_consensus(1_669_723_092).unwrap(),
.unwrap()),
blocktime: Some(Time::from_consensus(1_669_723_092).unwrap()),
confirmations: tx.confirmations,
locktime: LockTime::ZERO,
vin: vec![
Expand Down Expand Up @@ -350,13 +350,13 @@ async fn test_tx_specific_pre_segwit() {
.unwrap(),
wtxid,
size: 191,
time: Time::from_consensus(1_513_622_125).unwrap(),
time: Some(Time::from_consensus(1_513_622_125).unwrap()),
vsize: 191,
weight: 764,
blockhash: "00000000000000000024fb37364cbf81fd49cc2d51c09c75c35433c3a1945d04"
blockhash: Some("00000000000000000024fb37364cbf81fd49cc2d51c09c75c35433c3a1945d04"
.parse()
.unwrap(),
blocktime: Time::from_consensus(1_513_622_125).unwrap(),
.unwrap()),
blocktime: Some(Time::from_consensus(1_513_622_125).unwrap()),
confirmations: tx.confirmations,
locktime: LockTime::ZERO,
vin: vec![VinSpecific {
Expand Down

0 comments on commit 85c9f7e

Please sign in to comment.