wormhole-foundation / wormhole-sdk-ts

Wormhole TypeScript SDK
https://wormhole-foundation.github.io/wormhole-sdk-ts/
Apache License 2.0
39 stars 46 forks source link

Error: Circle chain id not found for Testnet Sepolia when running a manual transfer #668

Open therealsuji opened 1 month ago

therealsuji commented 1 month ago

When running a manual transfer using the wormhole connect sdk for CCTP, Use this example https://github.com/wormhole-foundation/wormhole-sdk-ts/blob/develop/examples/src/cctp.ts. The transaction fails to initialise, for the following chains

Source -> Testnet Sepolia Destination -> Testnet Solana

this error is thrown

file:///path/Wormhole%20SDK%20Examples/node_modules/.pnpm/@wormhole-foundation+sdk-evm-cctp@0.5.0_bufferutil@4.0.8_typescript@5.5.4_utf-8-validate@5.0.10/node_modules/@wormhole-foundation/sdk-evm-cctp/dist/esm/circleBridge.js:28
            throw new Error(`Circle chain id not found for ${network} ${chain}`);
                  ^
Error: Circle chain id not found for Testnet Sepolia

I found the offending line and it seems the check does a falsy check, but the circle chain id for testnet sepolia is 0, causing it to throw an error

https://github.com/wormhole-foundation/wormhole-sdk-ts/blob/b61b10191043430dfe1111baa6ad13a71a69bc29/platforms/evm/protocols/cctp/src/circleBridge.ts#L63

obumnwabude commented 1 week ago

Yes, this was the case previously because Sepolia was previously emitted in the list of finalities of chains at https://github.com/wormhole-foundation/wormhole-sdk-ts/blob/main/core/base/src/constants/finality.ts

But @evgeniko recently added it in PR #688, so problem should be solved now.