Skip to content

Commit

Permalink
refactor: clean up unnecessary env variable check, remove obsolete co…
Browse files Browse the repository at this point in the history
…mments
  • Loading branch information
Zer0dot committed Aug 7, 2024
1 parent 56d5b0a commit fdd8baf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
13 changes: 0 additions & 13 deletions src/account/UpgradeableModularAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -458,14 +458,6 @@ contract UpgradeableModularAccount is
userOp.signature = signatureSegment.getBody();

uint256 currentValidationRes = _execUserOpValidation(userOpValidationFunction, userOp, userOpHash);
// if (userOpValidationFunction.eq(_FALLBACK_VALIDATION)) {
// // fallback userop validation
// currentValidationRes = _fallbackUserOpValidation(userOp, userOpHash);
// } else {
// (address module, uint32 entityId) = userOpValidationFunction.unpack();

// currentValidationRes = IValidation(module).validateUserOp(entityId, userOp, userOpHash);
// }

if (preUserOpValidationHooks.length != 0) {
// If we have other validation data we need to coalesce with
Expand Down Expand Up @@ -536,11 +528,6 @@ contract UpgradeableModularAccount is
bytes calldata callData,
bytes calldata authorization
) internal virtual {
// if (runtimeValidationFunction.eq(_FALLBACK_VALIDATION)) {
// _fallbackRuntimeValidation();
// return;
// }

(address module, uint32 entityId) = runtimeValidationFunction.unpack();

try IValidation(module).validateRuntime(
Expand Down
9 changes: 1 addition & 8 deletions test/utils/AccountTestBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,11 @@ abstract contract AccountTestBase is OptimizedTest {

factory = new SingleSignerFactoryFixture(entryPoint, singleSignerValidation);

if (vm.envBool("SMA_TEST")) {
account1 = factory.createAccountWithFallbackValidation(owner1, 0);
} else {
account1 = factory.createAccount(owner1, 0);
}
// account1 = factory.createAccount(owner1, 0);
account1 = factory.createAccount(owner1, 0);
vm.deal(address(account1), 100 ether);

//TODO: env variable for semi-modular test?
_signerValidation =
ModuleEntityLib.pack(address(singleSignerValidation), TEST_DEFAULT_VALIDATION_ENTITY_ID);
// _signerValidation = ModuleEntity.wrap(bytes24(type(uint192).max));
}

function _runExecUserOp(address target, bytes memory callData) internal {
Expand Down

0 comments on commit fdd8baf

Please sign in to comment.