Skip to content

Commit ceba35c

Browse files
committed
Remove hardhat and related dependencies, replace with vitest
1 parent bad6c89 commit ceba35c

52 files changed

Lines changed: 668 additions & 3979 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@
3232
"@metamask/eslint-config": "^12.0.0",
3333
"@metamask/eslint-config-nodejs": "^12.0.0",
3434
"@metamask/eslint-config-typescript": "^12.0.0",
35-
"@nomicfoundation/hardhat-ignition": "^0.15.1",
36-
"@nomicfoundation/hardhat-ignition-viem": "^0.15.0",
37-
"@nomicfoundation/hardhat-network-helpers": "^1.0.9",
38-
"@nomicfoundation/hardhat-toolbox-viem": "^3.0.0",
39-
"@nomicfoundation/hardhat-verify": "^2.0.0",
40-
"@nomicfoundation/hardhat-viem": "^2.0.0",
41-
"@nomicfoundation/ignition-core": "^0.15.1",
42-
"@nomiclabs/hardhat-ethers": "^2.2.3",
4335
"@types/keccak": "^3.0.4",
4436
"@typescript-eslint/eslint-plugin": "^5.42.1",
4537
"@typescript-eslint/parser": "^5.42.1",

packages/delegation-toolkit/hardhat.config.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

