Skip to content

Commit

Permalink
chore: ./test/contracts./contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Jul 11, 2024
1 parent bc419b7 commit a02120e
Show file tree
Hide file tree
Showing 101 changed files with 67 additions and 10,867 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "test/contracts/lib/solady"]
path = test/contracts/lib/solady
url = git@github.com:foundry-rs/forge-std.git
[submodule "contracts/lib/solady"]
path = contracts/lib/solady
url = git@github.com:Vectorized/solady.git
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { join } from 'node:path'
import { Glob } from 'bun'

const generatedPath = join(import.meta.dir, '../test/contracts/generated.ts')
const generatedPath = join(import.meta.dir, '../contracts/generated.ts')
Bun.write(generatedPath, '')

const generated = Bun.file(generatedPath)
const writer = generated.writer()

const fileNames = []

const glob = new Glob('test/contracts/out/**/*.json')
const glob = new Glob('contracts/out/**/*.json')
for await (const file of glob.scan('.')) {
if (file.includes('build-info')) continue

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"CHANGELOG.md",
"bun.lockb",
"cache",
"contracts",
"test/contracts",
"test/kzg/*.json",
"test/kzg/*.txt",
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions contracts/foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[profile.default]
remappings = [
"solady/=lib/solady/src/",
]
src = "src"
out = "out"
1 change: 1 addition & 0 deletions contracts/lib/forge-std
Submodule forge-std added at 07263d
1 change: 1 addition & 0 deletions contracts/lib/solady
Submodule solady added at 8200a7
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"build:trustedSetups:start": "mv src/node/trustedSetups.ts src/node/trustedSetups_esm.ts && mv src/node/trustedSetups_cjs.ts src/node/trustedSetups.ts",
"build:trustedSetups:end": "mv src/node/trustedSetups.ts src/node/trustedSetups_cjs.ts && mv src/node/trustedSetups_esm.ts src/node/trustedSetups.ts",
"build:types": "tsc --project ./tsconfig.build.json --module esnext --declarationDir ./src/_types --emitDeclarationOnly --declaration --declarationMap",
"changeset:prepublish": "pnpm version:update && bun scripts/prepublishOnly.ts && pnpm build",
"changeset:prepublish": "pnpm version:update && bun .scripts/prepublishOnly.ts && pnpm build",
"changeset:publish": "pnpm changeset:prepublish && changeset publish",
"changeset:version": "changeset version && pnpm install --lockfile-only && pnpm version:update && pnpm format",
"clean": "rm -rf *.tsbuildinfo src/*.tsbuildinfo src/_esm src/_cjs src/_types",
"contracts:build": "forge build --config-path ./test/foundry.toml && bun ./scripts/generateTypedArtifacts.ts",
"contracts:build": "forge build --config-path ./contracts/foundry.toml && bun .scripts/generateTypedArtifacts.ts",
"deps": "pnpx taze -r",
"docs:dev": "pnpm --filter site dev",
"docs:build": "pnpm --filter site build",
Expand All @@ -25,7 +25,7 @@
"postinstall": "git submodule update --init --recursive && pnpm contracts:build",
"preinstall": "pnpx only-allow pnpm",
"prepare": "pnpm simple-git-hooks",
"prepublishOnly": "bun scripts/prepublishOnly.ts",
"prepublishOnly": "bun .scripts/prepublishOnly.ts",
"size": "size-limit",
"test": "vitest -c ./test/vitest.config.ts dev",
"test:build": "publint --strict ./src && attw --pack ./src --ignore-rules false-esm",
Expand All @@ -43,7 +43,7 @@
"typecheck": "tsc --noEmit",
"vectors": "bun test vectors/**/*.test.ts",
"vectors:generate": "bun vectors/generate.ts",
"version:update": "bun scripts/updateVersion.ts"
"version:update": "bun .scripts/updateVersion.ts"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.15.3",
Expand Down Expand Up @@ -89,7 +89,7 @@
},
"workspaces": {
".": {
"project": "scripts/*.ts"
"project": ".scripts/*.ts"
},
"src": {
"entry": [
Expand Down
17 changes: 8 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/actions/public/call.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Mock4337Account,
Mock4337AccountFactory,
OffchainLookupExample,
} from '~test/contracts/generated.js'
} from '~contracts/generated.js'
import {
baycContractConfig,
usdcContractConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/actions/public/estimateContractGas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
import { describe, expect, test } from 'vitest'

import { ErrorsExample } from '~test/contracts/generated.js'
import { ErrorsExample } from '~contracts/generated.js'
import { baycContractConfig, wagmiContractConfig } from '~test/src/abis.js'
import { accounts } from '~test/src/constants.js'
import { deployBAYC, deployErrorExample } from '~test/src/utils.js'
Expand Down
2 changes: 1 addition & 1 deletion src/actions/public/getEip712Domain.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from 'vitest'
import { Mock4337AccountFactory } from '../../../test/contracts/generated.js'
import { Mock4337AccountFactory } from '~contracts/generated.js'
import { anvilMainnet } from '../../../test/src/anvil.js'
import { accounts } from '../../../test/src/constants.js'
import { deployMock4337Account } from '../../../test/src/utils.js'
Expand Down
5 changes: 2 additions & 3 deletions src/actions/public/getFilterChanges.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import {
test,
} from 'vitest'

import { ERC20InvalidTransferEvent } from '~test/contracts/generated.js'
import { ERC20InvalidTransferEvent } from '~contracts/generated.js'
import { usdcContractConfig } from '~test/src/abis.js'
import { anvilMainnet } from '~test/src/anvil.js'
import { accounts, address } from '~test/src/constants.js'
import { deployErc20InvalidTransferEvent } from '~test/src/utils.js'
import type { Log } from '../../types/log.js'
Expand All @@ -22,8 +23,6 @@ import { setBalance } from '../test/setBalance.js'
import { sendTransaction } from '../wallet/sendTransaction.js'
import { writeContract } from '../wallet/writeContract.js'

import { anvilMainnet } from '../../../test/src/anvil.js'

import { createBlockFilter } from './createBlockFilter.js'
import { createContractEventFilter } from './createContractEventFilter.js'
import { createEventFilter } from './createEventFilter.js'
Expand Down
2 changes: 1 addition & 1 deletion src/actions/public/getFilterLogs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
test,
} from 'vitest'

import { ERC20InvalidTransferEvent } from '~test/contracts/generated.js'
import { ERC20InvalidTransferEvent } from '~contracts/generated.js'
import { usdcContractConfig } from '~test/src/abis.js'
import { accounts, address } from '~test/src/constants.js'
import { deployErc20InvalidTransferEvent } from '~test/src/utils.js'
Expand Down
2 changes: 1 addition & 1 deletion src/actions/public/getLogs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
test,
} from 'vitest'

