Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: warning removed, forge fmt #46

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Kernel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ contract Kernel is EIP712, Compatibility, KernelStorage {

function _domainSeparator() internal view override returns (bytes32) {
// Obtain the name and version from the _domainNameAndVersion function.
(string memory name, string memory version) = _domainNameAndVersion();
bytes32 nameHash = keccak256(bytes(name));
bytes32 versionHash = keccak256(bytes(version));
(string memory _name, string memory _version) = _domainNameAndVersion();
bytes32 nameHash = keccak256(bytes(_name));
bytes32 versionHash = keccak256(bytes(_version));

// Use the proxy address for the EIP-712 domain separator.
address proxyAddress = address(this);
Expand Down
6 changes: 3 additions & 3 deletions src/validator/WeightedECDSAValidator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ contract WeightedECDSAValidator is EIP712, IKernelValidator {
proposal.status = ProposalStatus.Rejected;
}

function validateUserOp(UserOperation calldata userOp, bytes32 userOpHash, uint256 missingFunds)
function validateUserOp(UserOperation calldata userOp, bytes32, uint256)
external
payable
returns (ValidationData validationData)
Expand Down Expand Up @@ -175,11 +175,11 @@ contract WeightedECDSAValidator is EIP712, IKernelValidator {
}
}

function validCaller(address, bytes calldata) external view override returns (bool) {
function validCaller(address, bytes calldata) external pure override returns (bool) {
return false;
}

function validateSignature(bytes32 hash, bytes calldata signature) external view returns (ValidationData) {
function validateSignature(bytes32, bytes calldata) external pure returns (ValidationData) {
return SIG_VALIDATION_FAILED;
}
}
5 changes: 0 additions & 5 deletions test/foundry/KernelTestBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,6 @@ abstract contract KernelTestBase is Test {

function test_fail_validate_wrongsignature() external {
bytes32 hash = keccak256(abi.encodePacked("hello world"));
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01", ERC4337Utils._buildDomainSeparator(KERNEL_NAME, KERNEL_VERSION, address(kernel)), hash
)
);
bytes memory sig = getWrongSignature(hash);
assertEq(kernel.isValidSignature(hash, sig), bytes4(0xffffffff));
}
Expand Down
5 changes: 3 additions & 2 deletions test/foundry/validator/SessionKeyValidator.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,10 @@ contract SessionKeyValidatorTest is KernelECDSATest {
struct BatchTestConfig {
uint8 count;
}

function test_scenario_batch(TestConfig memory config, BatchTestConfig memory batchConfig) public {
vm.warp(1000);
if(batchConfig.count == 0) {
if (batchConfig.count == 0) {
batchConfig.count = 1;
}
config.runs = 0;
Expand Down Expand Up @@ -292,7 +293,7 @@ contract SessionKeyValidatorTest is KernelECDSATest {
);
bytes32[][] memory proofs = new bytes32[][](batchConfig.count);
Permission[] memory usingPermission = new Permission[](batchConfig.count);
for(uint256 i = 0; i < batchConfig.count; i++) {
for (uint256 i = 0; i < batchConfig.count; i++) {
proofs[i] = _getProof(data, config.indexToUse, config.wrongProof);
usingPermission[i] = permissions[config.indexToUse];
}
Expand Down