Skip to content

Commit

Permalink
test: include asset transfer log in merkle instant claims
Browse files Browse the repository at this point in the history
  • Loading branch information
smol-ninja committed Aug 2, 2024
1 parent 7df7417 commit 1bff793
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/periphery/fork/merkle/MerkleInstant.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ abstract contract MerkleInstant_Fork_Test is Fork_Test {
vars.merkleProof = getProof(leaves.toBytes32(), vars.leafPos);
}

expectCallToTransfer({
asset: FORK_ASSET,
to: vars.recipients[params.posBeforeSort],
value: vars.amounts[params.posBeforeSort]
});

vars.merkleInstant.claim({
index: vars.indexes[params.posBeforeSort],
recipient: vars.recipients[params.posBeforeSort],
Expand Down
2 changes: 2 additions & 0 deletions test/periphery/integration/merkle/instant/claim/claim.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ contract Claim_Integration_Test is Merkle_Shared_Integration_Test {
vm.expectEmit({ emitter: address(merkleInstant) });
emit Claim(defaults.INDEX1(), users.recipient1, defaults.CLAIM_AMOUNT());

expectCallToTransfer({ to: users.recipient1, value: defaults.CLAIM_AMOUNT() });

claimInstant();

assertTrue(merkleInstant.hasClaimed(defaults.INDEX1()), "not claimed");
Expand Down
1 change: 1 addition & 0 deletions test/periphery/integration/merkle/instant/claim/claim.tree
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ claim.t.sol
│ └── it should revert
└── given the claim is included in the Merkle tree
├── it should mark the index as claimed
├── it should transfer the claim amount to the recipient
└── it should emit a {Claim} event

0 comments on commit 1bff793

Please sign in to comment.