Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions p-token/src/entrypoint-runtime-verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ fn inner_test_validate_owner(
// Line 102-104 of validate_owner function in mod.rs
if expected_owner != owner_account_info.key() {
assert_eq!(result, Err(ProgramError::Custom(4)));
result
return result;
}
// Line 106-108
// We add the `maybe_multisig_is_initialised.is_some()` to not branch vacuously in the
Expand Down Expand Up @@ -750,18 +750,18 @@ fn inner_test_validate_owner(
if signers_count < multisig.m as usize {
assert_eq!(result, Err(ProgramError::MissingRequiredSignature));
return result;
} else {
return result;
}

return Ok(());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the most important change, avoids erroring out at the call site.

if mint_authority_new.is_some() {
// Validate Owner
inner_test_validate_owner(
mint_authority_new.unwrap(), // expected_owner
&accounts[2], // owner_account_info
&accounts[3..], // tx_signers
maybe_multisig_is_initialised,
result.clone(),
)?;

}
}
// Line 133-135: Non-multisig case - check if owner_account_info.is_signer()
else if !owner_account_info.is_signer() {
assert_eq!(result, Err(ProgramError::MissingRequiredSignature));
return result;
} else {
return result;
}

Ok(())
}

// wrapper to ensure the test below is in the SMIR JSON
Expand Down