Skip to content

Commit

Permalink
test: verify getCreditReturnedForDollars and
Browse files Browse the repository at this point in the history
getCreditNftReturnedForDollars

Resolves: ubiquity#838
  • Loading branch information
gitcoindev committed Dec 22, 2023
1 parent f6bd4c9 commit b9d7d86
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,12 @@ contract CreditNftManagerFacetTest is DiamondTestSetup {

dollarToken.approve(creditNftManagerAddress, 10000e18);

uint256 amountCreditNftToMint = creditNftManagerFacet
.getCreditNftReturnedForDollars(100);
uint256 expiryBlockNumber = creditNftManagerFacet
.exchangeDollarsForCreditNft(100);
assertEq(expiryBlockNumber, 10000 + creditNftLengthBlocks);
assertEq(amountCreditNftToMint, 100);
}

function test_exchangeDollarsForCreditRevertsIfPriceHigherThan1Ether()
Expand All @@ -140,6 +143,11 @@ contract CreditNftManagerFacetTest is DiamondTestSetup {
100
);
assertEq(creditAmount, 100);

vm.roll(10000);
uint256 amountCreditToMint = creditNftManagerFacet
.getCreditReturnedForDollars(100);
assertEq(amountCreditToMint, 100);
}

function test_burnExpiredCreditNftForGovernanceRevertsIfNotExpired()
Expand Down

0 comments on commit b9d7d86

Please sign in to comment.