Skip to content

Commit

Permalink
Fix variable output validation rule (#92)
Browse files Browse the repository at this point in the history
* remove validation for duplicate variable outputs asset_ids
  • Loading branch information
Voxelot authored Mar 25, 2022
1 parent cc1cccf commit 574d900
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
14 changes: 0 additions & 14 deletions src/transaction/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,20 +192,6 @@ impl Transaction {
return Err(ValidationError::TransactionOutputChangeAssetIdDuplicated);
}

// check for duplicate variable outputs
if self
.outputs()
.iter()
.filter_map(|output| match output {
Output::Variable { asset_id, .. } if input_asset_id == asset_id => Some(()),
_ => None,
})
.count()
> 1
{
return Err(ValidationError::TransactionOutputVariableAssetIdDuplicated);
}

Ok(())
})?;

Expand Down
1 change: 1 addition & 0 deletions src/transaction/validation/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub enum ValidationError {
TransactionWitnessesMax,
TransactionOutputChangeAssetIdDuplicated,
TransactionOutputChangeAssetIdNotFound,
// TODO: remove in future breaking change to this library
TransactionOutputVariableAssetIdDuplicated,
}

Expand Down

0 comments on commit 574d900

Please sign in to comment.