Skip to content

Commit 58c294d

Browse files
chore: forge fmt
1 parent 702e7d1 commit 58c294d

File tree

1 file changed

+13
-39
lines changed

1 file changed

+13
-39
lines changed

test/unit/EthereumVaultConnector/Permit.t.sol

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ abstract contract EIP712 {
2929
* NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
3030
* contract upgrade].
3131
*/
32-
constructor(
33-
string memory name
34-
) {
32+
constructor(string memory name) {
3533
_name = name.toShortStringWithFallback(_nameFallback);
3634
_hashedName = keccak256(bytes(name));
3735
}
@@ -62,9 +60,7 @@ abstract contract EIP712 {
6260
* address signer = ECDSA.recover(digest, signature);
6361
* ```
6462
*/
65-
function _hashTypedDataV4(
66-
bytes32 structHash
67-
) internal view virtual returns (bytes32) {
63+
function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
6864
return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
6965
}
7066
}
@@ -77,15 +73,11 @@ contract SignerECDSA is EIP712, Test {
7773
"Permit(address signer,address sender,uint256 nonceNamespace,uint256 nonce,uint256 deadline,uint256 value,bytes data)"
7874
);
7975

80-
constructor(
81-
EthereumVaultConnector _evc
82-
) EIP712(_evc.name()) {
76+
constructor(EthereumVaultConnector _evc) EIP712(_evc.name()) {
8377
evc = _evc;
8478
}
8579

86-
function setPrivateKey(
87-
uint256 _privateKey
88-
) external {
80+
function setPrivateKey(uint256 _privateKey) external {
8981
privateKey = _privateKey;
9082
}
9183

@@ -119,19 +111,15 @@ contract SignerERC1271 is EIP712, IERC1271 {
119111
"Permit(address signer,address sender,uint256 nonceNamespace,uint256 nonce,uint256 deadline,uint256 value,bytes data)"
120112
);
121113

122-
constructor(
123-
EthereumVaultConnector _evc
124-
) EIP712(_evc.name()) {
114+
constructor(EthereumVaultConnector _evc) EIP712(_evc.name()) {
125115
evc = _evc;
126116
}
127117

128118
function _buildDomainSeparator() internal view override returns (bytes32) {
129119
return keccak256(abi.encode(_TYPE_HASH, _hashedName, block.chainid, address(evc)));
130120
}
131121

132-
function setSignatureHash(
133-
bytes calldata signature
134-
) external {
122+
function setSignatureHash(bytes calldata signature) external {
135123
signatureHash = keccak256(signature);
136124
}
137125

@@ -163,31 +151,23 @@ contract EthereumVaultConnectorWithFallback is EthereumVaultConnectorHarness {
163151
bool internal shouldRevert;
164152
bool public fallbackCalled;
165153

166-
function setExpectedHash(
167-
bytes calldata data
168-
) external {
154+
function setExpectedHash(bytes calldata data) external {
169155
expectedHash = keccak256(data);
170156
}
171157

172-
function setExpectedValue(
173-
uint256 value
174-
) external {
158+
function setExpectedValue(uint256 value) external {
175159
expectedValue = value;
176160
}
177161

178-
function setShouldRevert(
179-
bool sr
180-
) external {
162+
function setShouldRevert(bool sr) external {
181163
shouldRevert = sr;
182164
}
183165

184166
function clearFallbackCalled() external {
185167
fallbackCalled = false;
186168
}
187169

188-
fallback(
189-
bytes calldata data
190-
) external payable returns (bytes memory) {
170+
fallback(bytes calldata data) external payable returns (bytes memory) {
191171
if (shouldRevert) revert("fallback reverted");
192172

193173
if (expectedHash == keccak256(data) && expectedValue == msg.value && address(this) == msg.sender) {
@@ -827,9 +807,7 @@ contract PermitTest is Test {
827807
assertTrue(evc.fallbackCalled());
828808
}
829809

830-
function test_Permit(
831-
uint256 privateKey
832-
) public {
810+
function test_Permit(uint256 privateKey) public {
833811
vm.assume(
834812
privateKey > 0
835813
&& privateKey < 115792089237316195423570985008687907852837564279074904382605163141518161494337
@@ -1329,9 +1307,7 @@ contract PermitTest is Test {
13291307
assertEq(evc.isAccountOperatorAuthorized(bob, operator), false);
13301308
}
13311309

1332-
function test_RevertIfInPermit_SetLockdownMode(
1333-
uint256 privateKey
1334-
) public {
1310+
function test_RevertIfInPermit_SetLockdownMode(uint256 privateKey) public {
13351311
vm.assume(
13361312
privateKey > 0
13371313
&& privateKey < 115792089237316195423570985008687907852837564279074904382605163141518161494337
@@ -1358,9 +1334,7 @@ contract PermitTest is Test {
13581334
evc.permit(alice, address(this), 0, 1, 1, 0, data, signature);
13591335
}
13601336

1361-
function test_RevertIfInPermit_SetPermitDisabledMode(
1362-
uint256 privateKey
1363-
) public {
1337+
function test_RevertIfInPermit_SetPermitDisabledMode(uint256 privateKey) public {
13641338
vm.assume(
13651339
privateKey > 0
13661340
&& privateKey < 115792089237316195423570985008687907852837564279074904382605163141518161494337

0 commit comments

Comments
 (0)