Skip to content

Commit 97ef17a

Browse files
committed
psbt: make PsbtInputSatisfier internals private
We don't need access to the internals anywhere, and this is just a POD type with two Copy objects inside so the user can just keep them around after construction if they need access. Add an accessor for the PSBT anyway since it might be convenient. Making these fields private does not break compilation at all.
1 parent 8a93d06 commit 97ef17a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/psbt/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,16 +243,19 @@ impl From<bitcoin::key::FromSliceError> for InputError {
243243
/// is more than number of inputs in pbst
244244
pub struct PsbtInputSatisfier<'psbt> {
245245
/// pbst
246-
pub psbt: &'psbt Psbt,
246+
psbt: &'psbt Psbt,
247247
/// input index
248-
pub index: usize,
248+
index: usize,
249249
}
250250

251251
impl<'psbt> PsbtInputSatisfier<'psbt> {
252252
/// create a new PsbtInputsatisfier from
253253
/// psbt and index
254254
pub fn new(psbt: &'psbt Psbt, index: usize) -> Self { Self { psbt, index } }
255255

256+
/// Accessor for the PSBT this satisfier is associated with.
257+
pub fn psbt(&self) -> &'psbt Psbt { self.psbt }
258+
256259
/// Accessor for the input this satisfier is associated with.
257260
pub fn psbt_input(&self) -> &psbt::Input { &self.psbt.inputs[self.index] }
258261
}

0 commit comments

Comments
 (0)