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 28a36e7 commit 9e42fff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
17 changes: 1 addition & 16 deletions src/account/UpgradeableModularAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,8 @@ contract UpgradeableModularAccount is
_uninstallExecution(module, manifest, moduleUninstallData);
}

// TODO: Remove this function for SMA
/// @notice Initializes the account with a validation function added to the global pool.
/// TODO: remove and merge with regular initialization, after we figure out a better install/uninstall
// workflow
/// TODO: remove and merge with regular initialization, after we figure out a better install/uninstall workflow
/// with user install configs.
/// @dev This function is only callable once, and only by the EntryPoint.
function initializeWithValidation(
Expand Down Expand Up @@ -458,14 +456,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 +526,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 9e42fff

Please sign in to comment.