packages/delegation-toolkit/hardhat.tsconfig.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/delegation-toolkit/package.json

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
"changelog:update": "../../scripts/update-changelog.sh @metamask/delegation-toolkit",
8585
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/delegation-toolkit",
8686
"clean": "rm -rf dist",
87-
"test": "hardhat test --tsconfig hardhat.tsconfig.json",
88-
"test:watch": "npx nodemon -e ts -w ./test -w ./src -x \"yarn test\"",
87+
"test": "npx vitest run",
88+
"test:watch": "npx vitest watch",
8989
"format": "prettier --write \"src/**/*.{ts,tsx}\" --ignore-path .prettierignore",
9090
"lint": "yarn lint:eslint",
9191
"lint:complete": "yarn lint:eslint && yarn lint:constraints && yarn lint:misc --check && yarn lint:dependencies --check && yarn lint:changelog",
@@ -104,15 +104,10 @@
104104
"allowScripts": {
105105
"@lavamoat/preinstall-always-fail": false,
106106
"tsup>esbuild": true,
107-
"hardhat>@nomicfoundation/ethereumjs-blockchain>level>classic-level": false,
108-
"hardhat>@nomicfoundation/ethereumjs-tx>ethereum-cryptography>secp256k1": false,
109-
"hardhat>keccak": false,
110107
"viem>ws>bufferutil": false,
111108
"viem>ws>utf-8-validate": false,
112-
"@nomicfoundation/hardhat-toolbox-viem>solidity-coverage>hardhat>@nomicfoundation/ethereumjs-tx>ethereum-cryptography>secp256k1": false,
113-
"@nomicfoundation/hardhat-toolbox-viem>solidity-coverage>hardhat>keccak": false,
114-
"@nomicfoundation/hardhat-ignition-viem>@nomicfoundation/hardhat-ignition>hardhat>@nomicfoundation/ethereumjs-tx>ethereum-cryptography>secp256k1": false,
115-
"@nomicfoundation/hardhat-ignition-viem>@nomicfoundation/hardhat-ignition>hardhat>keccak": false
109+
"vitest>vite>esbuild": false,
110+
"vitest>vite>tsx>esbuild": false
116111
}
117112
},
118113
"dependencies": {
@@ -129,35 +124,21 @@
129124
"@metamask/eslint-config": "^12.0.0",
130125
"@metamask/eslint-config-nodejs": "^12.0.0",
131126
"@metamask/eslint-config-typescript": "^12.0.0",
132-
"@nomicfoundation/hardhat-ignition": "^0.15.1",
133-
"@nomicfoundation/hardhat-ignition-viem": "^0.15.0",
134-
"@nomicfoundation/hardhat-network-helpers": "^1.0.9",
135-
"@nomicfoundation/hardhat-toolbox-viem": "^3.0.0",
136-
"@nomicfoundation/hardhat-verify": "^2.0.0",
137-
"@nomicfoundation/hardhat-viem": "^2.0.0",
138-
"@nomicfoundation/ignition-core": "^0.15.1",
139-
"@types/chai": "4",
140-
"@types/chai-as-promised": "^7.1.8",
141-
"@types/mocha": "10.0.2",
142127
"@types/node": "^20.10.6",
143128
"@types/sinon": "^17.0.3",
144129
"@typescript-eslint/eslint-plugin": "^5.42.1",
145130
"@typescript-eslint/parser": "^5.42.1",
146-
"chai": "4",
147-
"chai-as-promised": "^7.1.1",
148131
"dotenv": "^16.3.1",
149132
"eslint": "^8.56.0",
150-
"hardhat": "^2.20.1",
151-
"hardhat-gas-reporter": "^1.0.8",
152133
"import": "^0.0.6",
153134
"prettier": "^3.3.3",
154135
"sinon": "^18.0.0",
155-
"solidity-coverage": "^0.8.1",
156136
"ts-node": "^10.9.2",
157137
"tsconfig-paths": "^4.2.0",
158138
"tsup": "^8.5.0",
159139
"typescript": "5.0.4",
160-
"viem": "2.21.55"
140+
"viem": "2.21.55",
141+
"vitest": "^3.2.4"
161142
},
162143
"peerDependencies": {
163144
"viem": ">=2.18.2 <3.0.0"

packages/delegation-toolkit/test/caveatBuilder/CaveatBuilder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { expect } from 'chai';
21
import { spy } from 'sinon';
32
import { toHex } from 'viem';
3+
import { expect, describe, it, beforeEach } from 'vitest';
44

55
import { CaveatBuilder } from '../../src/caveatBuilder/caveatBuilder';
66
import type { Caveat, DeleGatorEnvironment } from '../../src/types';

packages/delegation-toolkit/test/caveatBuilder/allowedCalldataBuilder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { expect } from 'chai';
21
import { concat, size, toHex, type Hex } from 'viem';
2+
import { expect, describe, it } from 'vitest';
33

44
import { allowedCalldataBuilder } from '../../src/caveatBuilder/allowedCalldataBuilder';
55
import type { DeleGatorEnvironment } from '../../src/types';

packages/delegation-toolkit/test/caveatBuilder/allowedMethodsBuilder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { expect } from 'chai';
21
import { concat, toFunctionSelector, size } from 'viem';
32
import type { AbiFunction, Hex } from 'viem';
3+
import { expect, describe, it } from 'vitest';
44

55
import type { MethodSelector } from '../../src/caveatBuilder/allowedMethodsBuilder';
66
import { allowedMethodsBuilder } from '../../src/caveatBuilder/allowedMethodsBuilder';

packages/delegation-toolkit/test/caveatBuilder/allowedTargetsBuilder.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { expect } from 'chai';
2-
import { concat, size } from 'viem';
3-
import type { Address, Hex } from 'viem';
1+
import { concat, size, type Address, type Hex } from 'viem';
2+
import { expect, describe, it } from 'vitest';
43

54
import { allowedTargetsBuilder } from '../../src/caveatBuilder/allowedTargetsBuilder';
65
import type { DeleGatorEnvironment } from '../../src/types';

packages/delegation-toolkit/test/caveatBuilder/argsEqualityCheckBuilder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { expect } from 'chai';
21
import { size, type Hex } from 'viem';
2+
import { expect, describe, it } from 'vitest';
33

44
import { argsEqualityCheckBuilder } from '../../src/caveatBuilder/argsEqualityCheckBuilder';
55
import type { DeleGatorEnvironment } from '../../src/types';

packages/delegation-toolkit/test/caveatBuilder/blockNumberBuilder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { expect } from 'chai';
21
import { concat, size, toHex } from 'viem';
2+
import { expect, describe, it } from 'vitest';
33

44
import { blockNumberBuilder } from '../../src/caveatBuilder/blockNumberBuilder';
55
import type { DeleGatorEnvironment } from '../../src/types';

0 commit comments

Comments
 (0)