Skip to content

Commit 566a0e8

Browse files
barnjaminbruce-riley
authored andcommitted
SDK: update version script to set peer dep versions (wormhole-foundation#471)
1 parent a54819f commit 566a0e8

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

.github/workflows/publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
3535
npm publish --access public --tag $tag \
3636
--workspace sdk/definitions \
37-
--workspace sdk/evm \
37+
--workspace evm/ts \
3838
--workspace solana \
3939
--workspace sdk/route
4040
env:

sdk/route/__tests__/route.test.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@ import {
55
routes,
66
} from "@wormhole-foundation/sdk-connect";
77

8-
import * as testing from "@wormhole-foundation/sdk-definitions/testing";
9-
108
import "@wormhole-foundation/sdk-definitions-ntt";
119
import "@wormhole-foundation/sdk-evm-ntt";
1210
import "@wormhole-foundation/sdk-solana-ntt";
1311

1412
import { EvmPlatform } from "@wormhole-foundation/sdk-evm";
1513
import { SolanaPlatform } from "@wormhole-foundation/sdk-solana";
14+
import { nttAutomaticRoute } from "../src/automatic.js";
1615
import { nttManualRoute } from "../src/manual.js";
1716
import { NttRoute } from "../src/types.js";
18-
import { nttAutomaticRoute } from "../src/automatic.js";
1917

2018
const SOL_TOKEN = "EetppHswYvV1jjRWoQKC1hejdeBDHR9NNzNtCyRQfrrQ";
2119
const SEPOLIA_TOKEN = "0x738141EFf659625F2eAD4feECDfCD94155C67f18";
@@ -92,14 +90,12 @@ describe("Manual Route Tests", function () {
9290
let found: routes.ManualRoute<Network>;
9391
it("Should resolve a given route request", async function () {
9492
const request = await routes.RouteTransferRequest.create(wh, {
95-
from: testing.utils.makeChainAddress("Solana"),
96-
to: testing.utils.makeChainAddress("Sepolia"),
9793
source: Wormhole.tokenId("Solana", SOL_TOKEN),
9894
destination: Wormhole.tokenId("Sepolia", SEPOLIA_TOKEN),
9995
});
10096
const foundRoutes = await resolver.findRoutes(request);
10197
expect(foundRoutes).toHaveLength(1);
102-
expect(foundRoutes[0]!.request.from.chain).toEqual("Solana");
98+
expect(foundRoutes[0]!.request.fromChain.chain).toEqual("Solana");
10399

104100
const rt = foundRoutes[0]!;
105101
if (!routes.isManual(rt)) throw new Error("Expected manual route");
@@ -185,14 +181,12 @@ describe("Automatic Route Tests", function () {
185181
let found: routes.AutomaticRoute<Network>;
186182
it("Should resolve a given route request", async function () {
187183
const request = await routes.RouteTransferRequest.create(wh, {
188-
from: testing.utils.makeChainAddress("Solana"),
189-
to: testing.utils.makeChainAddress("Sepolia"),
190184
source: Wormhole.tokenId("Solana", SOL_TOKEN),
191185
destination: Wormhole.tokenId("Sepolia", SEPOLIA_TOKEN),
192186
});
193187
const foundRoutes = await resolver.findRoutes(request);
194188
expect(foundRoutes).toHaveLength(1);
195-
expect(foundRoutes[0]!.request.from.chain).toEqual("Solana");
189+
expect(foundRoutes[0]!.request.fromChain.chain).toEqual("Solana");
196190

197191
const rt = foundRoutes[0]!;
198192
if (!routes.isAutomatic(rt)) throw new Error("Expected automatic route");

sdk/route/src/manual.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export class NttManualRoute<N extends Network>
203203
);
204204
const completeTransfer = ntt.completeInboundQueuedTransfer(
205205
toChain.chain,
206-
vaa.payload.nttManagerPayload,
206+
vaa.payload["nttManagerPayload"],
207207
this.request.destination.id.address
208208
);
209209
const finalizeTxids = await signSendWait(toChain, completeTransfer, signer);

setSdkVersion.ts

+9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ function updateVersionInPackageJson(
2020
);
2121
}
2222

23+
if (packageJson.peerDependencies) {
24+
packageJson.peerDependencies = Object.fromEntries(
25+
Object.entries(packageJson.peerDependencies).map((entry) => {
26+
const [k, v] = entry as [string, string];
27+
return [k, packagesInWorkspace.includes(k) ? `${version}` : v];
28+
})
29+
);
30+
}
31+
2332
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
2433
}
2534

0 commit comments

Comments
 (0)