import { ERC20InvalidTransferEvent } from '~test/contracts/generated.js'
import { ERC20InvalidTransferEvent } from '~contracts/generated.js'
import { usdcContractConfig } from '~test/src/abis.js'
import { accounts, address } from '~test/src/constants.js'
import { deployErc20InvalidTransferEvent } from '~test/src/utils.js'
Expand Down
2 changes: 1 addition & 1 deletion src/actions/public/multicall.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
import { describe, expect, test, vi } from 'vitest'

import { ErrorsExample, GH434 } from '~test/contracts/generated.js'
import { ErrorsExample, GH434 } from '~contracts/generated.js'
import {
baycContractConfig,
usdcContractConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/actions/public/readContract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ErrorsExample,
Mock4337Account,
Mock4337AccountFactory,
} from '~test/contracts/generated.js'
} from '~contracts/generated.js'
import { baycContractConfig, wagmiContractConfig } from '~test/src/abis.js'
import { accounts, address } from '~test/src/constants.js'
import { deployErrorExample, deployMock4337Account } from '~test/src/utils.js'
Expand Down
2 changes: 1 addition & 1 deletion src/actions/public/simulateContract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
import { describe, expect, test, vi } from 'vitest'

import { ErrorsExample } from '~test/contracts/generated.js'
import { ErrorsExample } from '~contracts/generated.js'
import { baycContractConfig, wagmiContractConfig } from '~test/src/abis.js'
import { accounts } from '~test/src/constants.js'
import {
Expand Down
2 changes: 1 addition & 1 deletion src/actions/public/verifyHash.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ensPublicResolverConfig, smartAccountConfig } from '~test/src/abis.js'
import { accounts, address } from '~test/src/constants.js'
import { anvilMainnet } from '../../../test/src/anvil.js'

