-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37bce6a
commit 1a9155b
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
packages/contracts-rfq/test/integration/FastBridgeV2.MulticallTarget.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
import {FastBridgeV2, IFastBridgeV2} from "../../contracts/FastBridgeV2.sol"; | ||
import {BridgeTransactionV2Lib} from "../../contracts/libs/BridgeTransactionV2.sol"; | ||
|
||
import {MulticallTargetIntegrationTest, IFastBridge} from "./MulticallTarget.t.sol"; | ||
|
||
contract FastBridgeV2MulticallTargetTest is MulticallTargetIntegrationTest { | ||
function deployAndConfigureFastBridge() public override returns (address) { | ||
FastBridgeV2 fastBridge = new FastBridgeV2(address(this)); | ||
fastBridge.grantRole(fastBridge.RELAYER_ROLE(), relayer); | ||
return address(fastBridge); | ||
} | ||
|
||
function getEncodedBridgeTx(IFastBridge.BridgeTransaction memory bridgeTx) | ||
public | ||
view | ||
override | ||
returns (bytes memory) | ||
{ | ||
IFastBridgeV2.BridgeTransactionV2 memory bridgeTxV2; | ||
bridgeTxV2.originChainId = bridgeTx.originChainId; | ||
bridgeTxV2.destChainId = bridgeTx.destChainId; | ||
bridgeTxV2.originSender = bridgeTx.originSender; | ||
bridgeTxV2.destRecipient = bridgeTx.destRecipient; | ||
bridgeTxV2.originToken = bridgeTx.originToken; | ||
bridgeTxV2.destToken = bridgeTx.destToken; | ||
bridgeTxV2.originAmount = bridgeTx.originAmount; | ||
bridgeTxV2.destAmount = bridgeTx.destAmount; | ||
bridgeTxV2.originFeeAmount = bridgeTx.originFeeAmount; | ||
bridgeTxV2.deadline = bridgeTx.deadline; | ||
bridgeTxV2.nonce = bridgeTx.nonce; | ||
bridgeTxV2.exclusivityEndTime = block.timestamp; | ||
return BridgeTransactionV2Lib.encodeV2(bridgeTxV2); | ||
} | ||
} |