Skip to content

Commit

Permalink
fix: apply consistent mapping order ProvisionManagerNotAuthorized (OZ…
Browse files Browse the repository at this point in the history
…_N-05)
  • Loading branch information
MoonBoi9001 committed Oct 4, 2024
1 parent fb592e2 commit 8077435
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ abstract contract ProvisionManager is Initializable, GraphDirectory, ProvisionMa
* @param caller The address of the caller.
* @param serviceProvider The address of the service provider.
*/
error ProvisionManagerNotAuthorized(address caller, address serviceProvider);
error ProvisionManagerNotAuthorized(address serviceProvider, address caller);

/**
* @notice Thrown when a provision is not found.
Expand All @@ -85,7 +85,7 @@ abstract contract ProvisionManager is Initializable, GraphDirectory, ProvisionMa
modifier onlyProvisionAuthorized(address serviceProvider) {
require(
_graphStaking().isAuthorized(msg.sender, serviceProvider, address(this)),
ProvisionManagerNotAuthorized(msg.sender, serviceProvider)
ProvisionManagerNotAuthorized(serviceProvider, msg.sender)
);
_;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ contract SubgraphServiceAllocationStartTest is SubgraphServiceTest {
bytes memory data = _generateData(tokens);
vm.expectRevert(abi.encodeWithSelector(
ProvisionManager.ProvisionManagerNotAuthorized.selector,
users.operator,
users.indexer
users.indexer,
users.operator
));
subgraphService.startService(users.indexer, data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ contract SubgraphServiceAllocationStopTest is SubgraphServiceTest {
vm.expectRevert(
abi.encodeWithSelector(
ProvisionManager.ProvisionManagerNotAuthorized.selector,
users.operator,
users.indexer
users.indexer,
users.operator
)
);
subgraphService.stopService(users.indexer, data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ contract SubgraphServiceRegisterTest is SubgraphServiceTest {
vm.expectRevert(
abi.encodeWithSelector(
ProvisionManager.ProvisionManagerNotAuthorized.selector,
users.operator,
users.indexer
users.indexer,
users.operator
)
);
subgraphService.collect(users.indexer, paymentType, data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ contract SubgraphServiceProviderRegisterTest is SubgraphServiceTest {
resetPrank(users.operator);
vm.expectRevert(abi.encodeWithSelector(
ProvisionManager.ProvisionManagerNotAuthorized.selector,
users.operator,
users.indexer
users.indexer,
users.operator
));
bytes memory data = abi.encode("url", "geoHash", users.rewardsDestination);
subgraphService.register(users.indexer, data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ contract SubgraphServiceProvisionAcceptTest is SubgraphServiceTest {
resetPrank(users.operator);
vm.expectRevert(abi.encodeWithSelector(
ProvisionManager.ProvisionManagerNotAuthorized.selector,
users.operator,
users.indexer
users.indexer,
users.operator
));
subgraphService.acceptProvision(users.indexer, "");
}
Expand Down

0 comments on commit 8077435

Please sign in to comment.