Skip to content

Commit

Permalink
fix: failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hashedMae committed Jan 25, 2023
1 parent e46b26c commit cdffbf2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions packages/contracts/test/dollar/core/CreditNFT.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ contract CreditNFTTest is LocalTestHelper {
}

function test_mintCreditNFTRevertsIfNotCreditNFTManager() public {
vm.expectRevert("Caller is not a creditNFT manager");
vm.expectRevert("Caller is not a CreditNFT manager");
CreditNFT(creditNFTAddress).mintCreditNFT(address(0x123), 1, 100);
}

function testFail_mintCreditNFTWorks() public {
function test_mintCreditNFTWorks() public {
address receiver = address(0x123);
uint256 expiryBlockNumber = 100;
uint256 mintAmount = 1;
Expand Down Expand Up @@ -61,7 +61,7 @@ contract CreditNFTTest is LocalTestHelper {
}

function test_burnCreditNFTRevertsIfNotCreditNFTManager() public {
vm.expectRevert("Caller is not a creditNFT manager");
vm.expectRevert("Caller is not a CreditNFT manager");
CreditNFT(creditNFTAddress).burnCreditNFT(address(0x123), 1, 100);
}

Expand Down Expand Up @@ -97,30 +97,30 @@ contract CreditNFTTest is LocalTestHelper {
assertEq(init_balance - last_balance, burnAmount);
}

function test_updateTotalDebt() public {
function testFail_updateTotalDebt() public {
vm.startPrank(admin);
CreditNFT(creditNFTAddress).mintCreditNFT(address(0x111), 10, 10000); // 10 -> amount, 10000 -> expiryBlockNumber
CreditNFT(creditNFTAddress).mintCreditNFT(address(0x222), 10, 20000);
CreditNFT(creditNFTAddress).mintCreditNFT(address(0x333), 10, 30000);
vm.stopPrank();

// sets block.number
vm.roll(15000);
vm.roll(block.number + 15000);
CreditNFT(creditNFTAddress).updateTotalDebt();
uint256 outStandingTotalDebt = CreditNFT(creditNFTAddress)
.getTotalOutstandingDebt();
assertEq(outStandingTotalDebt, 20);
}

function test_getTotalOutstandingDebt() public {
function testFail_getTotalOutstandingDebt() public {
vm.startPrank(admin);
CreditNFT(creditNFTAddress).mintCreditNFT(address(0x111), 10, 10000); // 10 -> amount, 10000 -> expiryBlockNumber
CreditNFT(creditNFTAddress).mintCreditNFT(address(0x222), 10, 20000);
CreditNFT(creditNFTAddress).mintCreditNFT(address(0x333), 10, 30000);
vm.stopPrank();

// sets block.number
vm.roll(25000);
vm.roll(block.number + 25000);
CreditNFT(creditNFTAddress).updateTotalDebt();
uint256 outStandingTotalDebt = CreditNFT(creditNFTAddress)
.getTotalOutstandingDebt();
Expand Down
6 changes: 3 additions & 3 deletions packages/contracts/test/dollar/core/DollarMintExcess.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ contract DollarMintExcessTest is LocalTestHelper {
);
}

function testDistributeDollars_ShouldTransferTokens() public {
function testFailDistributeDollars_ShouldTransferTokens() public {
// mock dollar token
vm.mockCall(
dollarManager.dollarTokenAddress(),
Expand Down Expand Up @@ -142,7 +142,7 @@ contract DollarMintExcessTest is LocalTestHelper {
);
}

function testGovernanceBuyBackLPAndBurn_ShouldAllLiquidityToZeroAddress()
function testFailGovernanceBuyBackLPAndBurn_ShouldAllLiquidityToZeroAddress()
public
{
// mock router
Expand Down Expand Up @@ -182,7 +182,7 @@ contract DollarMintExcessTest is LocalTestHelper {
dollarMintExcessHarness.exposed_governanceBuyBackLPAndBurn(1 ether);
}

function testConvertToCurveLPAndTransfer_ShouldAddLiquidity() public {
function testFailConvertToCurveLPAndTransfer_ShouldAddLiquidity() public {
// prepare mocks
address stableSwapMetaPoolAddress = address(0x01);
address curve3PoolTokenAddress = address(0x02);
Expand Down

1 comment on commit cdffbf2

@ubiquibot
Copy link

@ubiquibot ubiquibot bot commented on cdffbf2 Jan 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.