Skip to content

Commit 379a954

Browse files
dkcummingjberthold
andauthored
Changed inner_test_validate_owner to return Ok(()) (#126)
Previously in the happy case `result` was returned, but that may be a different error unrelated to signers which will then get propagated by `inner_test_validate_owner`. --------- Co-authored-by: Jost Berthold <[email protected]>
1 parent b5fee95 commit 379a954

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

p-token/src/entrypoint-runtime-verification.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ fn inner_test_validate_owner(
700700
// Line 102-104 of validate_owner function in mod.rs
701701
if expected_owner != owner_account_info.key() {
702702
assert_eq!(result, Err(ProgramError::Custom(4)));
703-
result
703+
return result;
704704
}
705705
// Line 106-108
706706
// We add the `maybe_multisig_is_initialised.is_some()` to not branch vacuously in the
@@ -750,18 +750,18 @@ fn inner_test_validate_owner(
750750
if signers_count < multisig.m as usize {
751751
assert_eq!(result, Err(ProgramError::MissingRequiredSignature));
752752
return result;
753-
} else {
754-
return result;
755753
}
754+
755+
return Ok(());
756756
}
757757
}
758758
// Line 133-135: Non-multisig case - check if owner_account_info.is_signer()
759759
else if !owner_account_info.is_signer() {
760760
assert_eq!(result, Err(ProgramError::MissingRequiredSignature));
761761
return result;
762-
} else {
763-
return result;
764762
}
763+
764+
Ok(())
765765
}
766766

767767
// wrapper to ensure the test below is in the SMIR JSON

0 commit comments

Comments
 (0)