Skip to content

Commit

Permalink
fix: bundle merge reveal check
Browse files Browse the repository at this point in the history
  • Loading branch information
theacdutra committed Dec 26, 2023
1 parent 34079cb commit e0bcb79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/accessors/merge_reveal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ pub enum MergeRevealError {
#[display(inner)]
AnchorMismatch(MergeError),

/// the merged bundles contain excessive transactions.
ExcessiveTransactions,
/// the merged bundles contain excessive transitions.
ExcessiveTransitions,

/// contract id provided for the merge-reveal operation doesn't matches
/// multi-protocol commitment.
Expand Down Expand Up @@ -187,12 +187,12 @@ impl<Seal: ExposedSeal> MergeReveal for Assignments<Seal> {
impl MergeReveal for TransitionBundle {
fn merge_reveal(mut self, other: Self) -> Result<Self, MergeRevealError> {
debug_assert_eq!(self.commitment_id(), other.commitment_id());
if self.known_transitions.len() + other.known_transitions.len() > self.input_map.len() ||
if self.input_map.len() < other.known_transitions.len() ||
self.known_transitions
.extend(other.known_transitions)
.is_err()
{
return Err(MergeRevealError::ExcessiveTransactions);
return Err(MergeRevealError::ExcessiveTransitions);
}
Ok(self)
}
Expand Down

0 comments on commit e0bcb79

Please sign in to comment.