Skip to content

Commit

Permalink
chore: add support for token bridge attestation (#37)
Browse files Browse the repository at this point in the history
* chore: add support for token bridge attestation

* chore: fix snapshot
  • Loading branch information
sujithsomraaj authored May 22, 2024
1 parent f1984d4 commit 11743db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ WormholeAutomaticRelayerHelperTest:testFancyWormhole() (gas: 223380)
WormholeAutomaticRelayerHelperTest:testMultiDstWormhole() (gas: 344783)
WormholeAutomaticRelayerHelperTest:testMultiDstWormholeWithAdditionalVAA() (gas: 374508)
WormholeAutomaticRelayerHelperTest:testSimpleWormhole() (gas: 176992)
WormholeSpecializedRelayerHelperTest:testCustomOrderingWormhole() (gas: 598833)
WormholeSpecializedRelayerHelperTest:testFancyWormhole() (gas: 332004)
WormholeSpecializedRelayerHelperTest:testMultiDstWormhole() (gas: 635118)
WormholeSpecializedRelayerHelperTest:testSimpleWormhole() (gas: 334796)
WormholeSpecializedRelayerHelperTest:testCustomOrderingWormhole() (gas: 598867)
WormholeSpecializedRelayerHelperTest:testFancyWormhole() (gas: 332021)
WormholeSpecializedRelayerHelperTest:testMultiDstWormhole() (gas: 635152)
WormholeSpecializedRelayerHelperTest:testSimpleWormhole() (gas: 334813)
7 changes: 6 additions & 1 deletion src/wormhole/specialized-relayer/WormholeHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit 11743db

Please sign in to comment.