Skip to content

Commit

Permalink
Merge pull request #74 from BP-WG/v0.11
Browse files Browse the repository at this point in the history
Add to_outpoint convertor method for seals with defined txid info
  • Loading branch information
dr-orlovsky authored Feb 3, 2024
2 parents cbcaf16 + d90f577 commit ce457e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions seals/src/txout/blind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ impl<M: SealCloseMethod> BlindSeal<Txid, M> {
pub fn transmutate(self) -> BlindSeal<TxPtr, M> {
BlindSeal::with_blinding(self.method, self.txid, self.vout, self.blinding)
}

/// Converts seal into a transaction outpoint.
#[inline]
pub fn to_outpoint(&self) -> Outpoint { Outpoint::new(self.txid, self.vout) }
}

impl<M: SealCloseMethod> BlindSeal<TxPtr, M> {
Expand Down
6 changes: 6 additions & 0 deletions seals/src/txout/explicit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ impl<Id: SealTxid, M: SealCloseMethod> ExplicitSeal<Id, M> {
}
}

impl<M: SealCloseMethod> ExplicitSeal<Txid, M> {
/// Converts seal into a transaction outpoint.
#[inline]
pub fn to_outpoint(&self) -> Outpoint { Outpoint::new(self.txid, self.vout) }
}

/// Errors happening during parsing string representation of different forms of
/// single-use-seals
#[derive(Clone, PartialEq, Eq, Debug, Display, Error, From)]
Expand Down

0 comments on commit ce457e3

Please sign in to comment.