Skip to content

Commit

Permalink
(test/hub): improve hub transfer test too with relative equality
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminbollen committed Mar 28, 2024
1 parent 53b2741 commit fb5f449
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

# v0.3.1

- [PR 123] fix: `personalMint` should not revert if issuance is zero;
add `calculateIssuanceWithCheck` to know issuance without minting (while possibly updating v1 mint status);
add testing for simple migration and invitation flows
- [PR 123]
- fix: `personalMint` should not revert if issuance is zero;
- add `calculateIssuanceWithCheck` to know issuance without minting (while possibly updating v1 mint status);
- add testing for simple migration and invitation flows
- improve test for Circles issuance, add test for consecutive periods in personal mint

## v0.3.0

Expand Down
8 changes: 5 additions & 3 deletions test/hub/PathTransferHub.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ pragma solidity >=0.8.13;
import {Test} from "forge-std/Test.sol";
import {StdCheats} from "forge-std/StdCheats.sol";
import "forge-std/console.sol";
import "../../src/hub/Hub.sol";
import "../setup/TimeCirclesSetup.sol";
import "../setup/HumanRegistration.sol";
import "../utils/Approximation.sol";
import "./MockPathTransferHub.sol";
import "../../src/hub/Hub.sol";

contract HubPathTransferTest is Test, TimeCirclesSetup, HumanRegistration {
contract HubPathTransferTest is Test, TimeCirclesSetup, HumanRegistration, Approximation {
// State variables

MockPathTransferHub public mockHub;
Expand Down Expand Up @@ -37,7 +38,8 @@ contract HubPathTransferTest is Test, TimeCirclesSetup, HumanRegistration {
for (uint256 i = 0; i < N; i++) {
vm.prank(addresses[i]);
mockHub.personalMintWithoutV1Check();
assertEq(mockHub.balanceOf(addresses[i], mockHub.toTokenId(addresses[i])), 47985696851874424310);
uint256 balance = mockHub.balanceOf(addresses[i], mockHub.toTokenId(addresses[i]));
assertTrue(relativeApproximatelyEqual(balance, 48 * CRC, ONE_PERCENT));
}

// get this value first to avoid using `startPrank` over inline calls
Expand Down

0 comments on commit fb5f449

Please sign in to comment.