Skip to content

Commit

Permalink
Fixed pending operator fee migration
Browse files Browse the repository at this point in the history
  • Loading branch information
u-hubar committed Apr 17, 2024
1 parent 1cc4607 commit 3e99180
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 8 additions & 2 deletions deploy/017_deploy_node_operator_fees_storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
});
}

// TODO: Check the timestamp so that it's not smaller than current
const pendingOperatorFee = await nofcs.operatorFeeChangeRequests(i);

if (pendingOperatorFee) {
operatorFees.push(pendingOperatorFee);
if (pendingOperatorFee.timestamp < operatorFees[0].effectiveDate) {
operatorFees[0].effectiveDate = pendingOperatorFee.timestamp - 1;
}

operatorFees.push({
feePercentage: pendingOperatorFee.newFee,
effectiveDate: pendingOperatorFee.timestamp,
});
}

if (operatorFees.length > 0) {
Expand Down
1 change: 0 additions & 1 deletion test/v2/unit/NodeOperatorFeesStorage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ describe('@v2 @unit NodeOperatorFeesStorage contract', function () {
}
}

// TODO: Perhaps makes sense to implement the same logic as in the deployment script to automatically get legacy fees
const operatorFees = [
{ identityId: identityIds[0], fees: [{ feePercentage: 1, effectiveDate: BigNumber.from(latestBlockTimestamp) }] },
{
Expand Down

0 comments on commit 3e99180

Please sign in to comment.