|
1 |
| -const { ethers } = require('hardhat'); |
| 1 | +const { ethers, entrypoint } = require('hardhat'); |
2 | 2 | const { expect } = require('chai');
|
3 | 3 | const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers');
|
4 | 4 |
|
5 | 5 | const { packValidationData, UserOperation } = require('../../helpers/erc4337');
|
6 |
| -const { deployEntrypoint } = require('../../helpers/erc4337-entrypoint'); |
7 | 6 | const { MAX_UINT48 } = require('../../helpers/constants');
|
8 | 7 | const ADDRESS_ONE = '0x0000000000000000000000000000000000000001';
|
9 | 8 |
|
10 | 9 | const fixture = async () => {
|
11 |
| - const { entrypoint } = await deployEntrypoint(); |
12 | 10 | const [authorizer, sender, factory, paymaster] = await ethers.getSigners();
|
13 | 11 | const utils = await ethers.deployContract('$ERC4337Utils');
|
14 | 12 | const SIG_VALIDATION_SUCCESS = await utils.$SIG_VALIDATION_SUCCESS();
|
15 | 13 | const SIG_VALIDATION_FAILED = await utils.$SIG_VALIDATION_FAILED();
|
16 |
| - return { utils, authorizer, sender, entrypoint, factory, paymaster, SIG_VALIDATION_SUCCESS, SIG_VALIDATION_FAILED }; |
| 14 | + |
| 15 | + return { utils, authorizer, sender, factory, paymaster, SIG_VALIDATION_SUCCESS, SIG_VALIDATION_FAILED }; |
17 | 16 | };
|
18 | 17 |
|
19 | 18 | describe('ERC4337Utils', function () {
|
@@ -173,14 +172,14 @@ describe('ERC4337Utils', function () {
|
173 | 172 | const otherChainId = 0xdeadbeef;
|
174 | 173 |
|
175 | 174 | // check that helper matches entrypoint logic
|
176 |
| - expect(this.entrypoint.getUserOpHash(userOp.packed)).to.eventually.equal(userOp.hash(this.entrypoint, chainId)); |
| 175 | + expect(entrypoint.getUserOpHash(userOp.packed)).to.eventually.equal(userOp.hash(entrypoint, chainId)); |
177 | 176 |
|
178 | 177 | // check library against helper
|
179 |
| - expect(this.utils.$hash(userOp.packed, this.entrypoint, chainId)).to.eventually.equal( |
180 |
| - userOp.hash(this.entrypoint, chainId), |
| 178 | + expect(this.utils.$hash(userOp.packed, entrypoint, chainId)).to.eventually.equal( |
| 179 | + userOp.hash(entrypoint, chainId), |
181 | 180 | );
|
182 |
| - expect(this.utils.$hash(userOp.packed, this.entrypoint, otherChainId)).to.eventually.equal( |
183 |
| - userOp.hash(this.entrypoint, otherChainId), |
| 181 | + expect(this.utils.$hash(userOp.packed, entrypoint, otherChainId)).to.eventually.equal( |
| 182 | + userOp.hash(entrypoint, otherChainId), |
184 | 183 | );
|
185 | 184 | });
|
186 | 185 | });
|
|
0 commit comments