Skip to content

Commit

Permalink
mark checked
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaryash90 committed Oct 16, 2023
1 parent 96e577f commit 36795ff
Show file tree
Hide file tree
Showing 43 changed files with 251 additions and 251 deletions.
36 changes: 18 additions & 18 deletions src/test/burn-to-claim-drop-BTT/logic/lazy-mint/lazyMint.tree
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@ lazyMint(
)
// Assume `_data` empty
├── when caller not authorized
│ └── it should revert
│ └── it should revert
└── when caller is authorized
└── when amount to lazy mint is 0
│ └── it should revert
│ └── it should revert
└── when amount to lazy mint is not 0
└── it should save the batch of tokens starting at `nextTokenIdToLazyMint`
└── it should store batch id equal to the sum of `nextTokenIdToLazyMint` and `_amount`
└── it should map the new batch id to `_baseURIForTokens`
└── it should increase `nextTokenIdToLazyMint` by `_amount`
└── it should return the new `batchId`
└── it should emit TokensLazyMinted event
└── it should save the batch of tokens starting at `nextTokenIdToLazyMint`
└── it should store batch id equal to the sum of `nextTokenIdToLazyMint` and `_amount`
└── it should map the new batch id to `_baseURIForTokens`
└── it should increase `nextTokenIdToLazyMint` by `_amount`
└── it should return the new `batchId`
└── it should emit TokensLazyMinted event

// Assume `_data` not empty
├── when caller not authorized
│ └── it should revert
│ └── it should revert
└── when caller is authorized
└── when amount to lazy mint is 0
│ └── it should revert
│ └── it should revert
└── when amount to lazy mint is not 0
└── when data can't be decoded
│ └── it should revert
│ └── it should revert
└── when data can be decoded successfully
└── when decoded encryptedURI and provenanceHash are non-empty
└── it should set encrypted data for the new batch equal to _data
└── it should save the batch of tokens starting at `nextTokenIdToLazyMint`
└── it should store batch id equal to the sum of `nextTokenIdToLazyMint` and `_amount`
└── it should map the new batch id to `_baseURIForTokens`
└── it should increase `nextTokenIdToLazyMint` by `_amount`
└── it should return the new `batchId`
└── it should emit TokensLazyMinted event
└── it should set encrypted data for the new batch equal to _data
└── it should save the batch of tokens starting at `nextTokenIdToLazyMint`
└── it should store batch id equal to the sum of `nextTokenIdToLazyMint` and `_amount`
└── it should map the new batch id to `_baseURIForTokens`
└── it should increase `nextTokenIdToLazyMint` by `_amount`
└── it should return the new `batchId`
└── it should emit TokensLazyMinted event

54 changes: 27 additions & 27 deletions src/test/burn-to-claim-drop-BTT/router/initialize/initialize.tree
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,34 @@ initialize(
address _platformFeeRecipient
)
├── when it is the implementation contract (not proxy)
│ └── it should revert
│ └── it should revert
└── when it is a proxy to the implementation
└── when it is already initialized
│ └── it should revert
│ └── it should revert
└── when it is not initialized
└── it should initialize base-router with default extensions if any
└── it should set trustedForwarder mapping to true for all addresses in `_trustedForwarders`
└── it should set _name and _symbol to `_name` and `_symbol` param values respectively
└── it should set contractURI to `_contractURI` param value
└── it should emit ContractURIUpdated event
└── it should set _owner to `_defaultAdmin` param value
└── it should emit OwnerUpdated event
└── it should grant 0x00 (DEFAULT_ADMIN_ROLE) to `_defaultAdmin` address
└── it should emit RoleGranted event
└── it should grant MINTER_ROLE to `_defaultAdmin` address
└── it should emit RoleGranted event
└── it should grant TRANSFER_ROLE to `_defaultAdmin` address
└── it should emit RoleGranted event
└── it should grant TRANSFER_ROLE to address(0)
└── it should emit RoleGranted event
└── it should grant EXTENSION_ROLE to `_defaultAdmin` address
└── it should emit RoleGranted event
└── it should set EXTENSION_ROLE as role admin for EXTENSION_ROLE
└── it should emit RoleAdminChanged event
└── it should set platformFeeRecipient and platformFeeBps as `_platformFeeRecipient` and `_platformFeeBps` respectively
└── it should emit PlatformFeeInfoUpdated event
└── it should set royaltyRecipient and royaltyBps as `_royaltyRecipient` and `_royaltyBps` respectively
└── it should emit DefaultRoyalty event
└── it should set primary sale recipient as `_saleRecipient` param value
└── it should emit PrimarySaleRecipientUpdated event
└── it should initialize base-router with default extensions if any
└── it should set trustedForwarder mapping to true for all addresses in `_trustedForwarders`
└── it should set _name and _symbol to `_name` and `_symbol` param values respectively
└── it should set contractURI to `_contractURI` param value
└── it should emit ContractURIUpdated event
└── it should set _owner to `_defaultAdmin` param value
└── it should emit OwnerUpdated event
└── it should grant 0x00 (DEFAULT_ADMIN_ROLE) to `_defaultAdmin` address
└── it should emit RoleGranted event
└── it should grant MINTER_ROLE to `_defaultAdmin` address
└── it should emit RoleGranted event
└── it should grant TRANSFER_ROLE to `_defaultAdmin` address
└── it should emit RoleGranted event
└── it should grant TRANSFER_ROLE to address(0)
└── it should emit RoleGranted event
└── it should grant EXTENSION_ROLE to `_defaultAdmin` address
└── it should emit RoleGranted event
└── it should set EXTENSION_ROLE as role admin for EXTENSION_ROLE
└── it should emit RoleAdminChanged event
└── it should set platformFeeRecipient and platformFeeBps as `_platformFeeRecipient` and `_platformFeeBps` respectively
└── it should emit PlatformFeeInfoUpdated event
└── it should set royaltyRecipient and royaltyBps as `_royaltyRecipient` and `_royaltyBps` respectively
└── it should emit DefaultRoyalty event
└── it should set primary sale recipient as `_saleRecipient` param value
└── it should emit PrimarySaleRecipientUpdated event

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
contractType()
├── it should return bytes32("BurnToClaimDropERC721")
├── it should return bytes32("BurnToClaimDropERC721")

