From 49c9bc0dde93932519f55a149f708c5125dc25ec Mon Sep 17 00:00:00 2001 From: nvsriram Date: Mon, 28 Oct 2024 18:52:02 -0400 Subject: [PATCH] solana: Update `verifyAddreses` to return wormhole transceiver as `emitterAccount` --- cli/src/index.ts | 2 +- solana/ts/sdk/ntt.ts | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/cli/src/index.ts b/cli/src/index.ts index a0de0e80..039a097d 100755 --- a/cli/src/index.ts +++ b/cli/src/index.ts @@ -1798,7 +1798,7 @@ async function nttFromManager( ntt: { manager: nativeManagerAddress, token: null, - transceiver: { "wormhole": nativeManagerAddress }, + transceiver: {}, } }); const diff = await onlyManager.verifyAddresses(); diff --git a/solana/ts/sdk/ntt.ts b/solana/ts/sdk/ntt.ts index 994979b0..3ff494b6 100644 --- a/solana/ts/sdk/ntt.ts +++ b/solana/ts/sdk/ntt.ts @@ -1183,16 +1183,28 @@ export class SolanaNtt } async verifyAddresses(): Promise | null> { - // NOTE: transceivers are not being compared as there is no reverse lookup - // given manager address to the registered transceivers + // NOTE: This function should only be called when the wormhole transceiver is the manager. + // For the generic transceiver case, transceivers can not be compared as there is no + // reverse lookup given manager address to the registered transceivers. + const whTransceiver = await this.getWormholeTransceiver(); const local: Partial = { manager: this.managerAddress, token: this.tokenAddress, + transceiver: { + ...(whTransceiver && { + wormhole: whTransceiver.pdas.emitterAccount().toBase58(), + }), + }, }; const remote: Partial = { manager: this.program.programId.toBase58(), token: (await this.getConfig()).mint.toBase58(), + transceiver: { + wormhole: NTT.transceiverPdas(this.program.programId) + .emitterAccount() + .toBase58(), + }, }; const deleteMatching = (a: any, b: any) => {