Skip to content

Commit

Permalink
Fix/ci (#102)
Browse files Browse the repository at this point in the history
* ci

* ci

* fmt

* changed min solc

* use 0.8.21

* use 0.8.23

* path fix...?

* plz

* maybe..?

* typo

* typos

* removed intense

* removed yarn lock from codespell

* removed intense completely
  • Loading branch information
leekt authored Apr 22, 2024
1 parent ce2bc50 commit 14b48f8
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 61 deletions.
43 changes: 13 additions & 30 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: ci

on:
pull_request:
branches: [dev]
branches: [dev,fix/ci]
paths:
- '**.sol'
- '**.yml'
push:
branches: [dev]
branches: [dev,fix/ci]
paths:
- '**.sol'
- '**.yml'
Expand All @@ -18,7 +18,7 @@ jobs:

strategy:
matrix:
profile: [post-cancun,post-cancun-via-ir,solc-past-versions-0,solc-past-versions-1,via-ir,min-solc,min-solc-via-ir,intense]
profile: [post-cancun,post-cancun-via-ir,solc-past-versions-0,via-ir,min-solc,min-solc-via-ir]

steps:
- uses: actions/checkout@v4
Expand All @@ -30,6 +30,12 @@ jobs:

- name: Install Dependencies
run: forge install

- name: show list
run: ls

- name : pwd
run: pwd

- name: Run Tests with ${{ matrix.profile }}
run: >
Expand All @@ -40,26 +46,6 @@ jobs:
forge test --use 0.8.25 --evm-version "cancun" --via-ir
) ||
( [ "${{ matrix.profile }}" = "solc-past-versions-0" ] &&
forge test --use 0.8.5 --fuzz-runs 16 &&
forge test --use 0.8.6 --fuzz-runs 16 &&
forge test --use 0.8.7 --fuzz-runs 16 &&
forge test --use 0.8.8 --fuzz-runs 16 &&
forge test --use 0.8.9 --fuzz-runs 16 &&
forge test --use 0.8.10 --fuzz-runs 16 &&
forge test --use 0.8.11 --fuzz-runs 16 &&
forge test --use 0.8.12 --fuzz-runs 16
) ||
( [ "${{ matrix.profile }}" = "solc-past-versions-1" ] &&
forge test --use 0.8.13 --fuzz-runs 16 &&
forge test --use 0.8.14 --fuzz-runs 16 &&
forge test --use 0.8.15 --fuzz-runs 16 &&
forge test --use 0.8.16 --fuzz-runs 16 &&
forge test --use 0.8.17 --fuzz-runs 16 &&
forge test --use 0.8.18 --fuzz-runs 16 &&
forge test --use 0.8.19 --fuzz-runs 16 &&
forge test --use 0.8.20 --fuzz-runs 16 &&
forge test --use 0.8.21 --fuzz-runs 16 &&
forge test --use 0.8.22 --fuzz-runs 16 &&
forge test --use 0.8.23 --fuzz-runs 16 &&
forge test --use 0.8.24 --fuzz-runs 16
) ||
Expand All @@ -68,14 +54,11 @@ jobs:
) ||
( [ "${{ matrix.profile }}" = "min-solc" ] &&
forge fmt --check &&
forge test --use 0.8.4
forge test --use 0.8.23
) ||
( [ "${{ matrix.profile }}" = "min-solc-via-ir" ] &&
forge test --use 0.8.4 --via-ir
) ||
( [ "${{ matrix.profile }}" = "intense" ] &&
forge test --fuzz-runs 5000
)
forge test --use 0.8.23 --via-ir
)
codespell:
runs-on: ${{ matrix.os }}
Expand All @@ -93,4 +76,4 @@ jobs:
with:
check_filenames: true
ignore_words_list: usera
skip: ./.git,package-lock.json,ackee-blockchain-solady-report.pdf,EIP712Mock.sol
skip: ./.git,package-lock.json,ackee-blockchain-solady-report.pdf,EIP712Mock.sol,yarn.lock
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ libs = ["lib"]
bytecode_hash = "none"
cbor_metadata = false
optimize = true
via-ir = true
via-ir = false
runs = 1000

