Skip to content

Commit

Permalink
dbc: add txid info to MergeRevealError
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Mar 30, 2024
1 parent 6d068ef commit 5b93351
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dbc/src/anchor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl TxWitness {
pub fn merge_reveal(self, other: Self) -> Result<Self, MergeError> {
let txid = self.txid();
if txid != other.txid() {
return Err(MergeError::TxidMismatch);
return Err(MergeError::TxidMismatch(txid, other.txid()));
}
Ok(match (self, other) {
(Self::Txid(txid), Self::Txid(_)) => Self::Txid(txid),
Expand Down Expand Up @@ -149,9 +149,10 @@ pub enum MergeError {
MpcMismatch(mpc::MergeError),

/// anchors can't be merged since they have different witness transactions
TxidMismatch,
/// {0} and {1}.
TxidMismatch(Txid, Txid),

/// anchors can't be merged since they have different DBC proofs
/// anchors can't be merged since they have different DBC proofs.
DbcMismatch,
}

Expand Down

0 comments on commit 5b93351

Please sign in to comment.