From 0519f296eb1016d1e0734ead9a878d118ad9b78c Mon Sep 17 00:00:00 2001 From: Oliver Townsend <133903322+ogtownsend@users.noreply.github.com> Date: Thu, 27 Jun 2024 08:51:56 -0700 Subject: [PATCH] [LM] Update arb l1 to l2 event matching logic (#1089) Previously: - LiquidityManager's `LiquidityTransferred` events were matched to the Arbitrum native bridge's `DepositFinalized` events by sorting all events by block timestamp and assuming they would all come in order. However, it's technically possible for them to come out of order. For example: ``` Send: s1 s2 s3 s4 Finalized: f1 f2 f4 f3 ``` - In this case, we'd attempt to receive transfer 3 which would not yet be ready. This PR: - To get around this, we'll strictly check on the `amount` fields emitted in both events instead of relying on timestamp ordering - Does some refactoring to pull some test util functions into a common test utils file that can be accessed by both arb and op packages. --- .../liquiditymanager/bridge/arb/l1_to_l2.go | 51 ++- .../bridge/arb/l1_to_l2_test.go | 294 +++++++++++++++++- .../bridge/opstack/common_test.go | 30 +- .../bridge/opstack/l1_to_l2_test.go | 63 ++-- .../bridge/opstack/l2_to_l1_test.go | 39 +-- .../test_utils.go} | 10 +- 6 files changed, 383 insertions(+), 104 deletions(-) rename core/services/ocr2/plugins/liquiditymanager/bridge/{opstack/test_helper.go => testutils/test_utils.go} (83%) diff --git a/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l1_to_l2.go b/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l1_to_l2.go index cebfb9de34..725fe52c6c 100644 --- a/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l1_to_l2.go +++ b/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l1_to_l2.go @@ -242,16 +242,6 @@ func (l *l1ToL2Bridge) GetTransfers( return nil, err } - slices.SortFunc(sendLogs, func(a, b logpoller.Log) int { - return a.BlockTimestamp.Compare(b.BlockTimestamp) - }) - slices.SortFunc(depositFinalizedLogs, func(a, b logpoller.Log) int { - return a.BlockTimestamp.Compare(b.BlockTimestamp) - }) - slices.SortFunc(receiveLogs, func(a, b logpoller.Log) int { - return a.BlockTimestamp.Compare(b.BlockTimestamp) - }) - lggr.Infow("got logs", "sendLogs", len(sendLogs), "depositFinalizedLogs", len(depositFinalizedLogs), @@ -285,11 +275,7 @@ func (l *l1ToL2Bridge) GetTransfers( // event, such as the l1 to l2 tx id. This is only available as part of the calldata for when the L2 calls // submitRetryable on the ArbRetryableTx precompile. // e.g https://sepolia.arbiscan.io/tx/0xce0d0d7e74f184fa8cb264b6d9aab5ced159faf3d0d9ae54b67fd40ba9d965a7 - // therefore we're kind of relegated here to doing a simple count check - filter out all of the - // LiquidityTransferred logs destined for the liquidityManager on L2 and all the DepositFinalized logs that - // pay out to the liquidityManager on L2. - // We can _probably_ assume that the earlier LiquidityTransferred logs on L1 - // are more likely to be finalizedNotExecuted than later ones. + // therefore we're kind of relegated here to simply checking on the `amount` transferred. notReady, ready, readyData, err := partitionTransfers( localToken, l.l1BridgeAdapter.Address(), @@ -412,7 +398,6 @@ func (l *l1ToL2Bridge) toPendingTransfers( return transfers, nil } -// precondition: the input logs are already sorted in time-ascending order func partitionTransfers( localToken models.Address, l1BridgeAdapterAddress common.Address, @@ -427,25 +412,23 @@ func partitionTransfers( err error, ) { effectiveDepositFinalized := getEffectiveEvents(localToken, l1BridgeAdapterAddress, l2LiquidityManagerAddress, depositFinalizedLogs) - // determine ready and not ready first - if len(sentLogs) > len(effectiveDepositFinalized) { - // more sent than have been finalized - for i := len(sentLogs) - len(effectiveDepositFinalized) + 1; i < len(sentLogs); i++ { - notReady = append(notReady, sentLogs[i]) + + // Loop through sentLogs and find an effectiveDepositFinalized log with a matching 'amount' and 'to' address. + // If found, it is ready to be received by L2 LM. If not found, it still needs to be finalized. + for _, sentLog := range sentLogs { + var found bool + for _, depFinalized := range effectiveDepositFinalized { + if sentLog.Amount.Cmp(depFinalized.Amount) == 0 && sentLog.To == depFinalized.To { + ready = append(ready, sentLog) + found = true + break + } } - for i := 0; i < (len(sentLogs) - len(effectiveDepositFinalized)); i++ { - ready = append(ready, sentLogs[i]) + if !found { + notReady = append(notReady, sentLog) } - } else if len(sentLogs) < len(effectiveDepositFinalized) { - // more finalized than have been sent - should be impossible - // TODO: what if a rebalance is triggered at T=0, the sent log is emitted at t=1 - // and the DepositFinalized log is emitted at T=2, and our query goes back to T=2. There will be - // 1 DepositFinalized log and 0 sent logs. Maybe drop this condition and just do the matching - return nil, nil, nil, fmt.Errorf("got more finalized logs than sent - should be impossible: len(sent) = %d, len(finalized) = %d", - len(sentLogs), len(effectiveDepositFinalized)) - } else { - ready = sentLogs } + // figure out if any of the ready have been executed ready, err = filterExecuted(ready, receivedLogs) if err != nil { @@ -497,6 +480,10 @@ func matchingExecutionExists( err, hexutil.Encode(recvLog.BridgeSpecificData)) } if sendL1ToL2TxId.Cmp(recvL1ToL2TxId) == 0 { + if readyCandidate.Amount.Cmp(recvLog.Amount) != 0 { + return false, fmt.Errorf("bridge data matched but amount mismatched: send amount %s, receive amount %s", + readyCandidate.Amount, recvLog.Amount) + } return true, nil } } diff --git a/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l1_to_l2_test.go b/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l1_to_l2_test.go index 64f85ba06e..6206a212fc 100644 --- a/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l1_to_l2_test.go +++ b/core/services/ocr2/plugins/liquiditymanager/bridge/arb/l1_to_l2_test.go @@ -14,6 +14,8 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + bridgetestutils "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/liquiditymanager/bridge/testutils" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" evmclientmocks "github.com/smartcontractkit/chainlink/v2/core/chains/evm/client/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/logpoller" @@ -753,6 +755,11 @@ func Test_filterExecuted(t *testing.T) { } func Test_partitionTransfers(t *testing.T) { + var ( + localToken = testutils.NewAddress() + l1BridgeAdapterAddress = testutils.NewAddress() + l2LiquidityManagerAddress = testutils.NewAddress() + ) type args struct { localToken models.Address l1BridgeAdapterAddress common.Address @@ -768,7 +775,288 @@ func Test_partitionTransfers(t *testing.T) { wantReady []*liquiditymanager.LiquidityManagerLiquidityTransferred wantReadyData [][]byte wantErr bool - }{} + }{ + { + name: "happy path - one ready, one not ready, one already received", + args: args{ + localToken: models.Address(localToken), + l1BridgeAdapterAddress: l1BridgeAdapterAddress, + l2LiquidityManagerAddress: l2LiquidityManagerAddress, + sentLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + // Amount = 100, ready + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + }, + // Amount = 200, not ready + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(200), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + }, + // Amount = 300, already received + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(300), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), + }, + }, + depositFinalizedLogs: []*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized{ + // Amount = 100, ready + { + L1Token: localToken, + From: l1BridgeAdapterAddress, + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + }, + // Amount = 300, already received + { + L1Token: localToken, + From: l1BridgeAdapterAddress, + To: l2LiquidityManagerAddress, + Amount: big.NewInt(300), + }, + }, + receivedLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + // Amount = 300, already received + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(300), + BridgeSpecificData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), + }, + }, + }, + wantNotReady: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + // Amount = 200, not ready + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(200), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + }, + }, + wantReady: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + // Amount = 100, ready + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + }}, + wantReadyData: [][]byte{bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001")}, + wantErr: false, + }, + { + name: "mismatched token address", + args: args{ + localToken: models.Address(localToken), + l1BridgeAdapterAddress: l1BridgeAdapterAddress, + l2LiquidityManagerAddress: l2LiquidityManagerAddress, + sentLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + }, + }, + depositFinalizedLogs: []*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized{ + { + L1Token: testutils.NewAddress(), // Mismatched address + From: l1BridgeAdapterAddress, + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + }, + }, + receivedLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{}, + }, + wantNotReady: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + }, + }, + wantReady: []*liquiditymanager.LiquidityManagerLiquidityTransferred{}, + wantReadyData: nil, + wantErr: false, + }, + { + name: "mismatched deposit finalized From address", + args: args{ + localToken: models.Address(localToken), + l1BridgeAdapterAddress: l1BridgeAdapterAddress, + l2LiquidityManagerAddress: l2LiquidityManagerAddress, + sentLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + }, + }, + depositFinalizedLogs: []*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized{ + { + L1Token: localToken, + From: testutils.NewAddress(), // Mismatched address + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + }, + }, + receivedLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{}, + }, + wantNotReady: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + }, + }, + wantReady: []*liquiditymanager.LiquidityManagerLiquidityTransferred{}, + wantReadyData: nil, + wantErr: false, + }, + { + name: "mismatched deposit finalized To address", + args: args{ + localToken: models.Address(localToken), + l1BridgeAdapterAddress: l1BridgeAdapterAddress, + l2LiquidityManagerAddress: l2LiquidityManagerAddress, + sentLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + }, + }, + depositFinalizedLogs: []*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized{ + { + L1Token: localToken, + From: l1BridgeAdapterAddress, + To: testutils.NewAddress(), // Mismatched address + Amount: big.NewInt(100), + }, + }, + receivedLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{}, + }, + wantNotReady: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + }, + }, + wantReady: []*liquiditymanager.LiquidityManagerLiquidityTransferred{}, + wantReadyData: nil, + wantErr: false, + }, + { + name: "mismatched deposit finalized amount", + args: args{ + localToken: models.Address(localToken), + l1BridgeAdapterAddress: l1BridgeAdapterAddress, + l2LiquidityManagerAddress: l2LiquidityManagerAddress, + sentLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + }, + }, + depositFinalizedLogs: []*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized{ + { + L1Token: localToken, + From: l1BridgeAdapterAddress, + To: l2LiquidityManagerAddress, + Amount: big.NewInt(200), // Mismatched amount + }, + }, + receivedLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{}, + }, + wantNotReady: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + }, + }, + wantReady: []*liquiditymanager.LiquidityManagerLiquidityTransferred{}, + wantReadyData: nil, + wantErr: false, + }, + { + name: "amount matching for dep finalized event but mismatched for received log, should never happen", + args: args{ + localToken: models.Address(localToken), + l1BridgeAdapterAddress: l1BridgeAdapterAddress, + l2LiquidityManagerAddress: l2LiquidityManagerAddress, + sentLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + }, + }, + depositFinalizedLogs: []*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized{ + { + L1Token: localToken, + From: l1BridgeAdapterAddress, + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + }, + }, + receivedLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(200), // Mismatched amount + BridgeSpecificData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + }, + }, + }, + wantNotReady: nil, + wantReady: nil, + wantReadyData: nil, + wantErr: true, + }, + { + name: "mismatched bridge specific data for received event", + args: args{ + localToken: models.Address(localToken), + l1BridgeAdapterAddress: l1BridgeAdapterAddress, + l2LiquidityManagerAddress: l2LiquidityManagerAddress, + sentLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + }, + }, + depositFinalizedLogs: []*l2_arbitrum_gateway.L2ArbitrumGatewayDepositFinalized{ + { + L1Token: localToken, + From: l1BridgeAdapterAddress, + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + }, + }, + receivedLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + // Mismatched bridge specific data + BridgeSpecificData: bridgetestutils.MustPackBridgeData(t, "0x1111000000000000000000000000000000000000000000000000000000000001"), + }, + }, + }, + wantNotReady: []*liquiditymanager.LiquidityManagerLiquidityTransferred{}, + wantReady: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ + { + To: l2LiquidityManagerAddress, + Amount: big.NewInt(100), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + }, + }, + wantReadyData: [][]byte{bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001")}, + wantErr: false, + }, + } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { gotNotReady, gotReady, gotReadyData, err := partitionTransfers(tt.args.localToken, tt.args.l1BridgeAdapterAddress, tt.args.l2LiquidityManagerAddress, tt.args.sentLogs, tt.args.depositFinalizedLogs, tt.args.receivedLogs) @@ -776,8 +1064,8 @@ func Test_partitionTransfers(t *testing.T) { require.Error(t, err) } else { require.NoError(t, err) - require.Equal(t, tt.wantNotReady, gotNotReady) - require.Equal(t, tt.wantReady, gotReady) + bridgetestutils.AssertLiquidityTransferredEventSlicesEqual(t, tt.wantNotReady, gotNotReady, bridgetestutils.SortByBridgeReturnData) + bridgetestutils.AssertLiquidityTransferredEventSlicesEqual(t, tt.wantReady, gotReady, bridgetestutils.SortByBridgeReturnData) require.Equal(t, tt.wantReadyData, gotReadyData) } }) diff --git a/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/common_test.go b/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/common_test.go index 38cd734ccb..65f7670bdd 100644 --- a/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/common_test.go +++ b/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/common_test.go @@ -9,6 +9,8 @@ import ( chainsel "github.com/smartcontractkit/chain-selectors" "github.com/stretchr/testify/require" + bridgetestutils "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/liquiditymanager/bridge/testutils" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/liquiditymanager" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/optimism_standard_bridge" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" @@ -113,7 +115,7 @@ func Test_filterExecuted(t *testing.T) { ToChainSelector: l2ChainSelector, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), BridgeSpecificData: []byte{}, }, }, @@ -125,7 +127,7 @@ func Test_filterExecuted(t *testing.T) { ToChainSelector: l2ChainSelector, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), BridgeSpecificData: []byte{}, }, }, @@ -141,7 +143,7 @@ func Test_filterExecuted(t *testing.T) { To: l2LiquidityManagerAddress, Amount: big.NewInt(1), // nonce = 1 - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), BridgeSpecificData: []byte{}, }, }, @@ -153,7 +155,7 @@ func Test_filterExecuted(t *testing.T) { Amount: big.NewInt(1), BridgeReturnData: []byte{}, // nonce = 2 - BridgeSpecificData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + BridgeSpecificData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), }}, }, wantReady: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ @@ -163,7 +165,7 @@ func Test_filterExecuted(t *testing.T) { To: l2LiquidityManagerAddress, Amount: big.NewInt(1), // nonce = 1 - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), BridgeSpecificData: []byte{}, }, }, @@ -179,7 +181,7 @@ func Test_filterExecuted(t *testing.T) { To: l2LiquidityManagerAddress, Amount: big.NewInt(1), // nonce = 1 - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), BridgeSpecificData: []byte{}, }, }, @@ -191,7 +193,7 @@ func Test_filterExecuted(t *testing.T) { Amount: big.NewInt(1), BridgeReturnData: []byte{}, // nonce = 1 - BridgeSpecificData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + BridgeSpecificData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), }}, }, wantReady: []*liquiditymanager.LiquidityManagerLiquidityTransferred{}, @@ -207,7 +209,7 @@ func Test_filterExecuted(t *testing.T) { To: l2LiquidityManagerAddress, Amount: big.NewInt(1), // nonce = 1, is executed - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), BridgeSpecificData: []byte{}, }, { @@ -216,7 +218,7 @@ func Test_filterExecuted(t *testing.T) { To: l2LiquidityManagerAddress, Amount: big.NewInt(1), // nonce = 2, not executed - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), BridgeSpecificData: []byte{}, }, { @@ -225,7 +227,7 @@ func Test_filterExecuted(t *testing.T) { To: l2LiquidityManagerAddress, Amount: big.NewInt(1), // nonce = 3, is executed - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), BridgeSpecificData: []byte{}, }, }, @@ -237,7 +239,7 @@ func Test_filterExecuted(t *testing.T) { Amount: big.NewInt(1), BridgeReturnData: []byte{}, // nonce = 1 - BridgeSpecificData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + BridgeSpecificData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), }, { FromChainSelector: l1ChainSelector, @@ -246,7 +248,7 @@ func Test_filterExecuted(t *testing.T) { Amount: big.NewInt(1), BridgeReturnData: []byte{}, // nonce = 3 - BridgeSpecificData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), + BridgeSpecificData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), }, }, }, @@ -258,7 +260,7 @@ func Test_filterExecuted(t *testing.T) { To: l2LiquidityManagerAddress, Amount: big.NewInt(1), // nonce = 2 - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), BridgeSpecificData: []byte{}, }, }, @@ -272,7 +274,7 @@ func Test_filterExecuted(t *testing.T) { require.Error(t, err) } else { require.NoError(t, err) - assertLiquidityTransferredEventSlicesEqual(t, tt.wantReady, gotReady, sortByBridgeReturnData) + bridgetestutils.AssertLiquidityTransferredEventSlicesEqual(t, tt.wantReady, gotReady, bridgetestutils.SortByBridgeReturnData) } }) } diff --git a/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l1_to_l2_test.go b/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l1_to_l2_test.go index be4c6419cc..c689af5b76 100644 --- a/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l1_to_l2_test.go +++ b/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l1_to_l2_test.go @@ -16,6 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/optimism_standard_bridge" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/liquiditymanager/abiutils" + bridgetestutils "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/liquiditymanager/bridge/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/liquiditymanager/models" ) @@ -43,9 +44,9 @@ func Test_l1ToL2Bridge_QuorumizedBridgePayload(t *testing.T) { "non-matching nonces/payloads", args{ [][]byte{ - mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), - mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), - mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), + bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), }, 1, }, @@ -56,25 +57,25 @@ func Test_l1ToL2Bridge_QuorumizedBridgePayload(t *testing.T) { "happy path", args{ [][]byte{ - mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), - mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), - mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), }, 1, }, - mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), false, }, { "happy path, fewer payloads", args{ [][]byte{ - mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), - mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), }, 1, }, - mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), false, }, } @@ -148,7 +149,7 @@ func Test_partitionTransfers(t *testing.T) { ToChainSelector: l2ChainSelector, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), BridgeSpecificData: []byte{}, }, // This one is ready (present in sentLogs and finalized logs) @@ -157,7 +158,7 @@ func Test_partitionTransfers(t *testing.T) { ToChainSelector: l2ChainSelector, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), BridgeSpecificData: []byte{}, }, // This one is done/already received (present in sentLogs, finalized logs, and receivedLogs), should not be included in any output slices @@ -166,7 +167,7 @@ func Test_partitionTransfers(t *testing.T) { ToChainSelector: l2ChainSelector, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), BridgeSpecificData: []byte{}, }, }, @@ -178,7 +179,7 @@ func Test_partitionTransfers(t *testing.T) { From: l1BridgeAdapterAddress, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - ExtraData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + ExtraData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), }, // This one is already done (present in sentLogs, finalized logs, and receivedLogs) { @@ -187,7 +188,7 @@ func Test_partitionTransfers(t *testing.T) { From: l1BridgeAdapterAddress, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - ExtraData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), + ExtraData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), }, // This one is missing (not present in sentLogs) { @@ -196,7 +197,7 @@ func Test_partitionTransfers(t *testing.T) { From: l1BridgeAdapterAddress, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - ExtraData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000065"), + ExtraData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000065"), }, }, receivedLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ @@ -206,7 +207,7 @@ func Test_partitionTransfers(t *testing.T) { To: l2LiquidityManagerAddress, Amount: big.NewInt(1), BridgeReturnData: []byte{}, - BridgeSpecificData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), + BridgeSpecificData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), }, }, }, @@ -217,7 +218,7 @@ func Test_partitionTransfers(t *testing.T) { ToChainSelector: l2ChainSelector, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), BridgeSpecificData: []byte{}, }, }, @@ -228,7 +229,7 @@ func Test_partitionTransfers(t *testing.T) { ToChainSelector: l2ChainSelector, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), BridgeSpecificData: []byte{}, }, }, @@ -240,7 +241,7 @@ func Test_partitionTransfers(t *testing.T) { From: l1BridgeAdapterAddress, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - ExtraData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000065"), + ExtraData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000065"), }, }, wantErr: false, @@ -258,7 +259,7 @@ func Test_partitionTransfers(t *testing.T) { ToChainSelector: l2ChainSelector, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), BridgeSpecificData: []byte{}, }, // Mismatched finalized event 'to' field @@ -267,7 +268,7 @@ func Test_partitionTransfers(t *testing.T) { ToChainSelector: l2ChainSelector, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), BridgeSpecificData: []byte{}, }, // Mismatched finalized event 'remote_token' field @@ -276,7 +277,7 @@ func Test_partitionTransfers(t *testing.T) { ToChainSelector: l2ChainSelector, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), BridgeSpecificData: []byte{}, }, }, @@ -288,7 +289,7 @@ func Test_partitionTransfers(t *testing.T) { From: common.HexToAddress("0x123"), To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - ExtraData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + ExtraData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), }, // Mismatched finalized event 'to' field { @@ -297,7 +298,7 @@ func Test_partitionTransfers(t *testing.T) { From: l1BridgeAdapterAddress, To: common.HexToAddress("0x456"), Amount: big.NewInt(1), - ExtraData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + ExtraData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), }, // Mismatched finalized event 'remote_token' field { @@ -306,7 +307,7 @@ func Test_partitionTransfers(t *testing.T) { From: l1BridgeAdapterAddress, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - ExtraData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), + ExtraData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), }, }, receivedLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{}, @@ -318,7 +319,7 @@ func Test_partitionTransfers(t *testing.T) { ToChainSelector: l2ChainSelector, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000001"), BridgeSpecificData: []byte{}, }, // Mismatched finalized event 'to' field @@ -327,7 +328,7 @@ func Test_partitionTransfers(t *testing.T) { ToChainSelector: l2ChainSelector, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000002"), BridgeSpecificData: []byte{}, }, // Mismatched finalized event 'remote_token' field @@ -336,7 +337,7 @@ func Test_partitionTransfers(t *testing.T) { ToChainSelector: l2ChainSelector, To: l2LiquidityManagerAddress, Amount: big.NewInt(1), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000003"), BridgeSpecificData: []byte{}, }}, wantReady: nil, @@ -351,8 +352,8 @@ func Test_partitionTransfers(t *testing.T) { require.Error(t, err) } else { require.NoError(t, err) - assertLiquidityTransferredEventSlicesEqual(t, tt.wantNotReady, gotNotReady, sortByBridgeReturnData) - assertLiquidityTransferredEventSlicesEqual(t, tt.wantReady, gotReady, sortByBridgeReturnData) + bridgetestutils.AssertLiquidityTransferredEventSlicesEqual(t, tt.wantNotReady, gotNotReady, bridgetestutils.SortByBridgeReturnData) + bridgetestutils.AssertLiquidityTransferredEventSlicesEqual(t, tt.wantReady, gotReady, bridgetestutils.SortByBridgeReturnData) assert.Equal(t, tt.wantMissingSent, gotMissingSent) } }) diff --git a/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l2_to_l1_test.go b/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l2_to_l1_test.go index d001eb2029..e6b0968d63 100644 --- a/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l2_to_l1_test.go +++ b/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/l2_to_l1_test.go @@ -14,6 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/liquiditymanager" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" + bridgetestutils "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/liquiditymanager/bridge/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/liquiditymanager/models" "github.com/stretchr/testify/mock" @@ -64,7 +65,7 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { ToChainSelector: l1ChainSelector, To: l1LiquidityManagerAddress, Amount: big.NewInt(4), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000004"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000004"), BridgeSpecificData: []byte{}, }, // This one needs to be finalized @@ -73,7 +74,7 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { ToChainSelector: l1ChainSelector, To: l1LiquidityManagerAddress, Amount: big.NewInt(7), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000005"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000005"), BridgeSpecificData: []byte{}, }, // This one is done/already received (present in sent logs, proven logs, and received logs), should not be included in any output @@ -82,7 +83,7 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { ToChainSelector: l1ChainSelector, To: l1LiquidityManagerAddress, Amount: big.NewInt(10), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000006"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000006"), BridgeSpecificData: []byte{}, }, }, @@ -92,20 +93,20 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { OcrSeqNum: uint64(1), RemoteChainSelector: l2ChainSelector, // prove logs from the 0x0...5 nonce (amount=7) - BridgeSpecificData: mustConvertHexBridgeSpecificDataToBytes(t, "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000bc0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000001b8c0000000000000000000000000000000000000000000000000000000000000000debdfbead9da4e4e96744bb44a697fb9b5db11acd7bd6a2c78d58face684206970c451d3ddd756858ee282bcec7c3923065ba3b2988e91949025e6b4e77487de332e3e384bb4ce3a6fc7978d0dfc5945341c1473744ad3a41635fbd1fb4b9c6100000000000000000000000000000000000000000000000000000000000003e00001000000000000000000000000000000000000000000000000000000000dd7000000000000000000000000420000000000000000000000000000000000000700000000000000000000000058cc85b8d04ea49cc6dbd3cbffd00b4b8d6cb3ef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004698800000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000204d764ad0b0001000000000000000000000000000000000000000000000000000000000d590000000000000000000000004200000000000000000000000000000000000010000000000000000000000000fbb0621e0b23b5478b630bd55a5f21f67730b0f10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001040166a07a0000000000000000000000005589bb8228c07c4e15558875faf2b859f678d129000000000000000000000000d08a2917653d4e460893203471f0000826fb4034000000000000000000000000fb023f4edb2aa1ebbcc07970f9c0541071713445000000000000000000000000e87704d3f0dd040fd2a49c3606043dd6fc05bf33000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000052000000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000214f90211a0c37d9a90a47f430d6d54dabcbd2f364fdec4bbefa75aa69eab8f3cf50026de73a0a399109fd13eb2ebb25f5382c7bbe1a3d4c6433968ca9f19b78a0871e0cbf712a025225c15784b8550f2fb4d8257db8a352453c05b81013dc4a8f5fdfde94b2043a0b1fdf531766da35c16cae24330ec921abe5f7f950396fec11deea83db82346a4a0117a1e2d227b113cddb855f2af8fbed60661d0cb71e2ac0474f405ad359232f8a08a05951056d4a4e2e4ca1109d9c345aeaaf28f9be4a2a810b5652e69518ca609a02900527859b85e1008d498194a583a3effad975638925b6a1c6a8ff38ae2e804a0d466461fe5b2004b72cc68f4013ea3d2e6fc49b0b5598ff091724ed3a86fc2bfa0863849da3e275da0a24c159f0ec0c2bb2c1024fd254492f6a7f3abefff96a77ea0ed4a2b060237d351dd851375674b6dfb3d7a864281b1105b6a602c8f989962fda07e250d776e741b434bffd936ba18f8ea9c9f359672e80d93d3128bf060605ec1a08ff7943dae97c26473ac8062323fe14a28b33a892c710ef769a7ddbd1d13b2d8a0bb62fef18ac02456958d40d12353c27db1aca9b90edfe8a4de910e0e8cf27d9ba088e3c60cbf0b6f0ad69730ad3bf23825d8f9f8037544069669dfc3ae3a39f826a02cfaadf653fc6cc9bc182e8ae4a6f7736ab1b01363444aa65e8c1182d4fd8e7ea08a6919cd1b827d7e346cd9f5aa269c01e5179e3a79e9e050fcb1c34028d236e8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a0d83a5b715cffa9ff815a9cbede60d80e380c0d8b3f8433c1cfd9f9332ca96fcfa08f3d6be3e11f4a8d26b7b95f526c5997db678b7ade30fc4476f3b62513f636a0a00bd2482ce34a4dea248ad239a79f04082a73549cf115a2f9ef8b59f3a0ab32bea00bb41ca6732f1a882e39fd10cd1e46dcc524ad968bc19d35c20efcbc4d53844aa0d6bb21815ed32081c3987cb8d7f4b82971e856f10cf016f0f200c7481bc8e72da05eb07b5cd5ac9db7b8b112f21b68c911bbc8267bfaf715687a3c38fa520e6dd5a0651a7362fdc70b0dc0482f18f06aeb22c8b0a6025415680989f6c1fe8abad4f7a0cd2f2124bdc93e740643df5e0fd6c44c8d2fbb160cb31ae1379124af6185b3f0a0188c44d5164eff07559f80590db1b7b71dd6bd2caa8535ebaa917beb51777016a0838fb57029d1dcd8e8bdffe2c415631f6117d512cd1218754c1176ee1cf9e234a077a2600394a2b1ff56a36442b788589a4ebf2f72754b70f21a137c3a8a9a4593a01314e5e6eebd982c60dcc670e1e33f99304aee763578785b10ec7633c2d17c84a0d9b11242125a529dc046bec59277320e1ef2f73b83d4189afe0ab2a5e1db95efa0b40124e9a39f63fcbd93f2f2143ff5b2b9f336d5653dc55debded322cb555c44a0fd4817897049284c3fb2395c57c53e6254820a7c466e37ec409f93b5391db355a05dcf85c54422dd72a6d74b4f730a156290b290720164bd81f516f2f1118392d4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000154f90151a01f1a153520d71c7a9dee923b4f1a30c09f49f57e930d62072b80aa99460d9440a070d2af65cf4b7972e7bf9443f0fe82ff29225a48071ac6ebe1fbc0ae49356642a0943b13b0b2608c1e772c599809292c4079c16d90f9f1e7d69f8925102d8c1feba0593648a0c1d2c819da4fc25f8c38beac96bc8b25533c7581e2117c911254d8f48080a0a45d531264251deba88eb85c03e1826daddbb0b0bce37165e71d9236af892fc08080a04e425050083943d27aa01fdb706b5715693c18ed9ff8ef050fcd0c2ea292687aa09b9a3d00ec6310bd2f5714e5c60c7c597128add8087e18986dc18d716c6d011780a0fcf815ea12a633987173946bf59a53d93c461c71e47b3eee7cb07885027288f4a093b3dc885d64ad3421e67bf396530d92268a6ea17fe536e75f3d45ff2d6f034b80a0d3f01d4772d6326d75fad188647163487f5c5df4b809e33fffe344262fcaa398800000000000000000000000000000000000000000000000000000000000000000000000000000000000000073f8718080808080808080a0bb626d1fc2d928384c17de477f7b7170c65267b016976bc21305ebf39fc1543ca0f3ea5fd76e00ddbf83625e203d99441c86c44557e86896aad4ec87a4683bdf618080a0afebeaa9674e4a195459974044cf4da821d72aff3654d6d70b14ce90075c13f980808080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022e19f20aeeb5205bebd523c696a4b099033965d1bcb4af41ce5f3070145a8debd6601000000000000000000000000000000000000000000000000000000000000"), + BridgeSpecificData: bridgetestutils.MustConvertHexBridgeDataToBytes(t, "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000bc0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000001b8c0000000000000000000000000000000000000000000000000000000000000000debdfbead9da4e4e96744bb44a697fb9b5db11acd7bd6a2c78d58face684206970c451d3ddd756858ee282bcec7c3923065ba3b2988e91949025e6b4e77487de332e3e384bb4ce3a6fc7978d0dfc5945341c1473744ad3a41635fbd1fb4b9c6100000000000000000000000000000000000000000000000000000000000003e00001000000000000000000000000000000000000000000000000000000000dd7000000000000000000000000420000000000000000000000000000000000000700000000000000000000000058cc85b8d04ea49cc6dbd3cbffd00b4b8d6cb3ef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004698800000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000204d764ad0b0001000000000000000000000000000000000000000000000000000000000d590000000000000000000000004200000000000000000000000000000000000010000000000000000000000000fbb0621e0b23b5478b630bd55a5f21f67730b0f10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001040166a07a0000000000000000000000005589bb8228c07c4e15558875faf2b859f678d129000000000000000000000000d08a2917653d4e460893203471f0000826fb4034000000000000000000000000fb023f4edb2aa1ebbcc07970f9c0541071713445000000000000000000000000e87704d3f0dd040fd2a49c3606043dd6fc05bf33000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000052000000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000214f90211a0c37d9a90a47f430d6d54dabcbd2f364fdec4bbefa75aa69eab8f3cf50026de73a0a399109fd13eb2ebb25f5382c7bbe1a3d4c6433968ca9f19b78a0871e0cbf712a025225c15784b8550f2fb4d8257db8a352453c05b81013dc4a8f5fdfde94b2043a0b1fdf531766da35c16cae24330ec921abe5f7f950396fec11deea83db82346a4a0117a1e2d227b113cddb855f2af8fbed60661d0cb71e2ac0474f405ad359232f8a08a05951056d4a4e2e4ca1109d9c345aeaaf28f9be4a2a810b5652e69518ca609a02900527859b85e1008d498194a583a3effad975638925b6a1c6a8ff38ae2e804a0d466461fe5b2004b72cc68f4013ea3d2e6fc49b0b5598ff091724ed3a86fc2bfa0863849da3e275da0a24c159f0ec0c2bb2c1024fd254492f6a7f3abefff96a77ea0ed4a2b060237d351dd851375674b6dfb3d7a864281b1105b6a602c8f989962fda07e250d776e741b434bffd936ba18f8ea9c9f359672e80d93d3128bf060605ec1a08ff7943dae97c26473ac8062323fe14a28b33a892c710ef769a7ddbd1d13b2d8a0bb62fef18ac02456958d40d12353c27db1aca9b90edfe8a4de910e0e8cf27d9ba088e3c60cbf0b6f0ad69730ad3bf23825d8f9f8037544069669dfc3ae3a39f826a02cfaadf653fc6cc9bc182e8ae4a6f7736ab1b01363444aa65e8c1182d4fd8e7ea08a6919cd1b827d7e346cd9f5aa269c01e5179e3a79e9e050fcb1c34028d236e8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a0d83a5b715cffa9ff815a9cbede60d80e380c0d8b3f8433c1cfd9f9332ca96fcfa08f3d6be3e11f4a8d26b7b95f526c5997db678b7ade30fc4476f3b62513f636a0a00bd2482ce34a4dea248ad239a79f04082a73549cf115a2f9ef8b59f3a0ab32bea00bb41ca6732f1a882e39fd10cd1e46dcc524ad968bc19d35c20efcbc4d53844aa0d6bb21815ed32081c3987cb8d7f4b82971e856f10cf016f0f200c7481bc8e72da05eb07b5cd5ac9db7b8b112f21b68c911bbc8267bfaf715687a3c38fa520e6dd5a0651a7362fdc70b0dc0482f18f06aeb22c8b0a6025415680989f6c1fe8abad4f7a0cd2f2124bdc93e740643df5e0fd6c44c8d2fbb160cb31ae1379124af6185b3f0a0188c44d5164eff07559f80590db1b7b71dd6bd2caa8535ebaa917beb51777016a0838fb57029d1dcd8e8bdffe2c415631f6117d512cd1218754c1176ee1cf9e234a077a2600394a2b1ff56a36442b788589a4ebf2f72754b70f21a137c3a8a9a4593a01314e5e6eebd982c60dcc670e1e33f99304aee763578785b10ec7633c2d17c84a0d9b11242125a529dc046bec59277320e1ef2f73b83d4189afe0ab2a5e1db95efa0b40124e9a39f63fcbd93f2f2143ff5b2b9f336d5653dc55debded322cb555c44a0fd4817897049284c3fb2395c57c53e6254820a7c466e37ec409f93b5391db355a05dcf85c54422dd72a6d74b4f730a156290b290720164bd81f516f2f1118392d4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000154f90151a01f1a153520d71c7a9dee923b4f1a30c09f49f57e930d62072b80aa99460d9440a070d2af65cf4b7972e7bf9443f0fe82ff29225a48071ac6ebe1fbc0ae49356642a0943b13b0b2608c1e772c599809292c4079c16d90f9f1e7d69f8925102d8c1feba0593648a0c1d2c819da4fc25f8c38beac96bc8b25533c7581e2117c911254d8f48080a0a45d531264251deba88eb85c03e1826daddbb0b0bce37165e71d9236af892fc08080a04e425050083943d27aa01fdb706b5715693c18ed9ff8ef050fcd0c2ea292687aa09b9a3d00ec6310bd2f5714e5c60c7c597128add8087e18986dc18d716c6d011780a0fcf815ea12a633987173946bf59a53d93c461c71e47b3eee7cb07885027288f4a093b3dc885d64ad3421e67bf396530d92268a6ea17fe536e75f3d45ff2d6f034b80a0d3f01d4772d6326d75fad188647163487f5c5df4b809e33fffe344262fcaa398800000000000000000000000000000000000000000000000000000000000000000000000000000000000000073f8718080808080808080a0bb626d1fc2d928384c17de477f7b7170c65267b016976bc21305ebf39fc1543ca0f3ea5fd76e00ddbf83625e203d99441c86c44557e86896aad4ec87a4683bdf618080a0afebeaa9674e4a195459974044cf4da821d72aff3654d6d70b14ce90075c13f980808080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022e19f20aeeb5205bebd523c696a4b099033965d1bcb4af41ce5f3070145a8debd6601000000000000000000000000000000000000000000000000000000000000"), }, // This one is done/already received { OcrSeqNum: uint64(2), RemoteChainSelector: l2ChainSelector, // prove logs from the 0x0...6 nonce (amount=10) - BridgeSpecificData: mustConvertHexBridgeSpecificDataToBytes(t, "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000b40000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000001b8c0000000000000000000000000000000000000000000000000000000000000000debdfbead9da4e4e96744bb44a697fb9b5db11acd7bd6a2c78d58face684206970c451d3ddd756858ee282bcec7c3923065ba3b2988e91949025e6b4e77487de332e3e384bb4ce3a6fc7978d0dfc5945341c1473744ad3a41635fbd1fb4b9c6100000000000000000000000000000000000000000000000000000000000003e00001000000000000000000000000000000000000000000000000000000000dd8000000000000000000000000420000000000000000000000000000000000000700000000000000000000000058cc85b8d04ea49cc6dbd3cbffd00b4b8d6cb3ef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004698800000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000204d764ad0b0001000000000000000000000000000000000000000000000000000000000d5a0000000000000000000000004200000000000000000000000000000000000010000000000000000000000000fbb0621e0b23b5478b630bd55a5f21f67730b0f10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001040166a07a0000000000000000000000005589bb8228c07c4e15558875faf2b859f678d129000000000000000000000000d08a2917653d4e460893203471f0000826fb4034000000000000000000000000fb023f4edb2aa1ebbcc07970f9c0541071713445000000000000000000000000e87704d3f0dd040fd2a49c3606043dd6fc05bf33000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c0000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000006c00000000000000000000000000000000000000000000000000000000000000214f90211a0c37d9a90a47f430d6d54dabcbd2f364fdec4bbefa75aa69eab8f3cf50026de73a0a399109fd13eb2ebb25f5382c7bbe1a3d4c6433968ca9f19b78a0871e0cbf712a025225c15784b8550f2fb4d8257db8a352453c05b81013dc4a8f5fdfde94b2043a0b1fdf531766da35c16cae24330ec921abe5f7f950396fec11deea83db82346a4a0117a1e2d227b113cddb855f2af8fbed60661d0cb71e2ac0474f405ad359232f8a08a05951056d4a4e2e4ca1109d9c345aeaaf28f9be4a2a810b5652e69518ca609a02900527859b85e1008d498194a583a3effad975638925b6a1c6a8ff38ae2e804a0d466461fe5b2004b72cc68f4013ea3d2e6fc49b0b5598ff091724ed3a86fc2bfa0863849da3e275da0a24c159f0ec0c2bb2c1024fd254492f6a7f3abefff96a77ea0ed4a2b060237d351dd851375674b6dfb3d7a864281b1105b6a602c8f989962fda07e250d776e741b434bffd936ba18f8ea9c9f359672e80d93d3128bf060605ec1a08ff7943dae97c26473ac8062323fe14a28b33a892c710ef769a7ddbd1d13b2d8a0bb62fef18ac02456958d40d12353c27db1aca9b90edfe8a4de910e0e8cf27d9ba088e3c60cbf0b6f0ad69730ad3bf23825d8f9f8037544069669dfc3ae3a39f826a02cfaadf653fc6cc9bc182e8ae4a6f7736ab1b01363444aa65e8c1182d4fd8e7ea08a6919cd1b827d7e346cd9f5aa269c01e5179e3a79e9e050fcb1c34028d236e8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a050a1a407e76cf8932498e5c8a03f7d3ce9f7db1cb88489482b2eea389d3df548a0ab20926cf02651c8b90cb2b9b4b22804c7e8fe2d6c7be438b81ec442c21f0d31a0768e2e35089267f2334ecbb13f49e07e59a062c29696c674cdd4e32d5dcd7a17a00c662583b98d019310f01ca016aa2d352c803b2207ce01a48f4179e5ab72d6dba0c1373828efc2d5325b71fc2a194c038098cdeb9e59d6ebad7c20664a9e627061a0aa98badb806f96bb55ee46d01edb661b304913fb876a9708efdf7664a631cde8a00f05546016560ce9b05ee583b4d97b15fc5b7ab5ec56de37e299be381767c3aba005941b0ad5b606fdca4cae738efbf2daf029e63d3d4a5bfb81c550a99b073968a052db10435032fa673fd56943db628ce658dfd053ab4022b5d8f48d5e54994bf4a0ed2df687867bfb62f41273c9e0e317f0da20c6595eb16d0b9dea48c70e0b3e06a03bc54d1680436348eb3506d51dfb4cd0e9c9d39f1366530e111e96d369b2322aa06ec4829d91f0cc40a45ee77a963c3730dd3b42ce4d99beec108b97760bf1ead8a092f6bc5d2c4072d22f33a13b45a721cab92eb56909dcbd19f389fbcf189b6edba013731d52dfc35f4618b37b283cb56a09d35bcf2d89f84ef81460a406780e6308a0faeca47f31cb0ddcd7da6df3e12bfce63cb3187c40fd33a090d4866d6fb13e2ba0f0ac4d51c4c48907eb0d891b1c4f99e69107b76c5a051a089c08d2000b16d34f800000000000000000000000000000000000000000000000000000000000000000000000000000000000000194f90191a06b2d6a0a36e2097af8ac6d861fae2fb81da5b1dc4553ba982d6a71f9210e8974a00e791535b1da1445dfa7de9981297de0e2639b5ca7dc13aabbb161a436e516d3a06b7af11ff178474bf69cd8e146038a51e75cada9fe34385b9ecfd33932e872bca0621657da81c2062813821315378490c32be9ef39515d0f4d55b6cdffb2cbb4bba0316b2a623c5088749c2bd529059478298a1679d9a8a41e01f7d9b0c24f5bdfd480a005fe24b494030bfedbdd124afe76081090e6e0775ea7266020ff3bae70969f8aa04f947b0b21110b7f4e53d62590787965fe43ef305af4d84d7965d3f669df8c3480a030e5de29740af91c19a24371f3a69fe37f9c7052a76698d64ff01f71561db388a0dced5f59e458fc0e2e0ff23ab31c430c69a0ba173cccd3618b4a520481c15818a06545ca38717113fa3435e643143d8a7043bdbfeb23a47c87218496f2bb03faeba054aa7606fea02cd36637ab236b286c7615c7658aa8d66fa119f3454bd8200fb680a00e7816c71cdddaf4ee29e022b778522a47e28944e1e8e3751a1663e613b00d6480800000000000000000000000000000000000000000000000000000000000000000000000000000000000000022e19f3005eb0f046d71740f0d3530fc1e102351275c0840f962572e24c54ad9cd9c01000000000000000000000000000000000000000000000000000000000000"), + BridgeSpecificData: bridgetestutils.MustConvertHexBridgeDataToBytes(t, "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000b40000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000001b8c0000000000000000000000000000000000000000000000000000000000000000debdfbead9da4e4e96744bb44a697fb9b5db11acd7bd6a2c78d58face684206970c451d3ddd756858ee282bcec7c3923065ba3b2988e91949025e6b4e77487de332e3e384bb4ce3a6fc7978d0dfc5945341c1473744ad3a41635fbd1fb4b9c6100000000000000000000000000000000000000000000000000000000000003e00001000000000000000000000000000000000000000000000000000000000dd8000000000000000000000000420000000000000000000000000000000000000700000000000000000000000058cc85b8d04ea49cc6dbd3cbffd00b4b8d6cb3ef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004698800000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000204d764ad0b0001000000000000000000000000000000000000000000000000000000000d5a0000000000000000000000004200000000000000000000000000000000000010000000000000000000000000fbb0621e0b23b5478b630bd55a5f21f67730b0f10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001040166a07a0000000000000000000000005589bb8228c07c4e15558875faf2b859f678d129000000000000000000000000d08a2917653d4e460893203471f0000826fb4034000000000000000000000000fb023f4edb2aa1ebbcc07970f9c0541071713445000000000000000000000000e87704d3f0dd040fd2a49c3606043dd6fc05bf33000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002c0000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000006c00000000000000000000000000000000000000000000000000000000000000214f90211a0c37d9a90a47f430d6d54dabcbd2f364fdec4bbefa75aa69eab8f3cf50026de73a0a399109fd13eb2ebb25f5382c7bbe1a3d4c6433968ca9f19b78a0871e0cbf712a025225c15784b8550f2fb4d8257db8a352453c05b81013dc4a8f5fdfde94b2043a0b1fdf531766da35c16cae24330ec921abe5f7f950396fec11deea83db82346a4a0117a1e2d227b113cddb855f2af8fbed60661d0cb71e2ac0474f405ad359232f8a08a05951056d4a4e2e4ca1109d9c345aeaaf28f9be4a2a810b5652e69518ca609a02900527859b85e1008d498194a583a3effad975638925b6a1c6a8ff38ae2e804a0d466461fe5b2004b72cc68f4013ea3d2e6fc49b0b5598ff091724ed3a86fc2bfa0863849da3e275da0a24c159f0ec0c2bb2c1024fd254492f6a7f3abefff96a77ea0ed4a2b060237d351dd851375674b6dfb3d7a864281b1105b6a602c8f989962fda07e250d776e741b434bffd936ba18f8ea9c9f359672e80d93d3128bf060605ec1a08ff7943dae97c26473ac8062323fe14a28b33a892c710ef769a7ddbd1d13b2d8a0bb62fef18ac02456958d40d12353c27db1aca9b90edfe8a4de910e0e8cf27d9ba088e3c60cbf0b6f0ad69730ad3bf23825d8f9f8037544069669dfc3ae3a39f826a02cfaadf653fc6cc9bc182e8ae4a6f7736ab1b01363444aa65e8c1182d4fd8e7ea08a6919cd1b827d7e346cd9f5aa269c01e5179e3a79e9e050fcb1c34028d236e8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a050a1a407e76cf8932498e5c8a03f7d3ce9f7db1cb88489482b2eea389d3df548a0ab20926cf02651c8b90cb2b9b4b22804c7e8fe2d6c7be438b81ec442c21f0d31a0768e2e35089267f2334ecbb13f49e07e59a062c29696c674cdd4e32d5dcd7a17a00c662583b98d019310f01ca016aa2d352c803b2207ce01a48f4179e5ab72d6dba0c1373828efc2d5325b71fc2a194c038098cdeb9e59d6ebad7c20664a9e627061a0aa98badb806f96bb55ee46d01edb661b304913fb876a9708efdf7664a631cde8a00f05546016560ce9b05ee583b4d97b15fc5b7ab5ec56de37e299be381767c3aba005941b0ad5b606fdca4cae738efbf2daf029e63d3d4a5bfb81c550a99b073968a052db10435032fa673fd56943db628ce658dfd053ab4022b5d8f48d5e54994bf4a0ed2df687867bfb62f41273c9e0e317f0da20c6595eb16d0b9dea48c70e0b3e06a03bc54d1680436348eb3506d51dfb4cd0e9c9d39f1366530e111e96d369b2322aa06ec4829d91f0cc40a45ee77a963c3730dd3b42ce4d99beec108b97760bf1ead8a092f6bc5d2c4072d22f33a13b45a721cab92eb56909dcbd19f389fbcf189b6edba013731d52dfc35f4618b37b283cb56a09d35bcf2d89f84ef81460a406780e6308a0faeca47f31cb0ddcd7da6df3e12bfce63cb3187c40fd33a090d4866d6fb13e2ba0f0ac4d51c4c48907eb0d891b1c4f99e69107b76c5a051a089c08d2000b16d34f800000000000000000000000000000000000000000000000000000000000000000000000000000000000000194f90191a06b2d6a0a36e2097af8ac6d861fae2fb81da5b1dc4553ba982d6a71f9210e8974a00e791535b1da1445dfa7de9981297de0e2639b5ca7dc13aabbb161a436e516d3a06b7af11ff178474bf69cd8e146038a51e75cada9fe34385b9ecfd33932e872bca0621657da81c2062813821315378490c32be9ef39515d0f4d55b6cdffb2cbb4bba0316b2a623c5088749c2bd529059478298a1679d9a8a41e01f7d9b0c24f5bdfd480a005fe24b494030bfedbdd124afe76081090e6e0775ea7266020ff3bae70969f8aa04f947b0b21110b7f4e53d62590787965fe43ef305af4d84d7965d3f669df8c3480a030e5de29740af91c19a24371f3a69fe37f9c7052a76698d64ff01f71561db388a0dced5f59e458fc0e2e0ff23ab31c430c69a0ba173cccd3618b4a520481c15818a06545ca38717113fa3435e643143d8a7043bdbfeb23a47c87218496f2bb03faeba054aa7606fea02cd36637ab236b286c7615c7658aa8d66fa119f3454bd8200fb680a00e7816c71cdddaf4ee29e022b778522a47e28944e1e8e3751a1663e613b00d6480800000000000000000000000000000000000000000000000000000000000000000000000000000000000000022e19f3005eb0f046d71740f0d3530fc1e102351275c0840f962572e24c54ad9cd9c01000000000000000000000000000000000000000000000000000000000000"), }, // This one is missing (not present in sent logs) { OcrSeqNum: uint64(3), RemoteChainSelector: l2ChainSelector, - BridgeSpecificData: mustConvertHexBridgeSpecificDataToBytes(t, "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000bc0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000001b8c0000000000000000000000000000000000000000000000000000000000000000debdfbead9da4e4e96744bb44a697fb9b5db11acd7bd6a2c78d58face684206970c451d3ddd756858ee282bcec7c3923065ba3b2988e91949025e6b4e77487de332e3e384bb4ce3a6fc7978d0dfc5945341c1473744ad3a41635fbd1fb4b9c6100000000000000000000000000000000000000000000000000000000000003e00001000000000000000000000000000000000000000000000000000000000dd7000000000000000000000000420000000000000000000000000000000000000700000000000000000000000058cc85b8d04ea49cc6dbd3cbffd00b4b8d6cb3ef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004698800000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000204d764ad0b0001000000000000000000000000000000000000000000000000000000000d590000000000000000000000004200000000000000000000000000000000000010000000000000000000000000fbb0621e0b23b5478b630bd55a5f21f67730b0f10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001040166a07a0000000000000000000000005589bb8228c07c4e15558875faf2b859f678d129000000000000000000000000d08a2917653d4e460893203471f0000826fb4034000000000000000000000000fb023f4edb2aa1ebbcc07970f9c0541071713445000000000000000000000000e87704d3f0dd040fd2a49c3606043dd6fc05bf33000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000052000000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000214f90211a0c37d9a90a47f430d6d54dabcbd2f364fdec4bbefa75aa69eab8f3cf50026de73a0a399109fd13eb2ebb25f5382c7bbe1a3d4c6433968ca9f19b78a0871e0cbf712a025225c15784b8550f2fb4d8257db8a352453c05b81013dc4a8f5fdfde94b2043a0b1fdf531766da35c16cae24330ec921abe5f7f950396fec11deea83db82346a4a0117a1e2d227b113cddb855f2af8fbed60661d0cb71e2ac0474f405ad359232f8a08a05951056d4a4e2e4ca1109d9c345aeaaf28f9be4a2a810b5652e69518ca609a02900527859b85e1008d498194a583a3effad975638925b6a1c6a8ff38ae2e804a0d466461fe5b2004b72cc68f4013ea3d2e6fc49b0b5598ff091724ed3a86fc2bfa0863849da3e275da0a24c159f0ec0c2bb2c1024fd254492f6a7f3abefff96a77ea0ed4a2b060237d351dd851375674b6dfb3d7a864281b1105b6a602c8f989962fda07e250d776e741b434bffd936ba18f8ea9c9f359672e80d93d3128bf060605ec1a08ff7943dae97c26473ac8062323fe14a28b33a892c710ef769a7ddbd1d13b2d8a0bb62fef18ac02456958d40d12353c27db1aca9b90edfe8a4de910e0e8cf27d9ba088e3c60cbf0b6f0ad69730ad3bf23825d8f9f8037544069669dfc3ae3a39f826a02cfaadf653fc6cc9bc182e8ae4a6f7736ab1b01363444aa65e8c1182d4fd8e7ea08a6919cd1b827d7e346cd9f5aa269c01e5179e3a79e9e050fcb1c34028d236e8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a0d83a5b715cffa9ff815a9cbede60d80e380c0d8b3f8433c1cfd9f9332ca96fcfa08f3d6be3e11f4a8d26b7b95f526c5997db678b7ade30fc4476f3b62513f636a0a00bd2482ce34a4dea248ad239a79f04082a73549cf115a2f9ef8b59f3a0ab32bea00bb41ca6732f1a882e39fd10cd1e46dcc524ad968bc19d35c20efcbc4d53844aa0d6bb21815ed32081c3987cb8d7f4b82971e856f10cf016f0f200c7481bc8e72da05eb07b5cd5ac9db7b8b112f21b68c911bbc8267bfaf715687a3c38fa520e6dd5a0651a7362fdc70b0dc0482f18f06aeb22c8b0a6025415680989f6c1fe8abad4f7a0cd2f2124bdc93e740643df5e0fd6c44c8d2fbb160cb31ae1379124af6185b3f0a0188c44d5164eff07559f80590db1b7b71dd6bd2caa8535ebaa917beb51777016a0838fb57029d1dcd8e8bdffe2c415631f6117d512cd1218754c1176ee1cf9e234a077a2600394a2b1ff56a36442b788589a4ebf2f72754b70f21a137c3a8a9a4593a01314e5e6eebd982c60dcc670e1e33f99304aee763578785b10ec7633c2d17c84a0d9b11242125a529dc046bec59277320e1ef2f73b83d4189afe0ab2a5e1db95efa0b40124e9a39f63fcbd93f2f2143ff5b2b9f336d5653dc55debded322cb555c44a0fd4817897049284c3fb2395c57c53e6254820a7c466e37ec409f93b5391db355a05dcf85c54422dd72a6d74b4f730a156290b290720164bd81f516f2f1118392d4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000154f90151a01f1a153520d71c7a9dee923b4f1a30c09f49f57e930d62072b80aa99460d9440a070d2af65cf4b7972e7bf9443f0fe82ff29225a48071ac6ebe1fbc0ae49356642a0943b13b0b2608c1e772c599809292c4079c16d90f9f1e7d69f8925102d8c1feba0593648a0c1d2c819da4fc25f8c38beac96bc8b25533c7581e2117c911254d8f48080a0a45d531264251deba88eb85c03e1826daddbb0b0bce37165e71d9236af892fc08080a04e425050083943d27aa01fdb706b5715693c18ed9ff8ef050fcd0c2ea292687aa09b9a3d00ec6310bd2f5714e5c60c7c597128add8087e18986dc18d716c6d011780a0fcf815ea12a633987173946bf59a53d93c461c71e47b3eee7cb07885027288f4a093b3dc885d64ad3421e67bf396530d92268a6ea17fe536e75f3d45ff2d6f034b80a0d3f01d4772d6326d75fad188647163487f5c5df4b809e33fffe344262fcaa398800000000000000000000000000000000000000000000000000000000000000000000000000000000000000073f8718080808080808080a0bb626d1fc2d928384c17de477f7b7170c65267b016976bc21305ebf39fc1543ca0f3ea5fd76e00ddbf83625e203d99441c86c44557e86896aad4ec87a4683bdf618080a0afebeaa9674e4a195459974044cf4da821d72aff3654d6d70b14ce90075c13f980808080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022e19f20aeeb5205bebd523c696a4b099033965d1bcb4af41ce5f3070145a8debd6601000000000000000000000000000000000000000000000000000000000000"), + BridgeSpecificData: bridgetestutils.MustConvertHexBridgeDataToBytes(t, "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000bc0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000001b8c0000000000000000000000000000000000000000000000000000000000000000debdfbead9da4e4e96744bb44a697fb9b5db11acd7bd6a2c78d58face684206970c451d3ddd756858ee282bcec7c3923065ba3b2988e91949025e6b4e77487de332e3e384bb4ce3a6fc7978d0dfc5945341c1473744ad3a41635fbd1fb4b9c6100000000000000000000000000000000000000000000000000000000000003e00001000000000000000000000000000000000000000000000000000000000dd7000000000000000000000000420000000000000000000000000000000000000700000000000000000000000058cc85b8d04ea49cc6dbd3cbffd00b4b8d6cb3ef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004698800000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000204d764ad0b0001000000000000000000000000000000000000000000000000000000000d590000000000000000000000004200000000000000000000000000000000000010000000000000000000000000fbb0621e0b23b5478b630bd55a5f21f67730b0f10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001040166a07a0000000000000000000000005589bb8228c07c4e15558875faf2b859f678d129000000000000000000000000d08a2917653d4e460893203471f0000826fb4034000000000000000000000000fb023f4edb2aa1ebbcc07970f9c0541071713445000000000000000000000000e87704d3f0dd040fd2a49c3606043dd6fc05bf33000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000052000000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000214f90211a0c37d9a90a47f430d6d54dabcbd2f364fdec4bbefa75aa69eab8f3cf50026de73a0a399109fd13eb2ebb25f5382c7bbe1a3d4c6433968ca9f19b78a0871e0cbf712a025225c15784b8550f2fb4d8257db8a352453c05b81013dc4a8f5fdfde94b2043a0b1fdf531766da35c16cae24330ec921abe5f7f950396fec11deea83db82346a4a0117a1e2d227b113cddb855f2af8fbed60661d0cb71e2ac0474f405ad359232f8a08a05951056d4a4e2e4ca1109d9c345aeaaf28f9be4a2a810b5652e69518ca609a02900527859b85e1008d498194a583a3effad975638925b6a1c6a8ff38ae2e804a0d466461fe5b2004b72cc68f4013ea3d2e6fc49b0b5598ff091724ed3a86fc2bfa0863849da3e275da0a24c159f0ec0c2bb2c1024fd254492f6a7f3abefff96a77ea0ed4a2b060237d351dd851375674b6dfb3d7a864281b1105b6a602c8f989962fda07e250d776e741b434bffd936ba18f8ea9c9f359672e80d93d3128bf060605ec1a08ff7943dae97c26473ac8062323fe14a28b33a892c710ef769a7ddbd1d13b2d8a0bb62fef18ac02456958d40d12353c27db1aca9b90edfe8a4de910e0e8cf27d9ba088e3c60cbf0b6f0ad69730ad3bf23825d8f9f8037544069669dfc3ae3a39f826a02cfaadf653fc6cc9bc182e8ae4a6f7736ab1b01363444aa65e8c1182d4fd8e7ea08a6919cd1b827d7e346cd9f5aa269c01e5179e3a79e9e050fcb1c34028d236e8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a0d83a5b715cffa9ff815a9cbede60d80e380c0d8b3f8433c1cfd9f9332ca96fcfa08f3d6be3e11f4a8d26b7b95f526c5997db678b7ade30fc4476f3b62513f636a0a00bd2482ce34a4dea248ad239a79f04082a73549cf115a2f9ef8b59f3a0ab32bea00bb41ca6732f1a882e39fd10cd1e46dcc524ad968bc19d35c20efcbc4d53844aa0d6bb21815ed32081c3987cb8d7f4b82971e856f10cf016f0f200c7481bc8e72da05eb07b5cd5ac9db7b8b112f21b68c911bbc8267bfaf715687a3c38fa520e6dd5a0651a7362fdc70b0dc0482f18f06aeb22c8b0a6025415680989f6c1fe8abad4f7a0cd2f2124bdc93e740643df5e0fd6c44c8d2fbb160cb31ae1379124af6185b3f0a0188c44d5164eff07559f80590db1b7b71dd6bd2caa8535ebaa917beb51777016a0838fb57029d1dcd8e8bdffe2c415631f6117d512cd1218754c1176ee1cf9e234a077a2600394a2b1ff56a36442b788589a4ebf2f72754b70f21a137c3a8a9a4593a01314e5e6eebd982c60dcc670e1e33f99304aee763578785b10ec7633c2d17c84a0d9b11242125a529dc046bec59277320e1ef2f73b83d4189afe0ab2a5e1db95efa0b40124e9a39f63fcbd93f2f2143ff5b2b9f336d5653dc55debded322cb555c44a0fd4817897049284c3fb2395c57c53e6254820a7c466e37ec409f93b5391db355a05dcf85c54422dd72a6d74b4f730a156290b290720164bd81f516f2f1118392d4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000154f90151a01f1a153520d71c7a9dee923b4f1a30c09f49f57e930d62072b80aa99460d9440a070d2af65cf4b7972e7bf9443f0fe82ff29225a48071ac6ebe1fbc0ae49356642a0943b13b0b2608c1e772c599809292c4079c16d90f9f1e7d69f8925102d8c1feba0593648a0c1d2c819da4fc25f8c38beac96bc8b25533c7581e2117c911254d8f48080a0a45d531264251deba88eb85c03e1826daddbb0b0bce37165e71d9236af892fc08080a04e425050083943d27aa01fdb706b5715693c18ed9ff8ef050fcd0c2ea292687aa09b9a3d00ec6310bd2f5714e5c60c7c597128add8087e18986dc18d716c6d011780a0fcf815ea12a633987173946bf59a53d93c461c71e47b3eee7cb07885027288f4a093b3dc885d64ad3421e67bf396530d92268a6ea17fe536e75f3d45ff2d6f034b80a0d3f01d4772d6326d75fad188647163487f5c5df4b809e33fffe344262fcaa398800000000000000000000000000000000000000000000000000000000000000000000000000000000000000073f8718080808080808080a0bb626d1fc2d928384c17de477f7b7170c65267b016976bc21305ebf39fc1543ca0f3ea5fd76e00ddbf83625e203d99441c86c44557e86896aad4ec87a4683bdf618080a0afebeaa9674e4a195459974044cf4da821d72aff3654d6d70b14ce90075c13f980808080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022e19f20aeeb5205bebd523c696a4b099033965d1bcb4af41ce5f3070145a8debd6601000000000000000000000000000000000000000000000000000000000000"), }, }, receivedLogs: []*liquiditymanager.LiquidityManagerLiquidityTransferred{ @@ -116,7 +117,7 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { Amount: big.NewInt(10), BridgeReturnData: []byte{}, // NOTE: remember, the nonce is in bridgeSpecificData in the received logs instead of bridgeReturnData - BridgeSpecificData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000006"), + BridgeSpecificData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000006"), }, }, }, @@ -126,7 +127,7 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { ToChainSelector: l1ChainSelector, To: l1LiquidityManagerAddress, Amount: big.NewInt(4), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000004"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000004"), BridgeSpecificData: []byte{}, }, }, @@ -136,7 +137,7 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { ToChainSelector: l1ChainSelector, To: l1LiquidityManagerAddress, Amount: big.NewInt(7), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000005"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000005"), BridgeSpecificData: []byte{}, }, }, @@ -144,7 +145,7 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { { OcrSeqNum: uint64(3), RemoteChainSelector: l2ChainSelector, - BridgeSpecificData: mustConvertHexBridgeSpecificDataToBytes(t, "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000bc0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000001b8c0000000000000000000000000000000000000000000000000000000000000000debdfbead9da4e4e96744bb44a697fb9b5db11acd7bd6a2c78d58face684206970c451d3ddd756858ee282bcec7c3923065ba3b2988e91949025e6b4e77487de332e3e384bb4ce3a6fc7978d0dfc5945341c1473744ad3a41635fbd1fb4b9c6100000000000000000000000000000000000000000000000000000000000003e00001000000000000000000000000000000000000000000000000000000000dd7000000000000000000000000420000000000000000000000000000000000000700000000000000000000000058cc85b8d04ea49cc6dbd3cbffd00b4b8d6cb3ef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004698800000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000204d764ad0b0001000000000000000000000000000000000000000000000000000000000d590000000000000000000000004200000000000000000000000000000000000010000000000000000000000000fbb0621e0b23b5478b630bd55a5f21f67730b0f10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001040166a07a0000000000000000000000005589bb8228c07c4e15558875faf2b859f678d129000000000000000000000000d08a2917653d4e460893203471f0000826fb4034000000000000000000000000fb023f4edb2aa1ebbcc07970f9c0541071713445000000000000000000000000e87704d3f0dd040fd2a49c3606043dd6fc05bf33000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000052000000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000214f90211a0c37d9a90a47f430d6d54dabcbd2f364fdec4bbefa75aa69eab8f3cf50026de73a0a399109fd13eb2ebb25f5382c7bbe1a3d4c6433968ca9f19b78a0871e0cbf712a025225c15784b8550f2fb4d8257db8a352453c05b81013dc4a8f5fdfde94b2043a0b1fdf531766da35c16cae24330ec921abe5f7f950396fec11deea83db82346a4a0117a1e2d227b113cddb855f2af8fbed60661d0cb71e2ac0474f405ad359232f8a08a05951056d4a4e2e4ca1109d9c345aeaaf28f9be4a2a810b5652e69518ca609a02900527859b85e1008d498194a583a3effad975638925b6a1c6a8ff38ae2e804a0d466461fe5b2004b72cc68f4013ea3d2e6fc49b0b5598ff091724ed3a86fc2bfa0863849da3e275da0a24c159f0ec0c2bb2c1024fd254492f6a7f3abefff96a77ea0ed4a2b060237d351dd851375674b6dfb3d7a864281b1105b6a602c8f989962fda07e250d776e741b434bffd936ba18f8ea9c9f359672e80d93d3128bf060605ec1a08ff7943dae97c26473ac8062323fe14a28b33a892c710ef769a7ddbd1d13b2d8a0bb62fef18ac02456958d40d12353c27db1aca9b90edfe8a4de910e0e8cf27d9ba088e3c60cbf0b6f0ad69730ad3bf23825d8f9f8037544069669dfc3ae3a39f826a02cfaadf653fc6cc9bc182e8ae4a6f7736ab1b01363444aa65e8c1182d4fd8e7ea08a6919cd1b827d7e346cd9f5aa269c01e5179e3a79e9e050fcb1c34028d236e8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a0d83a5b715cffa9ff815a9cbede60d80e380c0d8b3f8433c1cfd9f9332ca96fcfa08f3d6be3e11f4a8d26b7b95f526c5997db678b7ade30fc4476f3b62513f636a0a00bd2482ce34a4dea248ad239a79f04082a73549cf115a2f9ef8b59f3a0ab32bea00bb41ca6732f1a882e39fd10cd1e46dcc524ad968bc19d35c20efcbc4d53844aa0d6bb21815ed32081c3987cb8d7f4b82971e856f10cf016f0f200c7481bc8e72da05eb07b5cd5ac9db7b8b112f21b68c911bbc8267bfaf715687a3c38fa520e6dd5a0651a7362fdc70b0dc0482f18f06aeb22c8b0a6025415680989f6c1fe8abad4f7a0cd2f2124bdc93e740643df5e0fd6c44c8d2fbb160cb31ae1379124af6185b3f0a0188c44d5164eff07559f80590db1b7b71dd6bd2caa8535ebaa917beb51777016a0838fb57029d1dcd8e8bdffe2c415631f6117d512cd1218754c1176ee1cf9e234a077a2600394a2b1ff56a36442b788589a4ebf2f72754b70f21a137c3a8a9a4593a01314e5e6eebd982c60dcc670e1e33f99304aee763578785b10ec7633c2d17c84a0d9b11242125a529dc046bec59277320e1ef2f73b83d4189afe0ab2a5e1db95efa0b40124e9a39f63fcbd93f2f2143ff5b2b9f336d5653dc55debded322cb555c44a0fd4817897049284c3fb2395c57c53e6254820a7c466e37ec409f93b5391db355a05dcf85c54422dd72a6d74b4f730a156290b290720164bd81f516f2f1118392d4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000154f90151a01f1a153520d71c7a9dee923b4f1a30c09f49f57e930d62072b80aa99460d9440a070d2af65cf4b7972e7bf9443f0fe82ff29225a48071ac6ebe1fbc0ae49356642a0943b13b0b2608c1e772c599809292c4079c16d90f9f1e7d69f8925102d8c1feba0593648a0c1d2c819da4fc25f8c38beac96bc8b25533c7581e2117c911254d8f48080a0a45d531264251deba88eb85c03e1826daddbb0b0bce37165e71d9236af892fc08080a04e425050083943d27aa01fdb706b5715693c18ed9ff8ef050fcd0c2ea292687aa09b9a3d00ec6310bd2f5714e5c60c7c597128add8087e18986dc18d716c6d011780a0fcf815ea12a633987173946bf59a53d93c461c71e47b3eee7cb07885027288f4a093b3dc885d64ad3421e67bf396530d92268a6ea17fe536e75f3d45ff2d6f034b80a0d3f01d4772d6326d75fad188647163487f5c5df4b809e33fffe344262fcaa398800000000000000000000000000000000000000000000000000000000000000000000000000000000000000073f8718080808080808080a0bb626d1fc2d928384c17de477f7b7170c65267b016976bc21305ebf39fc1543ca0f3ea5fd76e00ddbf83625e203d99441c86c44557e86896aad4ec87a4683bdf618080a0afebeaa9674e4a195459974044cf4da821d72aff3654d6d70b14ce90075c13f980808080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022e19f20aeeb5205bebd523c696a4b099033965d1bcb4af41ce5f3070145a8debd6601000000000000000000000000000000000000000000000000000000000000"), + BridgeSpecificData: bridgetestutils.MustConvertHexBridgeDataToBytes(t, "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000bc0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000001b8c0000000000000000000000000000000000000000000000000000000000000000debdfbead9da4e4e96744bb44a697fb9b5db11acd7bd6a2c78d58face684206970c451d3ddd756858ee282bcec7c3923065ba3b2988e91949025e6b4e77487de332e3e384bb4ce3a6fc7978d0dfc5945341c1473744ad3a41635fbd1fb4b9c6100000000000000000000000000000000000000000000000000000000000003e00001000000000000000000000000000000000000000000000000000000000dd7000000000000000000000000420000000000000000000000000000000000000700000000000000000000000058cc85b8d04ea49cc6dbd3cbffd00b4b8d6cb3ef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004698800000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000204d764ad0b0001000000000000000000000000000000000000000000000000000000000d590000000000000000000000004200000000000000000000000000000000000010000000000000000000000000fbb0621e0b23b5478b630bd55a5f21f67730b0f10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001040166a07a0000000000000000000000005589bb8228c07c4e15558875faf2b859f678d129000000000000000000000000d08a2917653d4e460893203471f0000826fb4034000000000000000000000000fb023f4edb2aa1ebbcc07970f9c0541071713445000000000000000000000000e87704d3f0dd040fd2a49c3606043dd6fc05bf33000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000052000000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000214f90211a0c37d9a90a47f430d6d54dabcbd2f364fdec4bbefa75aa69eab8f3cf50026de73a0a399109fd13eb2ebb25f5382c7bbe1a3d4c6433968ca9f19b78a0871e0cbf712a025225c15784b8550f2fb4d8257db8a352453c05b81013dc4a8f5fdfde94b2043a0b1fdf531766da35c16cae24330ec921abe5f7f950396fec11deea83db82346a4a0117a1e2d227b113cddb855f2af8fbed60661d0cb71e2ac0474f405ad359232f8a08a05951056d4a4e2e4ca1109d9c345aeaaf28f9be4a2a810b5652e69518ca609a02900527859b85e1008d498194a583a3effad975638925b6a1c6a8ff38ae2e804a0d466461fe5b2004b72cc68f4013ea3d2e6fc49b0b5598ff091724ed3a86fc2bfa0863849da3e275da0a24c159f0ec0c2bb2c1024fd254492f6a7f3abefff96a77ea0ed4a2b060237d351dd851375674b6dfb3d7a864281b1105b6a602c8f989962fda07e250d776e741b434bffd936ba18f8ea9c9f359672e80d93d3128bf060605ec1a08ff7943dae97c26473ac8062323fe14a28b33a892c710ef769a7ddbd1d13b2d8a0bb62fef18ac02456958d40d12353c27db1aca9b90edfe8a4de910e0e8cf27d9ba088e3c60cbf0b6f0ad69730ad3bf23825d8f9f8037544069669dfc3ae3a39f826a02cfaadf653fc6cc9bc182e8ae4a6f7736ab1b01363444aa65e8c1182d4fd8e7ea08a6919cd1b827d7e346cd9f5aa269c01e5179e3a79e9e050fcb1c34028d236e8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a0d83a5b715cffa9ff815a9cbede60d80e380c0d8b3f8433c1cfd9f9332ca96fcfa08f3d6be3e11f4a8d26b7b95f526c5997db678b7ade30fc4476f3b62513f636a0a00bd2482ce34a4dea248ad239a79f04082a73549cf115a2f9ef8b59f3a0ab32bea00bb41ca6732f1a882e39fd10cd1e46dcc524ad968bc19d35c20efcbc4d53844aa0d6bb21815ed32081c3987cb8d7f4b82971e856f10cf016f0f200c7481bc8e72da05eb07b5cd5ac9db7b8b112f21b68c911bbc8267bfaf715687a3c38fa520e6dd5a0651a7362fdc70b0dc0482f18f06aeb22c8b0a6025415680989f6c1fe8abad4f7a0cd2f2124bdc93e740643df5e0fd6c44c8d2fbb160cb31ae1379124af6185b3f0a0188c44d5164eff07559f80590db1b7b71dd6bd2caa8535ebaa917beb51777016a0838fb57029d1dcd8e8bdffe2c415631f6117d512cd1218754c1176ee1cf9e234a077a2600394a2b1ff56a36442b788589a4ebf2f72754b70f21a137c3a8a9a4593a01314e5e6eebd982c60dcc670e1e33f99304aee763578785b10ec7633c2d17c84a0d9b11242125a529dc046bec59277320e1ef2f73b83d4189afe0ab2a5e1db95efa0b40124e9a39f63fcbd93f2f2143ff5b2b9f336d5653dc55debded322cb555c44a0fd4817897049284c3fb2395c57c53e6254820a7c466e37ec409f93b5391db355a05dcf85c54422dd72a6d74b4f730a156290b290720164bd81f516f2f1118392d4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000154f90151a01f1a153520d71c7a9dee923b4f1a30c09f49f57e930d62072b80aa99460d9440a070d2af65cf4b7972e7bf9443f0fe82ff29225a48071ac6ebe1fbc0ae49356642a0943b13b0b2608c1e772c599809292c4079c16d90f9f1e7d69f8925102d8c1feba0593648a0c1d2c819da4fc25f8c38beac96bc8b25533c7581e2117c911254d8f48080a0a45d531264251deba88eb85c03e1826daddbb0b0bce37165e71d9236af892fc08080a04e425050083943d27aa01fdb706b5715693c18ed9ff8ef050fcd0c2ea292687aa09b9a3d00ec6310bd2f5714e5c60c7c597128add8087e18986dc18d716c6d011780a0fcf815ea12a633987173946bf59a53d93c461c71e47b3eee7cb07885027288f4a093b3dc885d64ad3421e67bf396530d92268a6ea17fe536e75f3d45ff2d6f034b80a0d3f01d4772d6326d75fad188647163487f5c5df4b809e33fffe344262fcaa398800000000000000000000000000000000000000000000000000000000000000000000000000000000000000073f8718080808080808080a0bb626d1fc2d928384c17de477f7b7170c65267b016976bc21305ebf39fc1543ca0f3ea5fd76e00ddbf83625e203d99441c86c44557e86896aad4ec87a4683bdf618080a0afebeaa9674e4a195459974044cf4da821d72aff3654d6d70b14ce90075c13f980808080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022e19f20aeeb5205bebd523c696a4b099033965d1bcb4af41ce5f3070145a8debd6601000000000000000000000000000000000000000000000000000000000000"), }, }, wantErr: false, @@ -161,7 +162,7 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { ToChainSelector: l1ChainSelector, To: l1LiquidityManagerAddress, Amount: big.NewInt(4), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000004"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000004"), BridgeSpecificData: []byte{}, }, // This one has an invalid FromChainSelector @@ -170,7 +171,7 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { ToChainSelector: l1ChainSelector, To: l1LiquidityManagerAddress, Amount: big.NewInt(7), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000005"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000005"), BridgeSpecificData: []byte{}, }, // This one has an invalid To field @@ -179,7 +180,7 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { ToChainSelector: l1ChainSelector, To: common.HexToAddress("0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddead"), Amount: big.NewInt(10), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000006"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000006"), BridgeSpecificData: []byte{}, }, }, @@ -192,7 +193,7 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { ToChainSelector: l1ChainSelector, To: l1LiquidityManagerAddress, Amount: big.NewInt(4), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000004"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000004"), BridgeSpecificData: []byte{}, }, }, @@ -211,7 +212,7 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { ToChainSelector: l1ChainSelector, To: l1LiquidityManagerAddress, Amount: big.NewInt(7), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000005"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000005"), BridgeSpecificData: []byte{}, }, }, @@ -221,7 +222,7 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { OcrSeqNum: uint64(1), RemoteChainSelector: uint64(909090), // Non-existent chain selector // prove logs from the 0x0...5 nonce (amount=7) - BridgeSpecificData: mustConvertHexBridgeSpecificDataToBytes(t, "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000bc0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000001b8c0000000000000000000000000000000000000000000000000000000000000000debdfbead9da4e4e96744bb44a697fb9b5db11acd7bd6a2c78d58face684206970c451d3ddd756858ee282bcec7c3923065ba3b2988e91949025e6b4e77487de332e3e384bb4ce3a6fc7978d0dfc5945341c1473744ad3a41635fbd1fb4b9c6100000000000000000000000000000000000000000000000000000000000003e00001000000000000000000000000000000000000000000000000000000000dd7000000000000000000000000420000000000000000000000000000000000000700000000000000000000000058cc85b8d04ea49cc6dbd3cbffd00b4b8d6cb3ef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004698800000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000204d764ad0b0001000000000000000000000000000000000000000000000000000000000d590000000000000000000000004200000000000000000000000000000000000010000000000000000000000000fbb0621e0b23b5478b630bd55a5f21f67730b0f10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001040166a07a0000000000000000000000005589bb8228c07c4e15558875faf2b859f678d129000000000000000000000000d08a2917653d4e460893203471f0000826fb4034000000000000000000000000fb023f4edb2aa1ebbcc07970f9c0541071713445000000000000000000000000e87704d3f0dd040fd2a49c3606043dd6fc05bf33000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000052000000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000214f90211a0c37d9a90a47f430d6d54dabcbd2f364fdec4bbefa75aa69eab8f3cf50026de73a0a399109fd13eb2ebb25f5382c7bbe1a3d4c6433968ca9f19b78a0871e0cbf712a025225c15784b8550f2fb4d8257db8a352453c05b81013dc4a8f5fdfde94b2043a0b1fdf531766da35c16cae24330ec921abe5f7f950396fec11deea83db82346a4a0117a1e2d227b113cddb855f2af8fbed60661d0cb71e2ac0474f405ad359232f8a08a05951056d4a4e2e4ca1109d9c345aeaaf28f9be4a2a810b5652e69518ca609a02900527859b85e1008d498194a583a3effad975638925b6a1c6a8ff38ae2e804a0d466461fe5b2004b72cc68f4013ea3d2e6fc49b0b5598ff091724ed3a86fc2bfa0863849da3e275da0a24c159f0ec0c2bb2c1024fd254492f6a7f3abefff96a77ea0ed4a2b060237d351dd851375674b6dfb3d7a864281b1105b6a602c8f989962fda07e250d776e741b434bffd936ba18f8ea9c9f359672e80d93d3128bf060605ec1a08ff7943dae97c26473ac8062323fe14a28b33a892c710ef769a7ddbd1d13b2d8a0bb62fef18ac02456958d40d12353c27db1aca9b90edfe8a4de910e0e8cf27d9ba088e3c60cbf0b6f0ad69730ad3bf23825d8f9f8037544069669dfc3ae3a39f826a02cfaadf653fc6cc9bc182e8ae4a6f7736ab1b01363444aa65e8c1182d4fd8e7ea08a6919cd1b827d7e346cd9f5aa269c01e5179e3a79e9e050fcb1c34028d236e8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a0d83a5b715cffa9ff815a9cbede60d80e380c0d8b3f8433c1cfd9f9332ca96fcfa08f3d6be3e11f4a8d26b7b95f526c5997db678b7ade30fc4476f3b62513f636a0a00bd2482ce34a4dea248ad239a79f04082a73549cf115a2f9ef8b59f3a0ab32bea00bb41ca6732f1a882e39fd10cd1e46dcc524ad968bc19d35c20efcbc4d53844aa0d6bb21815ed32081c3987cb8d7f4b82971e856f10cf016f0f200c7481bc8e72da05eb07b5cd5ac9db7b8b112f21b68c911bbc8267bfaf715687a3c38fa520e6dd5a0651a7362fdc70b0dc0482f18f06aeb22c8b0a6025415680989f6c1fe8abad4f7a0cd2f2124bdc93e740643df5e0fd6c44c8d2fbb160cb31ae1379124af6185b3f0a0188c44d5164eff07559f80590db1b7b71dd6bd2caa8535ebaa917beb51777016a0838fb57029d1dcd8e8bdffe2c415631f6117d512cd1218754c1176ee1cf9e234a077a2600394a2b1ff56a36442b788589a4ebf2f72754b70f21a137c3a8a9a4593a01314e5e6eebd982c60dcc670e1e33f99304aee763578785b10ec7633c2d17c84a0d9b11242125a529dc046bec59277320e1ef2f73b83d4189afe0ab2a5e1db95efa0b40124e9a39f63fcbd93f2f2143ff5b2b9f336d5653dc55debded322cb555c44a0fd4817897049284c3fb2395c57c53e6254820a7c466e37ec409f93b5391db355a05dcf85c54422dd72a6d74b4f730a156290b290720164bd81f516f2f1118392d4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000154f90151a01f1a153520d71c7a9dee923b4f1a30c09f49f57e930d62072b80aa99460d9440a070d2af65cf4b7972e7bf9443f0fe82ff29225a48071ac6ebe1fbc0ae49356642a0943b13b0b2608c1e772c599809292c4079c16d90f9f1e7d69f8925102d8c1feba0593648a0c1d2c819da4fc25f8c38beac96bc8b25533c7581e2117c911254d8f48080a0a45d531264251deba88eb85c03e1826daddbb0b0bce37165e71d9236af892fc08080a04e425050083943d27aa01fdb706b5715693c18ed9ff8ef050fcd0c2ea292687aa09b9a3d00ec6310bd2f5714e5c60c7c597128add8087e18986dc18d716c6d011780a0fcf815ea12a633987173946bf59a53d93c461c71e47b3eee7cb07885027288f4a093b3dc885d64ad3421e67bf396530d92268a6ea17fe536e75f3d45ff2d6f034b80a0d3f01d4772d6326d75fad188647163487f5c5df4b809e33fffe344262fcaa398800000000000000000000000000000000000000000000000000000000000000000000000000000000000000073f8718080808080808080a0bb626d1fc2d928384c17de477f7b7170c65267b016976bc21305ebf39fc1543ca0f3ea5fd76e00ddbf83625e203d99441c86c44557e86896aad4ec87a4683bdf618080a0afebeaa9674e4a195459974044cf4da821d72aff3654d6d70b14ce90075c13f980808080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022e19f20aeeb5205bebd523c696a4b099033965d1bcb4af41ce5f3070145a8debd6601000000000000000000000000000000000000000000000000000000000000"), + BridgeSpecificData: bridgetestutils.MustConvertHexBridgeDataToBytes(t, "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000bc0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000001b8c0000000000000000000000000000000000000000000000000000000000000000debdfbead9da4e4e96744bb44a697fb9b5db11acd7bd6a2c78d58face684206970c451d3ddd756858ee282bcec7c3923065ba3b2988e91949025e6b4e77487de332e3e384bb4ce3a6fc7978d0dfc5945341c1473744ad3a41635fbd1fb4b9c6100000000000000000000000000000000000000000000000000000000000003e00001000000000000000000000000000000000000000000000000000000000dd7000000000000000000000000420000000000000000000000000000000000000700000000000000000000000058cc85b8d04ea49cc6dbd3cbffd00b4b8d6cb3ef0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004698800000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000204d764ad0b0001000000000000000000000000000000000000000000000000000000000d590000000000000000000000004200000000000000000000000000000000000010000000000000000000000000fbb0621e0b23b5478b630bd55a5f21f67730b0f10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001040166a07a0000000000000000000000005589bb8228c07c4e15558875faf2b859f678d129000000000000000000000000d08a2917653d4e460893203471f0000826fb4034000000000000000000000000fb023f4edb2aa1ebbcc07970f9c0541071713445000000000000000000000000e87704d3f0dd040fd2a49c3606043dd6fc05bf33000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000052000000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000214f90211a0c37d9a90a47f430d6d54dabcbd2f364fdec4bbefa75aa69eab8f3cf50026de73a0a399109fd13eb2ebb25f5382c7bbe1a3d4c6433968ca9f19b78a0871e0cbf712a025225c15784b8550f2fb4d8257db8a352453c05b81013dc4a8f5fdfde94b2043a0b1fdf531766da35c16cae24330ec921abe5f7f950396fec11deea83db82346a4a0117a1e2d227b113cddb855f2af8fbed60661d0cb71e2ac0474f405ad359232f8a08a05951056d4a4e2e4ca1109d9c345aeaaf28f9be4a2a810b5652e69518ca609a02900527859b85e1008d498194a583a3effad975638925b6a1c6a8ff38ae2e804a0d466461fe5b2004b72cc68f4013ea3d2e6fc49b0b5598ff091724ed3a86fc2bfa0863849da3e275da0a24c159f0ec0c2bb2c1024fd254492f6a7f3abefff96a77ea0ed4a2b060237d351dd851375674b6dfb3d7a864281b1105b6a602c8f989962fda07e250d776e741b434bffd936ba18f8ea9c9f359672e80d93d3128bf060605ec1a08ff7943dae97c26473ac8062323fe14a28b33a892c710ef769a7ddbd1d13b2d8a0bb62fef18ac02456958d40d12353c27db1aca9b90edfe8a4de910e0e8cf27d9ba088e3c60cbf0b6f0ad69730ad3bf23825d8f9f8037544069669dfc3ae3a39f826a02cfaadf653fc6cc9bc182e8ae4a6f7736ab1b01363444aa65e8c1182d4fd8e7ea08a6919cd1b827d7e346cd9f5aa269c01e5179e3a79e9e050fcb1c34028d236e8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000214f90211a0d83a5b715cffa9ff815a9cbede60d80e380c0d8b3f8433c1cfd9f9332ca96fcfa08f3d6be3e11f4a8d26b7b95f526c5997db678b7ade30fc4476f3b62513f636a0a00bd2482ce34a4dea248ad239a79f04082a73549cf115a2f9ef8b59f3a0ab32bea00bb41ca6732f1a882e39fd10cd1e46dcc524ad968bc19d35c20efcbc4d53844aa0d6bb21815ed32081c3987cb8d7f4b82971e856f10cf016f0f200c7481bc8e72da05eb07b5cd5ac9db7b8b112f21b68c911bbc8267bfaf715687a3c38fa520e6dd5a0651a7362fdc70b0dc0482f18f06aeb22c8b0a6025415680989f6c1fe8abad4f7a0cd2f2124bdc93e740643df5e0fd6c44c8d2fbb160cb31ae1379124af6185b3f0a0188c44d5164eff07559f80590db1b7b71dd6bd2caa8535ebaa917beb51777016a0838fb57029d1dcd8e8bdffe2c415631f6117d512cd1218754c1176ee1cf9e234a077a2600394a2b1ff56a36442b788589a4ebf2f72754b70f21a137c3a8a9a4593a01314e5e6eebd982c60dcc670e1e33f99304aee763578785b10ec7633c2d17c84a0d9b11242125a529dc046bec59277320e1ef2f73b83d4189afe0ab2a5e1db95efa0b40124e9a39f63fcbd93f2f2143ff5b2b9f336d5653dc55debded322cb555c44a0fd4817897049284c3fb2395c57c53e6254820a7c466e37ec409f93b5391db355a05dcf85c54422dd72a6d74b4f730a156290b290720164bd81f516f2f1118392d4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000154f90151a01f1a153520d71c7a9dee923b4f1a30c09f49f57e930d62072b80aa99460d9440a070d2af65cf4b7972e7bf9443f0fe82ff29225a48071ac6ebe1fbc0ae49356642a0943b13b0b2608c1e772c599809292c4079c16d90f9f1e7d69f8925102d8c1feba0593648a0c1d2c819da4fc25f8c38beac96bc8b25533c7581e2117c911254d8f48080a0a45d531264251deba88eb85c03e1826daddbb0b0bce37165e71d9236af892fc08080a04e425050083943d27aa01fdb706b5715693c18ed9ff8ef050fcd0c2ea292687aa09b9a3d00ec6310bd2f5714e5c60c7c597128add8087e18986dc18d716c6d011780a0fcf815ea12a633987173946bf59a53d93c461c71e47b3eee7cb07885027288f4a093b3dc885d64ad3421e67bf396530d92268a6ea17fe536e75f3d45ff2d6f034b80a0d3f01d4772d6326d75fad188647163487f5c5df4b809e33fffe344262fcaa398800000000000000000000000000000000000000000000000000000000000000000000000000000000000000073f8718080808080808080a0bb626d1fc2d928384c17de477f7b7170c65267b016976bc21305ebf39fc1543ca0f3ea5fd76e00ddbf83625e203d99441c86c44557e86896aad4ec87a4683bdf618080a0afebeaa9674e4a195459974044cf4da821d72aff3654d6d70b14ce90075c13f980808080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022e19f20aeeb5205bebd523c696a4b099033965d1bcb4af41ce5f3070145a8debd6601000000000000000000000000000000000000000000000000000000000000"), }, }, receivedLogs: nil, @@ -232,7 +233,7 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { ToChainSelector: l1ChainSelector, To: l1LiquidityManagerAddress, Amount: big.NewInt(7), - BridgeReturnData: mustPackBridgeTransferNonce(t, "0x0000000000000000000000000000000000000000000000000000000000000005"), + BridgeReturnData: bridgetestutils.MustPackBridgeData(t, "0x0000000000000000000000000000000000000000000000000000000000000005"), BridgeSpecificData: []byte{}, }, }, @@ -255,8 +256,8 @@ func Test_L2ToL1Bridge_partitionTransfers(t *testing.T) { require.Error(t, err) } else { require.NoError(t, err) - assertLiquidityTransferredEventSlicesEqual(t, tt.wantNeedsToBeProven, gotNeedsToBeProven, sortByBridgeReturnData) - assertLiquidityTransferredEventSlicesEqual(t, tt.wantNeedsToBeFinalized, gotNeedsToBeFinalized, sortByBridgeReturnData) + bridgetestutils.AssertLiquidityTransferredEventSlicesEqual(t, tt.wantNeedsToBeProven, gotNeedsToBeProven, bridgetestutils.SortByBridgeReturnData) + bridgetestutils.AssertLiquidityTransferredEventSlicesEqual(t, tt.wantNeedsToBeFinalized, gotNeedsToBeFinalized, bridgetestutils.SortByBridgeReturnData) assert.Equal(t, tt.wantMissingSent, gotMissingSent) } }) diff --git a/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/test_helper.go b/core/services/ocr2/plugins/liquiditymanager/bridge/testutils/test_utils.go similarity index 83% rename from core/services/ocr2/plugins/liquiditymanager/bridge/opstack/test_helper.go rename to core/services/ocr2/plugins/liquiditymanager/bridge/testutils/test_utils.go index 965fb94fea..1324dfb9d5 100644 --- a/core/services/ocr2/plugins/liquiditymanager/bridge/opstack/test_helper.go +++ b/core/services/ocr2/plugins/liquiditymanager/bridge/testutils/test_utils.go @@ -1,4 +1,4 @@ -package opstack +package testutils import ( "encoding/hex" @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/liquiditymanager/generated/liquiditymanager" ) -func assertLiquidityTransferredEventSlicesEqual( +func AssertLiquidityTransferredEventSlicesEqual( t *testing.T, expected, actual []*liquiditymanager.LiquidityManagerLiquidityTransferred, @@ -35,17 +35,17 @@ func assertLiquidityTransferredEventSlicesEqual( } } -func sortByBridgeReturnData(a, b *liquiditymanager.LiquidityManagerLiquidityTransferred) bool { +func SortByBridgeReturnData(a, b *liquiditymanager.LiquidityManagerLiquidityTransferred) bool { return hex.EncodeToString(a.BridgeReturnData) < hex.EncodeToString(b.BridgeReturnData) } -func mustPackBridgeTransferNonce(t *testing.T, bridgeDataHex string) []byte { +func MustPackBridgeData(t *testing.T, bridgeDataHex string) []byte { packed, err := hex.DecodeString(bridgeDataHex[2:]) require.NoError(t, err) return packed } -func mustConvertHexBridgeSpecificDataToBytes(t *testing.T, hexData string) []byte { +func MustConvertHexBridgeDataToBytes(t *testing.T, hexData string) []byte { packed, err := hex.DecodeString(hexData[2:]) require.NoError(t, err) return packed