Skip to content

Commit

Permalink
commit: support encoding for PhantomData types
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Dec 29, 2023
1 parent 9a05f5c commit 2d3a0a2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions commit_verify/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
//! [LNPBP-9]: https://github.com/LNP-BP/LNPBPs/blob/master/lnpbp-0009.md
use std::io;
use std::marker::PhantomData;

use crate::id::CommitmentId;
use crate::Conceal;
Expand Down Expand Up @@ -336,3 +337,8 @@ pub mod strategies {
impl CommitEncode for [u8; 32] {
fn commit_encode(&self, e: &mut impl io::Write) { e.write_all(self).ok(); }
}

impl<T> CommitEncode for PhantomData<T> {
fn commit_encode(&self, _: &mut impl io::Write) { /* nothing to do */
}

Check warning on line 343 in commit_verify/src/encode.rs

View check run for this annotation

Codecov / codecov/patch

commit_verify/src/encode.rs#L342-L343

Added lines #L342 - L343 were not covered by tests
}

0 comments on commit 2d3a0a2

Please sign in to comment.