contractVersion()
├── it should return uint8(5)
├── it should return uint8(5)

_isAuthorizedCallToUpgrade()
├── when the caller doesn't have EXTENSION_ROLE
│ └── it should revert
│ └── it should revert
└── when the caller has EXTENSION_ROLE
└── it should return true
└── it should return true

Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ _batchMintMetadata(
uint256 _amountToMint,
string memory _baseURIForTokens
)
├── it should store batch id equal to the sum of `_startId` and `_amountToMint` in batchIds array
├── it should map the new batch id to `_baseURIForTokens`
├── it should store batch id equal to the sum of `_startId` and `_amountToMint` in batchIds array
├── it should map the new batch id to `_baseURIForTokens`
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
_freezeBaseURI(uint256 _batchId)
├── when there is no baseURI for given `_batchId`
│ └── it should revert
│ └── it should revert
└── when there is a baseURI present for given `_batchId`
└── it should freeze the `batchId` by setting `frozen[_batchId]` to `true`
└── it should emit MetadataFrozen event
└── it should freeze the `batchId` by setting `frozen[_batchId]` to `true`
└── it should emit MetadataFrozen event
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
_getBaseURI(uint256 _tokenId)
├── when `_tokenId` doesn't belong to any batch, i.e. greater than the last batchId
│ └── it should revert
│ └── it should revert
└── when `_tokenId` belongs to some batch, i.e. less than that batchId
└── it should return correct baseURI for the `_tokenId`
└── it should return correct baseURI for the `_tokenId`
(note: all batches are assumed to be contiguous, i.e. start id of one batch is the end id of the previous batch)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
_getBatchId(uint256 _tokenId)
├── when `_tokenId` doesn't belong to any batch, i.e. greater than the last batchId
│ └── it should revert
│ └── it should revert
└── when `_tokenId` belongs to some batch, i.e. less than that batchId
└── it should return correct batchId and batch index for the `_tokenId`
└── it should return correct batchId and batch index for the `_tokenId`
(note: all batches are assumed to be contiguous, i.e. start id of one batch is the end id of the previous batch)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
_getBatchStartId(uint256 _batchID)
├── when `_batchID` doesn't exist
│ └── it should revert
│ └── it should revert
└── when `_batchID` exists
└── it should return the starting tokenId for that batch
└── it should return the starting tokenId for that batch
(note: all batches are assumed to be contiguous, i.e. start id of one batch is the end id of the previous batch)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
_setBaseURI(uint256 _batchId, string memory _baseURI)
├── when the `_batchId` is frozen
│ └── it should revert
│ └── it should revert
└── when the `_batchId` is not frozen
└── it should map the `_batchId` to `_baseURI` param
└── it should emit BatchMetadataUpdate event
└── it should map the `_batchId` to `_baseURI` param
└── it should emit BatchMetadataUpdate event
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ _burnTokensOnOrigin(
uint256 _quantity
)
├── when burn-to-claim info has token type ERC721
├── when the origin ERC721 contract is not burnable
│ └── it should revert
├── when the origin ERC721 contract is not burnable
│ └── it should revert
└── when the origin ERC721 contract is burnable
└── it should successfully burn the token with given tokenId for the token owner
└── it should successfully burn the token with given tokenId for the token owner
├── when burn-to-claim info has token type ERC1155
├── when the origin ERC1155 contract is not burnable
│ └── it should revert
│ └── it should revert
└── when the origin ERC1155 contract is burnable
└── it should successfully burn tokens with given tokenId and quantity for the token owner
└── it should successfully burn tokens with given tokenId and quantity for the token owner
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
setBurnToClaimInfo(BurnToClaimInfo calldata _burnToClaimInfo)
├── when caller not authorized
│ └── it should revert
│ └── it should revert
└── when caller is authorized
├── when input originContractAddress is address(0)
│ └── it should revert
│ └── it should revert
└── when input originContractAddress is not address(0)
├── when input currency is address(0)
│ └── it should revert
│ └── it should revert
└── when input currency is not address(0)
└── it should save incoming struct values into burnToClaimInfo state
└── it should save incoming struct values into burnToClaimInfo state
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ verifyBurnToClaim(
uint256 quantity
)
├── when burn-to-claim info is not set
│ └── it should revert
│ └── it should revert
└── when burn-to-claim info is set, with token type ERC721
│ ├── when quantity param is not 1
│ │ └── it should revert
│ │ └── it should revert
│ └── when quantity param is 1
│ ├── when token owner param is not the actual token owner
│ │ └── it should revert
│ │ └── it should revert
│ └── when token owner param is the correct token owner
│ │ └── execution completes -- exit function
│ │ └── execution completes -- exit function
└── when burn-to-claim info is set, with token type ERC1155
├── when tokenId param doesn't match eligible tokenId
│ └── it should revert
│ └── it should revert
└── when tokenId param matches eligible tokenId
├── when token owner has balance less than quantity param
│ └── it should revert
│ └── it should revert
└── when token owner has balance greater than or equal to quantity param
└── execution completes -- exit function
└── execution completes -- exit function
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
setContractURI(string memory uri)
├── when caller not authorized
│ └── it should revert
│ └── it should revert
└── when caller is authorized
└── it should update contract URI to the new URI value
└── it should emit ContractURIUpdated event
└── it should update contract URI to the new URI value
└── it should emit ContractURIUpdated event
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
getRevealURI(uint256 _batchId, bytes calldata _key)
├── when there is no encrypted data set for the given batch id
│ └── it should revert
│ └── it should revert
└── when there is an associated encrypted data present for the given batch id
├── when the encryption key provided is incorrect
│ └── it should revert
│ └── it should revert
└── when the encryption key provided is correct
└── it should correctly decrypt and return the original URI
└── it should correctly decrypt and return the original URI
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
_setEncryptedData(uint256 _batchId, bytes memory _encryptedData)
├── it should store input bytes data for the given batch id param
├── isEncryptedBatch should return true for this batch id
├── it should store input bytes data for the given batch id param
├── isEncryptedBatch should return true for this batch id
6 changes: 3 additions & 3 deletions src/test/sdk/extension/drop/claim/claim.tree
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ claim(
bytes memory _data
)
├── when no active condition
│ └── it should revert
│ └── it should revert
└── when there's an active condition
└── it should increase the supplyClaimed for that condition by quantity param input
└── it should increase the supplyClaimedByWallet for that condition and msg.sender by quantity param input
└── it should increase the supplyClaimed for that condition by quantity param input
└── it should increase the supplyClaimedByWallet for that condition and msg.sender by quantity param input

(Note: verifyClaim function has been tested separately, and hence not being tested here)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
getActiveClaimConditionId()
├── when no conditions are set
│ └── it should revert
│ └── it should revert
└── when condition(s) are set
├── when no active condition, i.e. start timestamps of all conditions greater than block timestamp
│ └── it should revert
│ └── it should revert
└── when conditions active, i.e. start timestamps at least one condition is less than or equal to the block timestamp
└── it should return the latest active claim condition id (i.e. with highest start timestamp among those active)
└── it should return the latest active claim condition id (i.e. with highest start timestamp among those active)
Loading

0 comments on commit 36795ff

Please sign in to comment.