Skip to content

Commit 0c9d66d

Browse files
committed
fix: proof was checking for None but we get Some with zero balance
1 parent 6ad3591 commit 0c9d66d

File tree

1 file changed

+6
-4
lines changed
  • packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0

1 file changed

+6
-4
lines changed

packages/rs-drive/src/verify/state_transition/verify_state_transition_was_executed_with_proof/v0/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ impl Drive {
461461
TokenTransition::DestroyFrozenFunds(
462462
destroy_frozen_funds_transition,
463463
) => {
464-
let (root_hash, None) =
464+
let (root_hash, maybe_token_amount) =
465465
Drive::verify_token_balance_for_identity_id(
466466
proof,
467467
token_id.into_buffer(),
@@ -470,10 +470,12 @@ impl Drive {
470470
.into_buffer(),
471471
false,
472472
platform_version,
473-
)?
474-
else {
473+
)?;
474+
if !(maybe_token_amount == Some(0)
475+
|| maybe_token_amount == None)
476+
{
475477
return Err(Error::Proof(ProofError::IncorrectProof(
476-
format!("proof contained token balance for identity {} expected to not exist because of state transition (token destroy frozen funds)", owner_id))));
478+
format!("proof contained non-zero token balance for identity {} expected to be zero or not exist because of state transition (token destroy frozen funds)", destroy_frozen_funds_transition.frozen_identity_id()))));
477479
};
478480
Ok((
479481
root_hash,

0 commit comments

Comments
 (0)