Skip to content

Commit

Permalink
Fix use of sentinel participant.
Browse files Browse the repository at this point in the history
  • Loading branch information
derekpierre committed Jan 27, 2024
1 parent 6410e47 commit 6653e71
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions contracts/contracts/coordination/Coordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ contract Coordinator is Initializable, AccessControlDefaultAdminRulesUpgradeable
) internal view returns (bool, uint256, Participant storage participant) {
uint256 length = ritual.participant.length;
if (length == 0) {
return (false, 0, SENTINEL_PARTICIPANT);
return (false, 0, sentinelParticipant);
}
uint256 low = 0;
uint256 high = length - 1;
Expand All @@ -444,7 +444,7 @@ contract Coordinator is Initializable, AccessControlDefaultAdminRulesUpgradeable
low = mid + 1;
} else if (high == 0) {
// prevent underflow of unsigned int
return (false, 0, SENTINEL_PARTICIPANT);
return (false, 0, sentinelParticipant);
} else {
high = mid - 1;
}
Expand All @@ -469,7 +469,10 @@ contract Coordinator is Initializable, AccessControlDefaultAdminRulesUpgradeable
bool transcript
) public view returns (Participant memory, uint256) {
Ritual storage ritual = rituals[ritualId];
(bool found, uint256 index, Participant memory participant) = findParticipant(ritual, provider);
(bool found, uint256 index, Participant memory participant) = findParticipant(
ritual,
provider
);
if (!found) {
revert("Participant not part of ritual");
}
Expand Down

0 comments on commit 6653e71

Please sign in to comment.