import { Mock4337AccountFactory } from '../../../test/contracts/generated.js'
import { Mock4337AccountFactory } from '~contracts/generated.js'
import { deployMock4337Account } from '../../../test/src/utils.js'
import { privateKeyToAccount } from '../../accounts/privateKeyToAccount.js'
import { zkSync } from '../../chains/index.js'
Expand Down
2 changes: 1 addition & 1 deletion src/actions/public/watchContractEvent.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assertType, beforeAll, describe, expect, test, vi } from 'vitest'

import { ERC20InvalidTransferEvent } from '~test/contracts/generated.js'
import { ERC20InvalidTransferEvent } from '~contracts/generated.js'
import { usdcContractConfig } from '~test/src/abis.js'
import { accounts, address } from '~test/src/constants.js'
import { deployErc20InvalidTransferEvent } from '~test/src/utils.js'
Expand Down
2 changes: 1 addition & 1 deletion src/actions/public/watchEvent.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { beforeAll, describe, expect, test, vi } from 'vitest'

import { ERC20InvalidTransferEvent } from '~test/contracts/generated.js'
import { ERC20InvalidTransferEvent } from '~contracts/generated.js'
import { usdcContractConfig, wagmiContractConfig } from '~test/src/abis.js'
import { accounts, address } from '~test/src/constants.js'
import { deployErc20InvalidTransferEvent } from '~test/src/utils.js'
Expand Down
2 changes: 1 addition & 1 deletion src/actions/wallet/writeContract.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from 'vitest'

import { Payable } from '~test/contracts/generated.js'
import { Payable } from '~contracts/generated.js'
import { wagmiContractConfig } from '~test/src/abis.js'
import { accounts } from '~test/src/constants.js'
import { deployPayable } from '~test/src/utils.js'
Expand Down
2 changes: 1 addition & 1 deletion src/clients/decorators/public.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { accounts, address, typedData } from '~test/src/constants.js'
import { getBlockNumber } from '../../actions/public/getBlockNumber.js'
import { parseEther } from '../../utils/unit/parseEther.js'

import { Mock4337AccountFactory } from '../../../test/contracts/generated.js'
import { Mock4337AccountFactory } from '~contracts/generated.js'
import { anvilMainnet } from '../../../test/src/anvil.js'
import { deployMock4337Account } from '../../../test/src/utils.js'
import { privateKeyToAccount } from '../../accounts/privateKeyToAccount.js'
Expand Down
2 changes: 1 addition & 1 deletion src/errors/contract.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'vitest'

import { ErrorsExample } from '~test/contracts/generated.js'
import { ErrorsExample } from '~contracts/generated.js'
import { baycContractConfig } from '~test/src/abis.js'
import { address } from '~test/src/constants.js'
import { polygon } from '../chains/index.js'
Expand Down
6 changes: 3 additions & 3 deletions src/experimental/solady/actions/signMessage.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Address } from 'abitype'
import { beforeAll, expect, test } from 'vitest'

