Skip to content

Commit badb4b0

Browse files
committed
Expose the payment address of transaction inputs.
1 parent 5670109 commit badb4b0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

masp_primitives/src/transaction/components/sapling/builder.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,10 @@ impl<K> fees::InputView<(), K> for SpendDescriptionInfo<K> {
483483
fn key(&self) -> &K {
484484
&self.extsk
485485
}
486+
487+
fn address(&self) -> Option<PaymentAddress> {
488+
PaymentAddress::from_parts(self.diversifier, self.note.pk_d)
489+
}
486490
}
487491

488492
/// A struct containing the information required in order to construct a

masp_primitives/src/transaction/components/sapling/fees.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ pub trait InputView<NoteRef, Key> {
1616
fn asset_type(&self) -> AssetType;
1717
/// The spend/view key of the input being spent.
1818
fn key(&self) -> &Key;
19+
/// The payment address of this input
20+
fn address(&self) -> Option<PaymentAddress>;
1921
}
2022

2123
/// A trait that provides a minimized view of a Sapling conversion suitable for use in

0 commit comments

Comments
 (0)