Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaryash90 committed May 13, 2024
1 parent bec2118 commit 5345ca4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion contracts/extension/interface/IClaimConditionMultiPhase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ interface IClaimConditionMultiPhase is IClaimCondition {
* @param count The total number of phases / claim conditions in the list
* of claim conditions.
*
* @param conditionHash Mapping from numeric claim condition ID to a unique hash.
* Used in supplyClaimedByWallet mapping below.
*
* @param conditions The claim conditions at a given uid. Claim conditions
* are ordered in an ascending order by their `startTimestamp`.
*
* @param supplyClaimedByWallet Map from a claim condition uid and account to supply claimed by account.
* @param supplyClaimedByWallet Map from a claim condition uid/hash and account to supply claimed by account.
*/
struct ClaimConditionList {
uint256 currentStartId;
Expand Down
2 changes: 2 additions & 0 deletions src/test/sdk/extension/drop/verify-claim/verifyClaim.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ contract MyDrop is Drop {

function setCondition(ClaimCondition calldata condition, uint256 _conditionId) public {
claimCondition.conditions[_conditionId] = condition;
claimCondition.conditionHash[_conditionId] = keccak256(abi.encodePacked(_conditionId, block.number));
}

function setSupplyClaimedByWallet(uint256 _conditionId, address _wallet, uint256 _supplyClaimed) public {
Expand Down Expand Up @@ -407,6 +408,7 @@ contract Drop_VerifyClaim is ExtensionUtilTest {
_currency = address(weth);
_pricePerToken = 2;
_quantity = 1;

vm.expectRevert(
abi.encodeWithSelector(
Drop.DropClaimExceedLimit.selector,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ contract MyDropUpg is Drop {

function setCondition(ClaimCondition calldata condition, uint256 _conditionId) public {
_dropStorage().claimCondition.conditions[_conditionId] = condition;
_dropStorage().claimCondition.conditionHash[_conditionId] = keccak256(
abi.encodePacked(_conditionId, block.number)
);
}

function setSupplyClaimedByWallet(uint256 _conditionId, address _wallet, uint256 _supplyClaimed) public {
Expand Down

0 comments on commit 5345ca4

Please sign in to comment.