import { Mock4337AccountFactory } from '~contracts/generated.js'
import { anvilMainnet } from '~test/src/anvil.js'
import { accounts } from '~test/src/constants.js'
import { Mock4337AccountFactory } from '../../../../test/contracts/generated.js'
import { anvilMainnet } from '../../../../test/src/anvil.js'
import { deployMock4337Account } from '../../../../test/src/utils.js'
import { deployMock4337Account } from '~test/src/utils.js'
import { privateKeyToAccount } from '../../../accounts/privateKeyToAccount.js'
import {
mine,
Expand Down
6 changes: 3 additions & 3 deletions src/experimental/solady/actions/signTypedData.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Address } from 'abitype'
import { beforeAll, describe, expect, test } from 'vitest'

import { Mock4337AccountFactory } from '~contracts/generated.js'
import { anvilMainnet } from '~test/src/anvil.js'
import { accounts, typedData } from '~test/src/constants.js'
import { Mock4337AccountFactory } from '../../../../test/contracts/generated.js'
import { anvilMainnet } from '../../../../test/src/anvil.js'
import { deployMock4337Account } from '../../../../test/src/utils.js'
import { deployMock4337Account } from '~test/src/utils.js'
import { privateKeyToAccount } from '../../../accounts/privateKeyToAccount.js'
import {
mine,
Expand Down
8 changes: 4 additions & 4 deletions src/experimental/solady/decorators/solady.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Address } from 'abitype'
import { beforeAll, expect, test } from 'vitest'

import { Mock4337AccountFactory } from '../../../../test/contracts/generated.js'
import { anvilMainnet } from '../../../../test/src/anvil.js'
import { accounts, typedData } from '../../../../test/src/constants.js'
import { deployMock4337Account } from '../../../../test/src/utils.js'
import { Mock4337AccountFactory } from '~contracts/generated.js'
import { anvilMainnet } from '~test/src/anvil.js'
import { accounts, typedData } from '~test/src/constants.js'
import { deployMock4337Account } from '~test/src/utils.js'
import {
mine,
simulateContract,
Expand Down
8 changes: 4 additions & 4 deletions src/experimental/solady/utils/hashMessage.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Address } from 'abitype'
import { beforeAll, expect, test } from 'vitest'

import { Mock4337AccountFactory } from '../../../../test/contracts/generated.js'
import { anvilMainnet } from '../../../../test/src/anvil.js'
import { accounts } from '../../../../test/src/constants.js'
import { deployMock4337Account } from '../../../../test/src/utils.js'
import { Mock4337AccountFactory } from '~contracts/generated.js'
import { anvilMainnet } from '~test/src/anvil.js'
import { accounts } from '~test/src/constants.js'
import { deployMock4337Account } from '~test/src/utils.js'
import { sign } from '../../../accounts/index.js'
import {
getEip712Domain,
Expand Down
8 changes: 4 additions & 4 deletions src/experimental/solady/utils/hashTypedData.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Address } from 'abitype'
import { beforeAll, expect, test } from 'vitest'

import { Mock4337AccountFactory } from '../../../../test/contracts/generated.js'
import { anvilMainnet } from '../../../../test/src/anvil.js'
import { accounts, typedData } from '../../../../test/src/constants.js'
import { deployMock4337Account } from '../../../../test/src/utils.js'
import { Mock4337AccountFactory } from '~contracts/generated.js'
import { anvilMainnet } from '~test/src/anvil.js'
import { accounts, typedData } from '~test/src/constants.js'
import { deployMock4337Account } from '~test/src/utils.js'
import { serializeSignature, sign } from '../../../accounts/index.js'
import {
getEip712Domain,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ccip.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'vitest'

import { OffchainLookupExample } from '~test/contracts/generated.js'
import { OffchainLookupExample } from '~contracts/generated.js'
import { createCcipServer } from '~test/src/ccip.js'
import { accounts } from '~test/src/constants.js'
import {
Expand Down
Loading

0 comments on commit a02120e

Please sign in to comment.