From 1bff79368a1e134c4d22d23262895c4a5228ae6a Mon Sep 17 00:00:00 2001 From: smol-ninja Date: Fri, 2 Aug 2024 08:47:16 +0100 Subject: [PATCH] test: include asset transfer log in merkle instant claims --- test/periphery/fork/merkle/MerkleInstant.t.sol | 6 ++++++ test/periphery/integration/merkle/instant/claim/claim.t.sol | 2 ++ test/periphery/integration/merkle/instant/claim/claim.tree | 1 + 3 files changed, 9 insertions(+) diff --git a/test/periphery/fork/merkle/MerkleInstant.t.sol b/test/periphery/fork/merkle/MerkleInstant.t.sol index 1de14fa38..f899935e6 100644 --- a/test/periphery/fork/merkle/MerkleInstant.t.sol +++ b/test/periphery/fork/merkle/MerkleInstant.t.sol @@ -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], diff --git a/test/periphery/integration/merkle/instant/claim/claim.t.sol b/test/periphery/integration/merkle/instant/claim/claim.t.sol index 38d718ab7..663f5da23 100644 --- a/test/periphery/integration/merkle/instant/claim/claim.t.sol +++ b/test/periphery/integration/merkle/instant/claim/claim.t.sol @@ -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"); diff --git a/test/periphery/integration/merkle/instant/claim/claim.tree b/test/periphery/integration/merkle/instant/claim/claim.tree index b77acb9f2..4085d6cc5 100644 --- a/test/periphery/integration/merkle/instant/claim/claim.tree +++ b/test/periphery/integration/merkle/instant/claim/claim.tree @@ -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