From 8a5b876c3b2ae3b00ccae1282b41d5f7cfe911f9 Mon Sep 17 00:00:00 2001 From: MoonBoi9001 Date: Fri, 4 Oct 2024 15:17:03 +0100 Subject: [PATCH] fix: apply consistent mapping order isAuthorized (OZ_N-05) --- .../contracts/data-service/utilities/ProvisionManager.sol | 2 +- .../test/shared/horizon-staking/HorizonStakingShared.t.sol | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/horizon/contracts/data-service/utilities/ProvisionManager.sol b/packages/horizon/contracts/data-service/utilities/ProvisionManager.sol index ea934c267..51fbb7064 100644 --- a/packages/horizon/contracts/data-service/utilities/ProvisionManager.sol +++ b/packages/horizon/contracts/data-service/utilities/ProvisionManager.sol @@ -84,7 +84,7 @@ abstract contract ProvisionManager is Initializable, GraphDirectory, ProvisionMa */ modifier onlyProvisionAuthorized(address serviceProvider) { require( - _graphStaking().isAuthorized(msg.sender, serviceProvider, address(this)), + _graphStaking().isAuthorized(serviceProvider, msg.sender, address(this)), ProvisionManagerNotAuthorized(serviceProvider, msg.sender) ); _; diff --git a/packages/horizon/test/shared/horizon-staking/HorizonStakingShared.t.sol b/packages/horizon/test/shared/horizon-staking/HorizonStakingShared.t.sol index d9f300979..6072b4f6c 100644 --- a/packages/horizon/test/shared/horizon-staking/HorizonStakingShared.t.sol +++ b/packages/horizon/test/shared/horizon-staking/HorizonStakingShared.t.sol @@ -755,7 +755,7 @@ abstract contract HorizonStakingSharedTest is GraphBaseTest { // before bool beforeOperatorAllowed = _getStorage_OperatorAuth(msgSender, operator, verifier, legacy); - bool beforeOperatorAllowedGetter = staking.isAuthorized(operator, msgSender, verifier); + bool beforeOperatorAllowedGetter = staking.isAuthorized(msgSender, operator, verifier); assertEq(beforeOperatorAllowed, beforeOperatorAllowedGetter); // setOperator @@ -769,7 +769,7 @@ abstract contract HorizonStakingSharedTest is GraphBaseTest { // after bool afterOperatorAllowed = _getStorage_OperatorAuth(msgSender, operator, verifier, legacy); - bool afterOperatorAllowedGetter = staking.isAuthorized(operator, msgSender, verifier); + bool afterOperatorAllowedGetter = staking.isAuthorized(msgSender, operator, verifier); assertEq(afterOperatorAllowed, afterOperatorAllowedGetter); // assert @@ -1487,8 +1487,8 @@ abstract contract HorizonStakingSharedTest is GraphBaseTest { ); bool isAuth = staking.isAuthorized( - msgSender, beforeValues.allocation.indexer, + msgSender, subgraphDataServiceLegacyAddress ); address rewardsDestination = _getStorage_RewardsDestination(beforeValues.allocation.indexer);