Skip to content

Commit

Permalink
Update KaliBerger.t.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
audsssy committed Oct 30, 2023
1 parent 5f87bff commit 788f076
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions test/KaliBerger.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,17 @@ contract KaliBergerTest is Test {
function testMultipleBuy() public payable {
// Escrow & approve
testApprove();

// Darius buys.
primaryBuy(darius, address(token_1), 1, 1 ether, alfred);
primaryBuy(darius, address(token_2), 1, 1 ether, bob);
primaryBuy(darius, address(token_3), 1, 1 ether, charlie);
}

/// @notice Darius buys all tokens and declares new prices for each
function testMultipleBuy_() public payable {
// Escrow & approve
testApprove();
vm.warp(3000);

// Deal Darius ether
Expand Down Expand Up @@ -729,11 +740,9 @@ contract KaliBergerTest is Test {
/// @notice Earn tries to withdraw token_1, tokenId #1 on behalf of Alfred,
/// @notice but triggers NotAuthorized() error because Alfred is the creator of NFT.
function testSingleBuy_pull_notAuthorized() public payable {
uint256 timestamp = 10000000;
// Continuing from third buy by Earn.
testSingleBuy_thirdBuy();
vm.warp(timestamp);
// emit log_uint(timestamp);
vm.warp(block.timestamp + 10000000);

// Earn withdraws but errors out.
vm.expectRevert(KaliBerger.NotAuthorized.selector);
Expand All @@ -744,8 +753,8 @@ contract KaliBergerTest is Test {
assertEq(token_1.balanceOf(alfred), 0);
assertEq(token_1.balanceOf(earn), 0);
assertEq(token_1.balanceOf(address(kaliBerger)), 1);
balanceDao(timestamp, address(token_1), 1, alfred);
} // timestamp: 10000000
balanceDao(block.timestamp + 10000, address(token_1), 1, alfred);
}

function testReceiveETH() public payable {
(bool sent,) = address(kaliBerger).call{value: 5 ether}("");
Expand Down

0 comments on commit 788f076

Please sign in to comment.