From 731dc92083f8c8e705050f9da8d8d9be649e7465 Mon Sep 17 00:00:00 2001 From: Uladzislau Hubar Date: Wed, 17 Apr 2024 15:37:32 +0200 Subject: [PATCH] Removed revert for past effectiveDate lookup --- contracts/v2/storage/NodeOperatorFeesStorage.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contracts/v2/storage/NodeOperatorFeesStorage.sol b/contracts/v2/storage/NodeOperatorFeesStorage.sol index 7df260f7..9a9326fa 100644 --- a/contracts/v2/storage/NodeOperatorFeesStorage.sol +++ b/contracts/v2/storage/NodeOperatorFeesStorage.sol @@ -239,8 +239,7 @@ contract NodeOperatorFeesStorage is Named, Versioned, HubDependent { } else { for (uint i; i < operatorFees[identityId].length; ) { if (operatorFees[identityId][i].effectiveDate > timestamp) { - if (i == 0) revert("No previous fee applicable"); - return operatorFees[identityId][i - 1]; + return i == 0 ? operatorFees[identityId][0] : operatorFees[identityId][i - 1]; } unchecked {