Skip to content

Commit

Permalink
implement From<Txid> for <[u8; 32]>
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Dec 8, 2024
1 parent b651952 commit 14892a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions consensus/src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ pub struct Txid(
Bytes32StrRev,
);

impl From<Txid> for [u8; 32] {
fn from(txid: Txid) -> Self { txid.to_byte_array() }

Check warning on line 55 in consensus/src/tx.rs

View check run for this annotation

Codecov / codecov/patch

consensus/src/tx.rs#L55

Added line #L55 was not covered by tests
}

impl Txid {
#[inline]
pub const fn coinbase() -> Self { Self(Bytes32StrRev::zero()) }
Expand Down

0 comments on commit 14892a2

Please sign in to comment.