Skip to content

Commit 1e8e7fb

Browse files
authored
connect: Wormhole pass config to platform constructors (#660)
We were not passing the config, which may contain overrides, to the platform constructors in the Wormhole class. This was causing the default RPCs to get used even if they were overridden in the config.
1 parent e91bcce commit 1e8e7fb

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

connect/src/protocols/cctp/cctpTransfer.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Chain, Network } from "@wormhole-foundation/sdk-base";
2-
import { circle, encoding, toChain } from "@wormhole-foundation/sdk-base";
2+
import { circle, encoding, finality, toChain } from "@wormhole-foundation/sdk-base";
33
import type {
44
Attestation,
55
AttestationId,
@@ -43,7 +43,6 @@ import {
4343
} from "../../types.js";
4444
import { Wormhole } from "../../wormhole.js";
4545
import type { WormholeTransfer } from "../wormholeTransfer.js";
46-
import { finality } from "@wormhole-foundation/sdk-base";
4746

4847
export class CircleTransfer<N extends Network = Network>
4948
implements WormholeTransfer<CircleTransfer.Protocol>

connect/src/routes/portico/automatic.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { filters } from "@wormhole-foundation/sdk-base";
1+
import { filters, finality } from "@wormhole-foundation/sdk-base";
22
import type { StaticRouteMethods } from "../route.js";
33
import { AutomaticRoute } from "../route.js";
44
import type {
@@ -36,7 +36,6 @@ import {
3636
} from "./../../index.js";
3737
import type { ChainAddress } from "@wormhole-foundation/sdk-definitions";
3838
import type { RouteTransferRequest } from "../request.js";
39-
import { finality } from "@wormhole-foundation/sdk-base";
4039

4140
export const SLIPPAGE_BPS = 15n; // 0.15%
4241
export const BPS_PER_HUNDRED_PERCENT = 10000n;

connect/src/wormhole.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type {
1212
TokenAddress,
1313
TokenId,
1414
TxHash,
15+
UniversalAddress,
1516
WormholeMessageId,
1617
deserialize,
1718
} from "@wormhole-foundation/sdk-definitions";
@@ -39,7 +40,6 @@ import {
3940
getVaaBytesWithRetry,
4041
getVaaWithRetry,
4142
} from "./whscan-api.js";
42-
import { UniversalAddress } from "@wormhole-foundation/sdk-definitions";
4343

4444
type PlatformMap<N extends Network, P extends Platform = Platform> = Map<P, PlatformContext<N, P>>;
4545
type ChainMap<N extends Network, C extends Chain = Chain> = Map<C, ChainContext<N, C>>;
@@ -58,7 +58,7 @@ export class Wormhole<N extends Network> {
5858
this._chains = new Map();
5959
this._platforms = new Map();
6060
for (const p of platforms) {
61-
this._platforms.set(p._platform, new p(network));
61+
this._platforms.set(p._platform, new p(network, this.config.chains));
6262
}
6363
}
6464

0 commit comments

Comments
 (0)