-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(contracts-rfq): Multicall in FastBridgeV2 [SLT-369] (#3315)
* refactor: dedupe integration test template * test: V2 multicall integration * feat: add multicall features to FastBridgeV2 * Parod/fb v2 multicall add test (#3335) * add manyActions multicall test * increase manyAction count * comment cleanup --------- Co-authored-by: parodime <[email protected]>
- Loading branch information
1 parent
89ec9d4
commit 1daa5f4
Showing
3 changed files
with
282 additions
and
26 deletions.
There are no files selected for viewing
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
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); | ||
} | ||
} |
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