Skip to content

Commit

Permalink
Fix test case for delegate call
Browse files Browse the repository at this point in the history
Signed-off-by: Manank Patni <manank321@gmail.com>
  • Loading branch information
Man-Jain committed Dec 15, 2024
1 parent 54f4e19 commit 23994ac
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ contract TestAccountExecution_ExecuteFromExecutor is TestAccountExecution_Base {
ENTRYPOINT.handleOps(userOpsExec, payable(address(BOB.addr)));
assertEq(counter.getNumber(), 1, "Counter should have incremented");
}
/// @notice Tests delegate call execution via MockExecutor

/// @notice Tests delegate call execution via MockExecutor
// Review
function test_ExecuteDelegateCallFromExecutor_Success() public {

Expand All @@ -61,11 +61,13 @@ contract TestAccountExecution_ExecuteFromExecutor is TestAccountExecution_Base {

address valueTarget = makeAddr("valueTarget");
uint256 value = 1 ether;
bytes memory sendValueCallData =
abi.encodeWithSelector(MockDelegateTarget.sendValue.selector, valueTarget, value);
bytes memory sendValueCallData = abi.encodePacked(
address(delegateTarget),
abi.encodeWithSelector(MockDelegateTarget.sendValue.selector, valueTarget, value)
);
mockExecutor.execDelegatecall(BOB_ACCOUNT, sendValueCallData);
// Assert that the value was set ie that execution was successful
// assertTrue(valueTarget.balance == value);
assertTrue(valueTarget.balance == value);
}

/// @notice Tests batch execution via MockExecutor
Expand Down

0 comments on commit 23994ac

Please sign in to comment.