Skip to content

Commit

Permalink
contracts-bedrock: refactor testFuzz_executeMessage_succeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfuturistic committed Mar 22, 2024
1 parent dc55143 commit 1693066
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/contracts-bedrock/test/L2/CrossL2Inbox.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ contract CrossL2InboxTest is CommonTest {
function testFuzz_executeMessage_succeeds(
bytes calldata _msg,
ICrossL2Inbox.Identifier calldata _id,
address _target
address _target,
uint256 _value
)
external
payable
Expand All @@ -46,10 +47,12 @@ contract CrossL2InboxTest is CommonTest {
// need to prevent underlying SafeCall to target from reverting
vm.etch(_target, address(0).code);

vm.deal(tx.origin, _value);

// executeMessage
vm.prank(tx.origin);
vm.expectCall(_target, _msg);
crossL2Inbox.executeMessage{ value: msg.value }(_id, _target, _msg);
vm.expectCall(_target, _value, _msg);
crossL2Inbox.executeMessage{ value: _value }(_id, _target, _msg);

assertEq(crossL2Inbox.origin(), _id.origin);
assertEq(crossL2Inbox.blocknumber(), _id.blocknumber);
Expand Down

0 comments on commit 1693066

Please sign in to comment.