Skip to content

Commit

Permalink
fix(test): update test from merge
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMustermann2 committed Sep 2, 2024
1 parent 34dda77 commit 01f1493
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions test/foundry/unit/ClientChainGateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,24 @@ contract WithdrawalPrincipalFromExocore is SetUp {
tokens[1] = bytes32(bytes20(address(restakeToken)));

// Simulate adding VIRTUAL_STAKED_ETH_ADDRESS to whitelist via lzReceive
bytes memory message =
abi.encodePacked(GatewayStorage.Action.REQUEST_ADD_WHITELIST_TOKENS, uint8(tokens.length), tokens);
Origin memory origin = Origin({srcEid: exocoreChainId, sender: address(exocoreGateway).toBytes32(), nonce: 1});
bytes memory message = abi.encodePacked(
GatewayStorage.Action.REQUEST_ADD_WHITELIST_TOKEN,
abi.encodePacked(tokens[0])
);
Origin memory origin = Origin({
srcEid: exocoreChainId, sender: address(exocoreGateway).toBytes32(), nonce: 1
});

vm.prank(address(clientChainLzEndpoint));
clientGateway.lzReceive(origin, bytes32(0), message, address(0), bytes(""));
// assert that VIRTUAL_STAKED_ETH_ADDRESS and restake token is whitelisted
assertTrue(clientGateway.isWhitelistedToken(VIRTUAL_STAKED_ETH_ADDRESS));
origin.nonce = 2;
message = abi.encodePacked(
GatewayStorage.Action.REQUEST_ADD_WHITELIST_TOKEN, abi.encodePacked(tokens[1])
);
vm.prank(address(clientChainLzEndpoint));
clientGateway.lzReceive(origin, bytes32(0), message, address(0), bytes(""));
assertTrue(clientGateway.isWhitelistedToken(address(restakeToken)));
}

Expand Down

0 comments on commit 01f1493

Please sign in to comment.