Skip to content

Commit

Permalink
Merge pull request #637 from fluidvanadium/confirmed_summaries
Browse files Browse the repository at this point in the history
added unconfirmed to summaries
  • Loading branch information
juanky201271 authored Oct 27, 2023
2 parents fe9a81d + dfae8ed commit 6caa904
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 10 additions & 2 deletions zingolib/src/lightclient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,11 @@ impl LightClient {
match tx_fee_result {
Ok(tx_fee) => {
if transaction_md.is_outgoing_transaction() {
let (block_height, datetime, price) = (
let (block_height, datetime, price, unconfirmed) = (
transaction_md.block_height,
transaction_md.datetime,
transaction_md.price,
transaction_md.unconfirmed,
);
summaries.push(ValueTransfer {
block_height,
Expand All @@ -480,6 +481,7 @@ impl LightClient {
memos: vec![],
price,
txid: *txid,
unconfirmed,
});
}
}
Expand Down Expand Up @@ -1522,10 +1524,11 @@ impl LightClient {
txid: TxId,
transaction_md: &TransactionMetadata,
) {
let (block_height, datetime, price) = (
let (block_height, datetime, price, unconfirmed) = (
transaction_md.block_height,
transaction_md.datetime,
transaction_md.price,
transaction_md.unconfirmed,
);
match (
transaction_md.is_outgoing_transaction(),
Expand Down Expand Up @@ -1561,6 +1564,7 @@ impl LightClient {
memos,
price,
txid,
unconfirmed,
});
}
}
Expand All @@ -1578,6 +1582,7 @@ impl LightClient {
memos: vec![],
price,
txid,
unconfirmed,
});
}
for received_sapling in transaction_md.sapling_notes.iter() {
Expand All @@ -1596,6 +1601,7 @@ impl LightClient {
memos,
price,
txid,
unconfirmed,
});
}
for received_orchard in transaction_md.orchard_notes.iter() {
Expand All @@ -1614,6 +1620,7 @@ impl LightClient {
memos,
price,
txid,
unconfirmed,
});
}
}
Expand Down Expand Up @@ -1644,6 +1651,7 @@ impl LightClient {
.collect(),
price,
txid,
unconfirmed,
});
}
};
Expand Down
3 changes: 3 additions & 0 deletions zingolib/src/wallet/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ pub mod summaries {
pub memos: Vec<zcash_primitives::memo::TextMemo>,
pub price: Option<f64>,
pub txid: TxId,
pub unconfirmed: bool,
}
impl ValueTransfer {
pub fn balance_delta(&self) -> i64 {
Expand Down Expand Up @@ -814,6 +815,7 @@ pub mod summaries {
)
.field("price", &self.price)
.field("txid", &self.txid)
.field("unconfirmed", &self.unconfirmed)
.finish()
}
}
Expand Down Expand Up @@ -854,6 +856,7 @@ pub mod summaries {
"pool": "",
"price": value.price,
"txid": value.txid.to_string(),
"unconfirmed": value.unconfirmed,
};
match value.kind {
ValueTransferKind::Sent {
Expand Down

0 comments on commit 6caa904

Please sign in to comment.