From 3d5d8fe128708c81889bf2817ad0f36ab01156db Mon Sep 17 00:00:00 2001 From: sujithsomraaj Date: Wed, 22 May 2024 17:29:55 +0530 Subject: [PATCH] chore: add support for token bridge attestation --- src/wormhole/specialized-relayer/WormholeHelper.sol | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wormhole/specialized-relayer/WormholeHelper.sol b/src/wormhole/specialized-relayer/WormholeHelper.sol index e23a6c0..9b6a9d8 100644 --- a/src/wormhole/specialized-relayer/WormholeHelper.sol +++ b/src/wormhole/specialized-relayer/WormholeHelper.sol @@ -10,6 +10,7 @@ import {TypeCasts} from "../../libraries/TypeCasts.sol"; interface IWormholeReceiver { function receiveMessage(bytes memory encodedMessage) external; + function createWrapped(bytes memory encodedVm) external returns (address token); } /// @title WormholeHelper @@ -168,7 +169,11 @@ contract WormholeHelper is Test { ); /// @dev delivers the message by passing the new guardian set to receiver - IWormholeReceiver(dstTarget).receiveMessage(encodedVAA); + try IWormholeReceiver(dstTarget).receiveMessage(encodedVAA) {} + catch { + /// TODO: implement enum for delivery types to support nft and token bridges + IWormholeReceiver(dstTarget).createWrapped(encodedVAA); + } } }