Skip to content

Commit

Permalink
Fixing zero_balanced panic when zero-length args are provided
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Dec 2, 2020
1 parent 04b39a7 commit d411b40
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rgb/contract/assignments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ impl Assignments {
allocations_ours: Vec<(SealDefinition, AtomicValue)>,
allocations_theirs: Vec<(seal::Confidential, AtomicValue)>,
) -> Self {
if allocations_ours.len() + allocations_theirs.len() == 0 {
return Self::DiscreteFiniteField(vec![]);
}

// Generate random blinding factors
let mut rng = bitcoin::secp256k1::rand::thread_rng();
// We will compute the last blinding factors from all others so they
Expand Down

0 comments on commit d411b40

Please sign in to comment.