Skip to content

Commit

Permalink
Call revert when participant not found based on ritual id and provide…
Browse files Browse the repository at this point in the history
…r - matches prior functionality.
  • Loading branch information
derekpierre committed Jan 27, 2024
1 parent f2337f8 commit 63e6cd7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions contracts/contracts/coordination/Coordinator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,9 @@ contract Coordinator is Initializable, AccessControlDefaultAdminRulesUpgradeable
address provider
) internal view returns (Participant storage) {
(bool found, , Participant storage participant) = findParticipant(ritual, provider);
require(found, "Participant not found");
if (!found) {
revert("Participant not part of ritual");
}
return participant;
}

Expand All @@ -467,11 +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
);
require(found, "Participant not found");
(bool found, uint256 index, Participant memory participant) = findParticipant(ritual, provider);
if (!found) {
revert("Participant not part of ritual");
}
if (!transcript) {
participant.transcript = "";
}
Expand Down

0 comments on commit 63e6cd7

Please sign in to comment.