Skip to content

Commit

Permalink
add empty case
Browse files Browse the repository at this point in the history
  • Loading branch information
dragan2234 committed Jan 25, 2024
1 parent 5f7b742 commit 453a592
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ffi_interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ pub fn update_commitment_sparse(
}

let delta_commitment = committer.commit_sparse(delta_values);

// If commitment is empty, then we are creating a new commitment.
if old_commitment_bytes == [0u8; 64] {
return Ok(delta_commitment.to_bytes_uncompressed());
}
Ok((delta_commitment + old_commitment).to_bytes_uncompressed())
}

Expand Down

0 comments on commit 453a592

Please sign in to comment.