Skip to content

Commit

Permalink
✅ Remove withdrawEth, depositEth from SMv3 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
insulineru committed Feb 8, 2024
1 parent 8e49249 commit fb9eea5
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions test/SMv3SessionValidationModule.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ contract SMv3SessionValidationModuleTest is Bootstrap {
validSelectors.push(IEngine.commitOrder.selector);
validSelectors.push(IEngine.invalidateUnorderedNonces.selector);
validSelectors.push(EIP7412.fulfillOracleQuery.selector);
validSelectors.push(IEngine.depositEth.selector);
validSelectors.push(IEngine.withdrawEth.selector);
}
}

Expand All @@ -86,11 +84,10 @@ contract ValidateSessionParams is SMv3SessionValidationModuleTest {
funcCallData = abi.encode(validSelectors[i], bytes32(""));

if (
validSelectors[i] == IEngine.depositEth.selector
|| validSelectors[i] == EIP7412.fulfillOracleQuery.selector
validSelectors[i] == EIP7412.fulfillOracleQuery.selector
) {
// ONLY non-zero call values are valid when
// calling depositEth() or fulfillOracleQuery()
// calling fulfillOracleQuery()
callValue = 1;
} else {
callValue = 0;
Expand Down Expand Up @@ -138,11 +135,9 @@ contract ValidateSessionParams is SMv3SessionValidationModuleTest {
// ensure each valid selector is accepted
funcCallData = abi.encode(validSelectors[i], bytes32(""));

if (validSelectors[i] == IEngine.depositEth.selector) {
callValue = 0; // i.e. invalid for depositEth
} else if (validSelectors[i] == EIP7412.fulfillOracleQuery.selector)
if (validSelectors[i] == EIP7412.fulfillOracleQuery.selector)
{
callValue = 0; // valid for fulfillOracleQuery
callValue = 0; // invalid for fulfillOracleQuery
} else {
callValue = invalid_callValue;
}
Expand Down Expand Up @@ -230,13 +225,11 @@ contract ValidateSessionUserOp is SMv3SessionValidationModuleTest {
// ensure each valid selector is accepted
funcCallData = abi.encode(validSelectors[i], bytes32(""));

if (validSelectors[i] == IEngine.depositEth.selector) {
callValue = 1; // valid for depositEth
} else if (validSelectors[i] == EIP7412.fulfillOracleQuery.selector)
if (validSelectors[i] == EIP7412.fulfillOracleQuery.selector)
{
callValue = 1; // valid for fulfillOracleQuery
} else {
callValue = 0; // invalid for depositEth
callValue = 0;
}

op.callData = abi.encodeWithSelector(
Expand Down Expand Up @@ -301,11 +294,9 @@ contract ValidateSessionUserOp is SMv3SessionValidationModuleTest {
// ensure each valid selector is accepted
funcCallData = abi.encode(validSelectors[i], bytes32(""));

if (validSelectors[i] == IEngine.depositEth.selector) {
callValue = 0; // i.e. invalid for depositEth
} else if (validSelectors[i] == EIP7412.fulfillOracleQuery.selector)
if (validSelectors[i] == EIP7412.fulfillOracleQuery.selector)
{
callValue = 0; // valid for fulfillOracleQuery
callValue = 0; // invalid for fulfillOracleQuery
} else {
callValue = invalid_callValue;
}
Expand Down

0 comments on commit fb9eea5

Please sign in to comment.