[profile.deploy]
Expand Down
12 changes: 6 additions & 6 deletions src/Kernel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -336,18 +336,18 @@ contract Kernel is IAccount, IAccountExecute, IERC7579Account, ValidationManager
_installHook(IHook(address(bytes20(initData[4:24]))), hookData);
} else if (moduleType == MODULE_TYPE_HOOK) {
// force call onInstall for hook
// NOTE: for hook, kernel does not support independant hook install,
// NOTE: for hook, kernel does not support independent hook install,
// hook is expected to be paired with proper validator/executor/selector
IHook(module).onInstall(initData);
} else if (moduleType == MODULE_TYPE_POLICY) {
// force call onInstall for policy
// NOTE: for policy, kernel does not support independant policy install,
// NOTE: for policy, kernel does not support independent policy install,
// policy is expected to be paired with proper permissionId
// to "ADD" permission, use "installValidations()" function
IPolicy(module).onInstall(initData);
} else if (moduleType == MODULE_TYPE_SIGNER) {
// force call onInstall for signer
// NOTE: for signer, kernel does not support independant signer install,
// NOTE: for signer, kernel does not support independent signer install,
// signer is expected to be paired with proper permissionId
// to "ADD" permission, use "installValidations()" function
ISigner(module).onInstall(initData);
Expand Down Expand Up @@ -400,7 +400,7 @@ contract Kernel is IAccount, IAccountExecute, IERC7579Account, ValidationManager
_validationStorage().validationConfig[vId].hook = IHook(address(1));
}
// force call onInstall for hook
// NOTE: for hook, kernel does not support independant hook install,
// NOTE: for hook, kernel does not support independent hook install,
// hook is expected to be paired with proper validator/executor/selector
ModuleLib.uninstallModule(module, deInitData);
} else if (moduleType == 5) {
Expand All @@ -412,7 +412,7 @@ contract Kernel is IAccount, IAccountExecute, IERC7579Account, ValidationManager
}
}
// force call onInstall for policy
// NOTE: for policy, kernel does not support independant policy install,
// NOTE: for policy, kernel does not support independent policy install,
// policy is expected to be paired with proper permissionId
// to "REMOVE" permission, use "uninstallValidation()" function
ModuleLib.uninstallModule(module, deInitData);
Expand All @@ -425,7 +425,7 @@ contract Kernel is IAccount, IAccountExecute, IERC7579Account, ValidationManager
}
}
// force call onInstall for signer
// NOTE: for signer, kernel does not support independant signer install,
// NOTE: for signer, kernel does not support independent signer install,
// signer is expected to be paired with proper permissionId
// to "REMOVE" permission, use "uninstallValidation()" function
ModuleLib.uninstallModule(module, deInitData);
Expand Down
6 changes: 3 additions & 3 deletions src/interfaces/IERC7579Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ interface IERC7579Account {

/**
* @dev installs a Module of a certain type on the smart account
* @dev Implement Authorization control of your chosing
* @dev Implement Authorization control of your choosing
* @param moduleTypeId the module type ID according the ERC-7579 spec
* @param module the module address
* @param initData arbitrary data that may be required on the module during `onInstall`
Expand All @@ -63,7 +63,7 @@ interface IERC7579Account {

/**
* @dev uninstalls a Module of a certain type on the smart account
* @dev Implement Authorization control of your chosing
* @dev Implement Authorization control of your choosing
* @param moduleTypeId the module type ID according the ERC-7579 spec
* @param module the module address
* @param deInitData arbitrary data that may be required on the module during `onUninstall`
Expand All @@ -90,7 +90,7 @@ interface IERC7579Account {
* thus may be necessary to query multiple module types
* @param module the module address
* @param additionalContext additional context data that the smart account may interpret to
* identifiy conditions under which the module is installed.
* identify conditions under which the module is installed.
* usually this is not necessary, but for some special hooks that
* are stored in mappings, this param might be needed
*/
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IERC7579Modules.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ interface IValidator is IModule {
/**
* @dev Validates a transaction on behalf of the account.
* This function is intended to be called by the MSA during the ERC-4337 validaton phase
* Note: solely relying on bytes32 hash and signature is not suffcient for some
* Note: solely relying on bytes32 hash and signature is not sufficient for some
* validation implementations (i.e. SessionKeys often need access to userOp.calldata)
* @param userOp The user operation to be validated. The userOp MUST NOT contain any metadata.
* The MSA MUST clean up the userOp before sending it to the validator.
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IEntryPoint.sol
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ interface IEntryPoint is IStakeManager, INonceManager {
* A custom revert error of handleOps, to report a revert by account or paymaster.
* @param opIndex - Index into the array of ops to the failed one (in simulateValidation, this is always zero).
* @param reason - Revert reason. see FailedOp(uint256,string), above
* @param inner - data from inner cought revert reason
* @param inner - data from inner caught revert reason
* @dev note that inner is truncated to 2048 bytes
*/
error FailedOpWithRevert(uint256 opIndex, string reason, bytes inner);
Expand Down
24 changes: 12 additions & 12 deletions src/sdk/TestBase/KernelTestBase.sol → src/sdk/KernelTestBase.sol
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "src/Kernel.sol";
import "src/factory/KernelFactory.sol";
import "src/factory/FactoryStaker.sol";
import "../Kernel.sol";
import "../factory/KernelFactory.sol";
import "../factory/FactoryStaker.sol";
import "forge-std/Test.sol";
import "src/mock/MockValidator.sol";
import "src/mock/MockPolicy.sol";
import "src/mock/MockSigner.sol";
import "src/mock/MockAction.sol";
import "src/mock/MockHook.sol";
import "src/mock/MockExecutor.sol";
import "src/mock/MockFallback.sol";
import "src/core/ValidationManager.sol";
import "./erc4337Util.sol";
import "../mock/MockValidator.sol";
import "../mock/MockPolicy.sol";
import "../mock/MockSigner.sol";
import "../mock/MockAction.sol";
import "../mock/MockHook.sol";
import "../mock/MockExecutor.sol";
import "../mock/MockFallback.sol";
import "../core/ValidationManager.sol";
import "./TestBase/erc4337Util.sol";

contract MockCallee {
uint256 public value;
Expand Down
8 changes: 5 additions & 3 deletions src/signer/MultiSignatureSigner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,25 @@ struct ECDSAValidatorStorage {
contract MultiSignatureECDSASigner is SignerBase {
mapping(address => uint256) public usedIds;
mapping(bytes32 id => mapping(address wallet => address)) public signer;

event SignerRegistered(address indexed kernel, bytes32 indexed id, address indexed owner);

error NoSignerRegistered();

function isInitialized(address wallet) external view override returns (bool) {
return usedIds[wallet] > 0;
}

function _signerOninstall(bytes32 id, bytes calldata _data) internal override {
if(signer[id][msg.sender] == address(0)) {
if (signer[id][msg.sender] == address(0)) {
usedIds[msg.sender]++;
}
signer[id][msg.sender] = address(bytes20(_data[0:20]));
emit SignerRegistered(msg.sender, id, address(bytes20(_data[0:20])));
}

function _signerOnUninstall(bytes32 id, bytes calldata) internal override {
if(signer[id][msg.sender] == address(0)) {
if (signer[id][msg.sender] == address(0)) {
revert NoSignerRegistered();
}
delete signer[id][msg.sender];
Expand Down
2 changes: 1 addition & 1 deletion src/validator/WeightedECDSAValidator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.0;

import "src/types/Types.sol";
import "../types/Types.sol";
import {ECDSA} from "solady/utils/ECDSA.sol";
import {EIP712} from "solady/utils/EIP712.sol";
import {PackedUserOperation} from "../interfaces/PackedUserOperation.sol";
Expand Down
4 changes: 2 additions & 2 deletions test/ECDSAValidator.t.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pragma solidity ^0.8.0;

import {MockCallee, KernelTestBase} from "../src/sdk/testBase/KernelTestBase.sol";
import {ECDSAValidator} from "../src/validator/ECDSAValidator.sol";
import {MockCallee, KernelTestBase} from "../src/sdk/KernelTestBase.sol";
import {ECDSA} from "solady/utils/ECDSA.sol";
import {PackedUserOperation} from "src/interfaces/PackedUserOperation.sol";
import {PackedUserOperation} from "../src/interfaces/PackedUserOperation.sol";
import {ValidatorLib} from "../src/utils/ValidationTypeLib.sol";
import {ExecLib} from "../src/utils/ExecLib.sol";
import {IHook} from "../src/interfaces/IERC7579Modules.sol";
Expand Down
2 changes: 1 addition & 1 deletion test/Kernel.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pragma solidity ^0.8.0;

import {KernelTestBase} from "../src/sdk/testBase/KernelTestBase.sol";
import {KernelTestBase} from "../src/sdk/KernelTestBase.sol";

contract KernelTest is KernelTestBase {}

0 comments on commit 14b48f8

Please sign in to comment.