diff --git a/src/AASigner.ts b/src/AASigner.ts index 8cee2fc..97f27c0 100644 --- a/src/AASigner.ts +++ b/src/AASigner.ts @@ -1,7 +1,15 @@ -import { BigNumber, Bytes, ethers, Event, Signer } from 'ethers' -import { zeroAddress } from 'ethereumjs-util' -import { BaseProvider, Provider, TransactionRequest } from '@ethersproject/providers' +import { TransactionResponse } from '@ethersproject/abstract-provider' +import { TransactionReceipt } from '@ethersproject/abstract-provider/src.ts/index' +import { BytesLike, hexValue } from '@ethersproject/bytes' import { Deferrable, resolveProperties } from '@ethersproject/properties' +import { BaseProvider, Provider, TransactionRequest } from '@ethersproject/providers' +import { zeroAddress } from 'ethereumjs-util' +import { BigNumber, Bytes, ethers, Event, Signer } from 'ethers' +import { getCreate2Address, hexConcat, Interface, keccak256 } from 'ethers/lib/utils' +import { clearInterval } from 'timers' +import { HashZero } from '../test/utils/testutils' +import { fillAndSign, getUserOpHash } from '../test/utils/UserOp' +import { UserOperation } from '../test/utils/UserOperation' import { EntryPoint, EntryPoint__factory, @@ -9,15 +17,7 @@ import { SimpleAccount, SimpleAccount__factory } from '../typechain' -import { BytesLike, hexValue } from '@ethersproject/bytes' -import { TransactionResponse } from '@ethersproject/abstract-provider' -import { fillAndSign, getUserOpHash } from '../test/UserOp' -import { UserOperation } from '../test/UserOperation' -import { TransactionReceipt } from '@ethersproject/abstract-provider/src.ts/index' -import { clearInterval } from 'timers' import { Create2Factory } from './Create2Factory' -import { getCreate2Address, hexConcat, Interface, keccak256 } from 'ethers/lib/utils' -import { HashZero } from '../test/testutils' export type SendUserOp = (userOp: UserOperation) => Promise diff --git a/src/runop.ts b/src/runop.ts index d9fd0b2..dcd91f9 100644 --- a/src/runop.ts +++ b/src/runop.ts @@ -1,14 +1,14 @@ // run a single op // "yarn run runop [--network ...]" +import { TransactionReceipt } from '@ethersproject/abstract-provider/src.ts/index' +import { providers } from 'ethers' +import { parseEther } from 'ethers/lib/utils' import hre, { ethers } from 'hardhat' -import { objdump } from '../test/testutils' +import '../test/utils/aa.init' +import { objdump } from '../test/utils/testutils' +import { EntryPoint__factory, TestCounter__factory } from '../typechain' import { AASigner, localUserOpSender, rpcUserOpSender } from './AASigner' -import { TestCounter__factory, EntryPoint__factory } from '../typechain' -import '../test/aa.init' -import { parseEther } from 'ethers/lib/utils' -import { providers } from 'ethers' -import { TransactionReceipt } from '@ethersproject/abstract-provider/src.ts/index'; // eslint-disable-next-line @typescript-eslint/no-floating-promises (async () => { diff --git a/test/shard1/helpers.test.ts b/test/shard1/helpers.test.ts index 5d0c1e7..409a73d 100644 --- a/test/shard1/helpers.test.ts +++ b/test/shard1/helpers.test.ts @@ -3,8 +3,8 @@ import { BigNumber } from 'ethers' import { hexlify } from 'ethers/lib/utils' import { ethers } from 'hardhat' import { TestHelpers } from '../../typechain' -import '../aa.init' -import { AddressZero } from '../testutils' +import '../utils/aa.init' +import { AddressZero } from '../utils/testutils' describe('Helpers', function () { function pack (addr: string, validUntil: number, validAfter: number): BigNumber { diff --git a/test/shard1/paymaster.test.ts b/test/shard1/paymaster.test.ts index 3961e2f..d147ad3 100644 --- a/test/shard1/paymaster.test.ts +++ b/test/shard1/paymaster.test.ts @@ -12,7 +12,7 @@ import { TokenPaymaster, TokenPaymaster__factory } from '../../typechain' -import config from '../config' +import config from '../utils/config' import { AddressZero, calcGasUsage, @@ -26,9 +26,9 @@ import { getTokenBalance, ONE_ETH, rethrow -} from '../testutils' -import { fillAndSign } from '../UserOp' -import { UserOperation } from '../UserOperation' +} from '../utils/testutils' +import { fillAndSign } from '../utils/UserOp' +import { UserOperation } from '../utils/UserOperation' const TokenPaymasterT = artifacts.require('TokenPaymaster') const TestCounterT = artifacts.require('TestCounter') diff --git a/test/shard1/simple-wallet.test.ts b/test/shard1/simple-wallet.test.ts index ae95634..8c9484e 100644 --- a/test/shard1/simple-wallet.test.ts +++ b/test/shard1/simple-wallet.test.ts @@ -20,9 +20,9 @@ import { getBalance, getVeChainChainId, isDeployed -} from '../testutils' -import { fillUserOpDefaults, getUserOpHash, packUserOp, signUserOp } from '../UserOp' -import { UserOperation } from '../UserOperation' +} from '../utils/testutils' +import { fillUserOpDefaults, getUserOpHash, packUserOp, signUserOp } from '../utils/UserOp' +import { UserOperation } from '../utils/UserOperation' const SimpleAccountT = artifacts.require('SimpleAccount') diff --git a/test/shard2/entrypoint.test.ts b/test/shard2/entrypoint.test.ts index e96a269..60df054 100644 --- a/test/shard2/entrypoint.test.ts +++ b/test/shard2/entrypoint.test.ts @@ -29,11 +29,11 @@ import { DefaultsForUserOp, fillAndSign, getUserOpHash -} from '../UserOp' -import { UserOperation } from '../UserOperation' -import { debugTracers } from '../_debugTx' -import '../aa.init' -import config from '../config' +} from '../utils/UserOp' +import { UserOperation } from '../utils/UserOperation' +import { debugTracers } from '../utils/_debugTx' +import '../utils/aa.init' +import config from '../utils/config' import { AddressZero, HashZero, @@ -57,7 +57,7 @@ import { simulationResultCatch, simulationResultWithAggregationCatch, tostr -} from '../testutils' +} from '../utils/testutils' const TestCounterT = artifacts.require('TestCounter') const TestSignatureAggregatorT = artifacts.require('TestSignatureAggregator') diff --git a/test/UserOp.ts b/test/utils/UserOp.ts similarity index 99% rename from test/UserOp.ts rename to test/utils/UserOp.ts index 7b72462..94f30ea 100644 --- a/test/UserOp.ts +++ b/test/utils/UserOp.ts @@ -6,10 +6,10 @@ import { hexDataSlice, keccak256 } from 'ethers/lib/utils' -import { Create2Factory } from '../src/Create2Factory' +import { Create2Factory } from '../../src/Create2Factory' import { EntryPoint -} from '../typechain' +} from '../../typechain' import { AddressZero, callDataCost, getVeChainChainId, rethrow } from './testutils' import { UserOperation } from './UserOperation' diff --git a/test/UserOperation.ts b/test/utils/UserOperation.ts similarity index 100% rename from test/UserOperation.ts rename to test/utils/UserOperation.ts diff --git a/test/_debugTx.ts b/test/utils/_debugTx.ts similarity index 100% rename from test/_debugTx.ts rename to test/utils/_debugTx.ts diff --git a/test/aa.init.ts b/test/utils/aa.init.ts similarity index 100% rename from test/aa.init.ts rename to test/utils/aa.init.ts diff --git a/test/chaiHelper.ts b/test/utils/chaiHelper.ts similarity index 100% rename from test/chaiHelper.ts rename to test/utils/chaiHelper.ts diff --git a/test/config.ts b/test/utils/config.ts similarity index 100% rename from test/config.ts rename to test/utils/config.ts diff --git a/test/solidityTypes.ts b/test/utils/solidityTypes.ts similarity index 100% rename from test/solidityTypes.ts rename to test/utils/solidityTypes.ts diff --git a/test/testutils.ts b/test/utils/testutils.ts similarity index 99% rename from test/testutils.ts rename to test/utils/testutils.ts index bd6bf90..d137cd3 100644 --- a/test/testutils.ts +++ b/test/utils/testutils.ts @@ -6,7 +6,7 @@ import { SimpleAccount, SimpleAccountFactory, SimpleAccount__factory, TestAggregatedAccountFactory -} from '../typechain' +} from '../../typechain' import config from './config' import { BytesLike } from '@ethersproject/bytes'