More cleanup and notes

This commit is contained in:
Aadi Desai 2023-02-21 11:38:07 +00:00
parent 7e4356494b
commit 3afe735333
No known key found for this signature in database
GPG key ID: CFFFE425830EF4D9
2 changed files with 4 additions and 3 deletions

View file

@ -4,3 +4,5 @@ This is the skeleton for the coursework of the Principle of Distributed Ledgers
It contains [the interfaces](./src/interfaces) of the contracts to implement and an [ERC20 implementation](./src/contracts/PurchaseToken.sol). It contains [the interfaces](./src/interfaces) of the contracts to implement and an [ERC20 implementation](./src/contracts/PurchaseToken.sol).
The repository uses [Foundry](https://book.getfoundry.sh/projects/working-on-an-existing-project). The repository uses [Foundry](https://book.getfoundry.sh/projects/working-on-an-existing-project).
Coverage generated using `forge coverage --report lcov && genhtml lcov.info -o coverage --branch-coverage --function-coverage --legend --title "TicketNFT Coverage"`

View file

@ -50,7 +50,7 @@ contract BaseTicketNFTTest is Test {
nft = new TicketNFT(token); nft = new TicketNFT(token);
} }
// Add Purchase Tokens to `recipient` to affort `amount` tickets // Add Purchase Tokens to `recipient` to afford `amount` tickets
function _topUpTokens(address recipient, uint256 amount) internal { function _topUpTokens(address recipient, uint256 amount) internal {
vm.deal(recipient, amount * ticketPriceEth); vm.deal(recipient, amount * ticketPriceEth);
vm.prank(recipient); vm.prank(recipient);
@ -135,7 +135,7 @@ contract TicketNFTTest is BaseTicketNFTTest {
"transferFrom: msg.sender must be current holder or approved sender" "transferFrom: msg.sender must be current holder or approved sender"
); );
nft.transferFrom(alice, bob, 1); nft.transferFrom(alice, bob, 1);
} // TODO: unnecessary? }
function testApproval() public { function testApproval() public {
_buyTicket(alice, "alice"); _buyTicket(alice, "alice");
@ -335,7 +335,6 @@ contract PrimaryMarketTest is BaseTicketNFTTest {
} }
} }
// Use vm.warp to jump forward when testing expired tickets
contract SecondaryMarketTest is BaseTicketNFTTest { contract SecondaryMarketTest is BaseTicketNFTTest {
function testList() public { function testList() public {
_buyTicket(alice, "alice"); _buyTicket(alice, "alice");