Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivaanshK committed Jul 7, 2024
1 parent a478815 commit 7234ab1
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.26;

import { console2 } from "forge-std/src/console2.sol";
import { stdMath } from "forge-std/src/Test.sol";
import { NexusTestBase } from "../../base/NexusTestBase.sol";
import { IBiconomySponsorshipPaymaster } from "../../../../contracts/interfaces/IBiconomySponsorshipPaymaster.sol";
import { BiconomySponsorshipPaymaster } from "../../../../contracts/sponsorship/SponsorshipPaymasterWithPremium.sol";
Expand Down Expand Up @@ -152,14 +150,10 @@ contract TestFuzz_SponsorshipPaymasterWithPremium is NexusTestBase {
uint256 resultingFeeCollectorPaymasterBalance = bicoPaymaster.getBalance(PAYMASTER_FEE_COLLECTOR.addr);

uint256 totalGasFeesCharged = initialDappPaymasterBalance - resultingDappPaymasterBalance;
uint256 premiumCollected = resultingFeeCollectorPaymasterBalance - initialFeeCollectorBalance;

uint256 expectedPremium = totalGasFeesCharged - (totalGasFeesCharged * 1e6) / premium;
uint256 premiumCollected = resultingFeeCollectorPaymasterBalance - initialFeeCollectorBalance;
uint256 expectedPremium = totalGasFeesCharged - ((totalGasFeesCharged * 1e6) / premium);

console2.log(premiumCollected);
console2.log(expectedPremium);
console2.log(stdMath.percentDelta(premiumCollected, expectedPremium));
// less than 0.01% difference between actual and expected values
assert(stdMath.percentDelta(premiumCollected, expectedPremium) < 1e14);
assertEq(premiumCollected, expectedPremium);
}
}

0 comments on commit 7234ab1

Please sign in to comment.