Skip to content

Commit 042b3e2

Browse files
barnjaminbruce-riley
authored andcommitted
Move evm ts to evm directory (wormhole-foundation#465)
1 parent 81238ab commit 042b3e2

Some content is hidden

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

48 files changed

+71
-39
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ build-evm-prod: clean-evm
1717

1818
.PHONY: gen-evm-bindings
1919
gen-evm-bindings: build-evm-prod
20-
npm ci && cd sdk/evm && npm run generate
20+
npm ci && cd evm/ts && npm run generate
2121

2222
#######################
2323
## TESTS

Tiltfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ docker_build(
5151
docker_build(
5252
ref = "ntt-ci",
5353
context = "./",
54-
only=["./sdk", "./package.json", "./package-lock.json", "jest.config.ts", "tsconfig.json", "tsconfig.test.json"],
54+
only=["./sdk", "./package.json", "./package-lock.json", "jest.config.ts", "tsconfig.json", "tsconfig.esm.json", "tsconfig.cjs.json", "tsconfig.test.json"],
5555
dockerfile = "./sdk/Dockerfile",
5656
)
5757
k8s_yaml_with_ns("./sdk/ci.yaml")

evm/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ WORKDIR /app
44
COPY foundry.toml foundry.toml
55
COPY lib lib
66
COPY src src
7+
COPY ts ts
78

89
RUN FOUNDRY_PROFILE=prod forge build
910

1011
FROM scratch AS foundry-export
1112

1213
COPY --from=builder /app/out .
14+
COPY --from=builder /app/ts ts

evm/ts/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
ethers-ci-contracts
3+
contracts.json

sdk/evm/README.md evm/ts/README.md

File renamed without changes.
File renamed without changes.

sdk/evm/package.json evm/ts/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
"build": "npm run build:esm && npm run build:cjs",
3838
"rebuild": "npm run clean && npm run build",
3939
"clean": "rm -rf ./dist",
40-
"generate:test": "typechain --node16-modules --target ethers-v6 --out-dir ethers-ci-contracts '../../evm/out/**/*.json'",
41-
"generate:slim": "ABI_VERSION=`tsx scripts/readVersion.ts` && typechain --node16-modules --target ethers-v6 --out-dir src/ethers-contracts/$ABI_VERSION '../../evm/out/?(WormholeTransceiver.sol|NttManager.sol)/*.json'",
40+
"generate:test": "typechain --node16-modules --target ethers-v6 --out-dir ethers-ci-contracts '../out/**/*.json'",
41+
"generate:slim": "ABI_VERSION=`tsx scripts/readVersion.ts` && typechain --node16-modules --target ethers-v6 --out-dir src/ethers-contracts/$ABI_VERSION '../out/?(WormholeTransceiver.sol|NttManager.sol)/*.json'",
4242
"generate": "npm run generate:slim",
4343
"build:contracts": "cd ../.. && make build-evm-prod",
4444
"test": "jest --config ./jest.config.ts"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

sdk/evm/tsconfig.cjs.json evm/ts/tsconfig.cjs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../tsconfig.cjs.json",
2+
"extends": "../../tsconfig.cjs.json",
33
"include": ["src"],
44
"compilerOptions": {
55
"outDir": "dist/cjs",

sdk/evm/tsconfig.esm.json evm/ts/tsconfig.esm.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../tsconfig.esm.json",
2+
"extends": "../../tsconfig.esm.json",
33
"include": ["src"],
44
"compilerOptions": {
55
"outDir": "dist/esm",
File renamed without changes.

package-lock.json

+38-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"workspaces": [
3232
"sdk/definitions",
33-
"sdk/evm",
33+
"evm/ts",
3434
"solana",
3535
"sdk/route",
3636
"sdk/examples",

sdk/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ COPY --from=ntt-solana-contract /usr/src/solana/tsconfig.esm.json solana/tsconfi
88
COPY --from=ntt-solana-contract /usr/src/solana/tsconfig.cjs.json solana/tsconfig.cjs.json
99
COPY --from=ntt-solana-contract /usr/src/solana/target/idl solana/target/idl
1010
COPY --from=ntt-solana-contract /usr/src/solana/target/types solana/target/types
11+
12+
COPY --from=ntt-evm-contract ts evm/ts
1113
COPY --from=ntt-evm-contract . evm/out
1214

15+
RUN rm -rf evm/out/ts
16+
17+
1318
COPY . ./
1419
RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
1520
npm ci

sdk/__tests__/utils.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ import solana from "@wormhole-foundation/sdk/platforms/solana";
2323

2424
import { ethers } from "ethers";
2525

26-
import { DummyTokenMintAndBurn__factory } from "../evm/ethers-ci-contracts/factories/DummyToken.sol/DummyTokenMintAndBurn__factory.js";
27-
import { DummyToken__factory } from "../evm/ethers-ci-contracts/factories/DummyToken.sol/DummyToken__factory.js";
28-
import { ERC1967Proxy__factory } from "../evm/ethers-ci-contracts/factories/ERC1967Proxy__factory.js";
29-
import { IWormholeRelayer__factory } from "../evm/ethers-ci-contracts/factories/IWormholeRelayer.sol/IWormholeRelayer__factory.js";
30-
import { NttManager__factory } from "../evm/ethers-ci-contracts/factories/NttManager__factory.js";
31-
import { TransceiverStructs__factory } from "../evm/ethers-ci-contracts/factories/TransceiverStructs__factory.js";
32-
import { TrimmedAmountLib__factory } from "../evm/ethers-ci-contracts/factories/TrimmedAmount.sol/TrimmedAmountLib__factory.js";
33-
import { WormholeTransceiver__factory } from "../evm/ethers-ci-contracts/factories/WormholeTransceiver__factory.js";
26+
import { DummyTokenMintAndBurn__factory } from "../../evm/ts/ethers-ci-contracts/factories/DummyToken.sol/DummyTokenMintAndBurn__factory.js";
27+
import { DummyToken__factory } from "../../evm/ts/ethers-ci-contracts/factories/DummyToken.sol/DummyToken__factory.js";
28+
import { ERC1967Proxy__factory } from "../../evm/ts/ethers-ci-contracts/factories/ERC1967Proxy__factory.js";
29+
import { IWormholeRelayer__factory } from "../../evm/ts/ethers-ci-contracts/factories/IWormholeRelayer.sol/IWormholeRelayer__factory.js";
30+
import { NttManager__factory } from "../../evm/ts/ethers-ci-contracts/factories/NttManager__factory.js";
31+
import { TransceiverStructs__factory } from "../../evm/ts/ethers-ci-contracts/factories/TransceiverStructs__factory.js";
32+
import { TrimmedAmountLib__factory } from "../../evm/ts/ethers-ci-contracts/factories/TrimmedAmount.sol/TrimmedAmountLib__factory.js";
33+
import { WormholeTransceiver__factory } from "../../evm/ts/ethers-ci-contracts/factories/WormholeTransceiver__factory.js";
3434

3535
import solanaTiltKey from "./solana-tilt.json"; // from https://github.com/wormhole-foundation/wormhole/blob/main/solana/keys/solana-devnet.json
3636

3737
import { Ntt } from "../definitions/src/index.js";
38-
import "../evm/src/index.js";
38+
import "../../evm/ts/src/index.js";
3939
import "../../solana/ts/sdk/index.js";
4040
import { SolanaNtt } from "../../solana/ts/sdk/index.js";
4141
import { submitAccountantVAA } from "./accountant.js";

sdk/definitions/tsconfig.cjs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../tsconfig.cjs.json",
2+
"extends": "../../tsconfig.cjs.json",
33
"include": ["src"],
44
"compilerOptions": {
55
"outDir": "dist/cjs",

sdk/definitions/tsconfig.esm.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../tsconfig.esm.json",
2+
"extends": "../../tsconfig.esm.json",
33
"include": ["src"],
44
"compilerOptions": {
55
"outDir": "dist/esm",

sdk/examples/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../tsconfig.esm.json",
2+
"extends": "../../tsconfig.esm.json",
33
"include": ["src/**/*.ts", "src/**/*.json"],
44
"compilerOptions": {
55
"rootDir": "src",

sdk/route/tsconfig.cjs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../tsconfig.cjs.json",
2+
"extends": "../../tsconfig.cjs.json",
33
"include": ["src"],
44
"compilerOptions": {
55
"outDir": "dist/cjs",

sdk/route/tsconfig.esm.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../tsconfig.esm.json",
2+
"extends": "../../tsconfig.esm.json",
33
"include": ["src"],
44
"compilerOptions": {
55
"outDir": "dist/esm",

sdk/tsconfig.cjs.json tsconfig.cjs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../tsconfig.json",
2+
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"module": "CommonJS",
55
"moduleResolution": "Node"

sdk/tsconfig.esm.json tsconfig.esm.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../tsconfig.json",
2+
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"module": "NodeNext",
55
"moduleResolution": "NodeNext"

0 commit comments

Comments
 (0)