Skip to content

Commit

Permalink
wallet: add information about number of our inputs to the history
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Oct 12, 2024
1 parent f3ce1c3 commit 427ceab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/rows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ pub struct TxRow<L2: Layer2Tx> {
pub height: TxStatus<BlockHeight>,
// TODO: Add date/time
pub operation: OpType,
pub our_inputs: Vec<u32>,
pub counterparties: Vec<(Counterparty, i64)>,
pub own: Vec<(DerivedAddr, i64)>,
pub txid: Txid,
Expand Down Expand Up @@ -164,6 +165,12 @@ impl<L2: Layer2Cache> WalletCache<L2> {
let mut row = TxRow {
height: tx.status.map(|info| info.height),
operation: OpType::Credit,
our_inputs: tx
.inputs
.iter()
.enumerate()
.filter_map(|(idx, inp)| inp.derived_addr().map(|_| idx as u32))
.collect(),

Check warning on line 173 in src/rows.rs

View check run for this annotation

Codecov / codecov/patch

src/rows.rs#L168-L173

Added lines #L168 - L173 were not covered by tests
counterparties: none!(),
own: none!(),
txid: tx.txid,
Expand Down

0 comments on commit 427ceab

Please sign in to comment.