From 1a801edfde43aa93cc883c5cdae87f2b46d2577f Mon Sep 17 00:00:00 2001 From: Alonso Date: Tue, 19 Nov 2024 13:33:32 +0100 Subject: [PATCH] fix e2e + unit test types --- bridgectrl/merkletree_test.go | 2 +- claimtxman/claimtxman_test.go | 4 +-- db/pgstorage/migrations/0007_test.go | 4 +-- db/pgstorage/pgstorage_test.go | 40 ++++++++++++++-------------- db/storage_test.go | 4 +-- test/e2e/bridge_network_eth_test.go | 8 +++--- test/e2e/bridge_network_shared.go | 4 +-- test/e2e/bridge_test.go | 28 +++++++++---------- test/e2e/edge_test.go | 2 +- test/e2e/l2_l2_test.go | 2 +- test/e2e/multiplerollups_test.go | 14 +++++----- 11 files changed, 56 insertions(+), 56 deletions(-) diff --git a/bridgectrl/merkletree_test.go b/bridgectrl/merkletree_test.go index 98764bb96..a5a725ffb 100644 --- a/bridgectrl/merkletree_test.go +++ b/bridgectrl/merkletree_test.go @@ -348,7 +348,7 @@ func TestBuildMTRootAndStore(t *testing.T) { require.Equal(t, len(leaves), len(result)) require.Equal(t, leaves[i][:], result[i].Leaf.Bytes()) require.Equal(t, newRoot, result[i].Root) - require.Equal(t, uint(i+1), result[i].RollupId) + require.Equal(t, uint32(i+1), result[i].RollupId) } } } diff --git a/claimtxman/claimtxman_test.go b/claimtxman/claimtxman_test.go index dd150f0f3..3df53324f 100644 --- a/claimtxman/claimtxman_test.go +++ b/claimtxman/claimtxman_test.go @@ -192,8 +192,8 @@ func TestUpdateDepositStatus(t *testing.T) { require.NoError(t, err) require.Len(t, deposits, 1) require.True(t, deposits[0].ReadyForClaim) - require.Equal(t, uint(1), deposits[0].DepositCount) - require.Equal(t, uint(0), deposits[0].NetworkID) + require.Equal(t, uint32(1), deposits[0].DepositCount) + require.Equal(t, uint32(0), deposits[0].NetworkID) require.NoError(t, pg.UpdateL2DepositsStatus(ctx, l2Root, 1, 1, nil)) deposits, err = pg.GetDeposits(ctx, destAdr, 10, 0, nil) diff --git a/db/pgstorage/migrations/0007_test.go b/db/pgstorage/migrations/0007_test.go index a6fb0a7ad..3bee32f73 100644 --- a/db/pgstorage/migrations/0007_test.go +++ b/db/pgstorage/migrations/0007_test.go @@ -61,7 +61,7 @@ func (m migrationTest0007) RunAssertsAfterMigrationUp(t *testing.T, db *sql.DB) ) getClaimSQL := "SELECT index, orig_net, orig_addr, amount, dest_addr, block_id, network_id, tx_hash, rollup_index, mainnet_flag FROM sync.claim WHERE index = $1 AND network_id = $2" _ = db.QueryRow(getClaimSQL, 3, 1).Scan(&claim.Index, &claim.OriginalNetwork, &claim.OriginalAddress, &amount, &claim.DestinationAddress, &claim.BlockID, &claim.NetworkID, &claim.TxHash, &claim.RollupIndex, &claim.MainnetFlag) - assert.Equal(t, uint64(0), claim.RollupIndex) + assert.Equal(t, uint32(0), claim.RollupIndex) assert.Equal(t, false, claim.MainnetFlag) insertClaim := "INSERT INTO sync.Claim (network_id, index, orig_net, orig_addr, amount, dest_addr, block_id, tx_hash, rollup_index, mainnet_flag) VALUES(1, 4, 0, decode('0000000000000000000000000000000000000000','hex'), '300000000000000000', decode('14567C0DCF79C20FE1A21E36EC975D1775A1905C','hex'), 2, decode('A9505DB7D7EDD08947F12F2B1F7898148FFB43D80BCB977B78161EF14173D575','hex'), 37, true);" @@ -71,7 +71,7 @@ func (m migrationTest0007) RunAssertsAfterMigrationUp(t *testing.T, db *sql.DB) getClaimSQL = "SELECT index, orig_net, orig_addr, amount, dest_addr, block_id, network_id, tx_hash, rollup_index, mainnet_flag FROM sync.claim WHERE index = $1 AND network_id = $2" _ = db.QueryRow(getClaimSQL, 4, 1).Scan(&claim.Index, &claim.OriginalNetwork, &claim.OriginalAddress, &amount, &claim.DestinationAddress, &claim.BlockID, &claim.NetworkID, &claim.TxHash, &claim.RollupIndex, &claim.MainnetFlag) assert.NoError(t, err) - assert.Equal(t, uint64(37), claim.RollupIndex) + assert.Equal(t, uint32(37), claim.RollupIndex) assert.Equal(t, true, claim.MainnetFlag) } diff --git a/db/pgstorage/pgstorage_test.go b/db/pgstorage/pgstorage_test.go index 44c08c64f..38f428eb0 100644 --- a/db/pgstorage/pgstorage_test.go +++ b/db/pgstorage/pgstorage_test.go @@ -66,25 +66,25 @@ func TestGetLeaves(t *testing.T) { assert.Equal(t, "0xa4bfa0908dc7b06d98da4309f859023d6947561bc19bc00d77f763dea1a0b9f6", leaves[0].Leaf.String()) assert.Equal(t, uint64(5), leaves[0].ID) assert.Equal(t, uint64(2), leaves[0].BlockID) - assert.Equal(t, uint(1), leaves[0].RollupId) + assert.Equal(t, uint32(1), leaves[0].RollupId) assert.Equal(t, "0x42d3339fe8eb57770953423f20a029e778a707e8d58aaf110b40d5eb4dd25722", leaves[0].Root.String()) assert.Equal(t, "0x315fee1aa202bf4a6bd0fde560c89be90b6e6e2aaf92dc5e8d118209abc34110", leaves[1].Leaf.String()) assert.Equal(t, uint64(8), leaves[1].ID) assert.Equal(t, uint64(1), leaves[1].BlockID) - assert.Equal(t, uint(2), leaves[1].RollupId) + assert.Equal(t, uint32(2), leaves[1].RollupId) assert.Equal(t, "0x42d3339fe8eb57770953423f20a029e778a707e8d58aaf110b40d5eb4dd25722", leaves[1].Root.String()) assert.Equal(t, "0xb598ce65aa15c08dda126a2985ba54f0559eaac562bb43ba430c7344261fbc5e", leaves[2].Leaf.String()) assert.Equal(t, uint64(7), leaves[2].ID) assert.Equal(t, uint64(2), leaves[2].BlockID) - assert.Equal(t, uint(3), leaves[2].RollupId) + assert.Equal(t, uint32(3), leaves[2].RollupId) assert.Equal(t, "0x42d3339fe8eb57770953423f20a029e778a707e8d58aaf110b40d5eb4dd25722", leaves[2].Root.String()) assert.Equal(t, "0xe6585bdf74b6a46b9ede8b1b877e1232fb79ee93106c4db8ffd49cf1685bf243", leaves[3].Leaf.String()) assert.Equal(t, uint64(6), leaves[3].ID) assert.Equal(t, uint64(2), leaves[3].BlockID) - assert.Equal(t, uint(4), leaves[3].RollupId) + assert.Equal(t, uint32(4), leaves[3].RollupId) assert.Equal(t, "0x42d3339fe8eb57770953423f20a029e778a707e8d58aaf110b40d5eb4dd25722", leaves[3].Root.String()) } @@ -193,50 +193,50 @@ func TestGetPendingDepositsToClaim(t *testing.T) { _, err = store.Exec(ctx, data) require.NoError(t, err) - deposits, depositCount, err := store.GetPendingDepositsToClaim(ctx, common.Address{}, 1, 0, 2, 0, nil) + deposits, totalCount, err := store.GetPendingDepositsToClaim(ctx, common.Address{}, 1, 0, 2, 0, nil) require.NoError(t, err) assert.Equal(t, 2, len(deposits)) - assert.Equal(t, uint64(2), depositCount) + assert.Equal(t, uint64(2), totalCount) assert.Equal(t, uint8(0), deposits[0].LeafType) - assert.Equal(t, uint(0), deposits[0].NetworkID) - assert.Equal(t, uint(0), deposits[0].OriginalNetwork) + assert.Equal(t, uint32(0), deposits[0].NetworkID) + assert.Equal(t, uint32(0), deposits[0].OriginalNetwork) assert.Equal(t, common.Address{}, deposits[0].OriginalAddress) assert.Equal(t, big.NewInt(90000000000000000), deposits[0].Amount) - assert.Equal(t, uint(1), deposits[0].DestinationNetwork) + assert.Equal(t, uint32(1), deposits[0].DestinationNetwork) assert.Equal(t, common.HexToAddress("0xF39FD6E51AAD88F6F4CE6AB8827279CFFFB92266"), deposits[0].DestinationAddress) assert.Equal(t, uint64(1), deposits[0].BlockID) - assert.Equal(t, uint(1), deposits[0].DepositCount) + assert.Equal(t, uint32(1), deposits[0].DepositCount) assert.Equal(t, common.HexToHash("0x6282FACE883070640F802CE8A2C42593AA18D3A691C61BA006EC477D6E5FEE1F"), deposits[0].TxHash) assert.Equal(t, []byte{}, deposits[0].Metadata) assert.Equal(t, uint64(2), deposits[0].Id) assert.Equal(t, true, deposits[0].ReadyForClaim) assert.Equal(t, uint8(0), deposits[1].LeafType) - assert.Equal(t, uint(0), deposits[1].NetworkID) - assert.Equal(t, uint(0), deposits[1].OriginalNetwork) + assert.Equal(t, uint32(0), deposits[1].NetworkID) + assert.Equal(t, uint32(0), deposits[1].OriginalNetwork) assert.Equal(t, common.Address{}, deposits[1].OriginalAddress) assert.Equal(t, big.NewInt(90000000000000000), deposits[1].Amount) - assert.Equal(t, uint(1), deposits[1].DestinationNetwork) + assert.Equal(t, uint32(1), deposits[1].DestinationNetwork) assert.Equal(t, common.HexToAddress("0xF38FD6E51AAD88F6F4CE6AB8827279CFFFB92266"), deposits[1].DestinationAddress) assert.Equal(t, uint64(1), deposits[1].BlockID) - assert.Equal(t, uint(2), deposits[1].DepositCount) + assert.Equal(t, uint32(2), deposits[1].DepositCount) assert.Equal(t, common.HexToHash("0x6282FACE883070640F802CE8A2C42593AA18D3A691C61BA006EC477D6E5FEE1F"), deposits[1].TxHash) assert.Equal(t, []byte{}, deposits[1].Metadata) assert.Equal(t, uint64(3), deposits[1].Id) assert.Equal(t, true, deposits[1].ReadyForClaim) - deposits, depositCount, err = store.GetPendingDepositsToClaim(ctx, common.HexToAddress("0xF39FD6E51AAD88F6F4CE6AB8827279CFFFB92266"), 1, 0, 2, 0, nil) + deposits, totalCount, err = store.GetPendingDepositsToClaim(ctx, common.HexToAddress("0xF39FD6E51AAD88F6F4CE6AB8827279CFFFB92266"), 1, 0, 2, 0, nil) require.NoError(t, err) assert.Equal(t, 1, len(deposits)) - assert.Equal(t, uint64(1), depositCount) + assert.Equal(t, uint64(1), totalCount) assert.Equal(t, uint8(0), deposits[0].LeafType) - assert.Equal(t, uint(0), deposits[0].NetworkID) - assert.Equal(t, uint(0), deposits[0].OriginalNetwork) + assert.Equal(t, uint32(0), deposits[0].NetworkID) + assert.Equal(t, uint32(0), deposits[0].OriginalNetwork) assert.Equal(t, common.Address{}, deposits[0].OriginalAddress) assert.Equal(t, big.NewInt(90000000000000000), deposits[0].Amount) - assert.Equal(t, uint(1), deposits[0].DestinationNetwork) + assert.Equal(t, uint32(1), deposits[0].DestinationNetwork) assert.Equal(t, common.HexToAddress("0xF39FD6E51AAD88F6F4CE6AB8827279CFFFB92266"), deposits[0].DestinationAddress) assert.Equal(t, uint64(1), deposits[0].BlockID) - assert.Equal(t, uint(1), deposits[0].DepositCount) + assert.Equal(t, uint32(1), deposits[0].DepositCount) assert.Equal(t, common.HexToHash("0x6282FACE883070640F802CE8A2C42593AA18D3A691C61BA006EC477D6E5FEE1F"), deposits[0].TxHash) assert.Equal(t, []byte{}, deposits[0].Metadata) assert.Equal(t, uint64(2), deposits[0].Id) diff --git a/db/storage_test.go b/db/storage_test.go index 343c10656..460017fde 100644 --- a/db/storage_test.go +++ b/db/storage_test.go @@ -290,11 +290,11 @@ func TestMTStorage(t *testing.T) { count, err := pg.GetLastDepositCount(ctx, 0, tx) require.NoError(t, err) - require.Equal(t, uint(0), count) + require.Equal(t, uint32(0), count) dCount, err := pg.GetDepositCountByRoot(ctx, root, 0, tx) require.NoError(t, err) - require.Equal(t, uint(0), dCount) + require.Equal(t, uint32(0), dCount) require.NoError(t, tx.Commit(ctx)) } diff --git a/test/e2e/bridge_network_eth_test.go b/test/e2e/bridge_network_eth_test.go index 09d372c66..73c2eb983 100644 --- a/test/e2e/bridge_network_eth_test.go +++ b/test/e2e/bridge_network_eth_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestCLaimAlreadyClaimedDepositL2toL1(t *testing.T) { +func TestClaimAlreadyClaimedDepositL2toL1(t *testing.T) { if testing.Short() { t.Skip() } @@ -33,7 +33,7 @@ func TestCLaimAlreadyClaimedDepositL2toL1(t *testing.T) { require.NoError(t, err) fmt.Println("Deposit: ", deposit) - err = manualClaimDeposit(ctx, testData, deposit) + err = manualClaimDeposit(ctx, testData, deposit, true) if !isAlreadyClaimedError(err) { require.NoError(t, err) } @@ -93,8 +93,8 @@ func TestEthTransferL2toL1(t *testing.T) { fmt.Println("ETH Balance ", ethInitialBalances.String()) amount := big.NewInt(12344321) txAssetHash := assetEthL2ToL1(ctx, testData, t, amount) - deposit, err := waitDepositToBeReadyToClaim(ctx, testData, txAssetHash, maxTimeToClaimReady) + deposit, err := waitDepositToBeReadyToClaim(ctx, testData, txAssetHash, maxTimeToClaimReady, "") require.NoError(t, err) - err = manualClaimDeposit(ctx, testData, deposit) + err = manualClaimDeposit(ctx, testData, deposit, true) require.NoError(t, err) } diff --git a/test/e2e/bridge_network_shared.go b/test/e2e/bridge_network_shared.go index e749574c5..30545a784 100644 --- a/test/e2e/bridge_network_shared.go +++ b/test/e2e/bridge_network_shared.go @@ -243,10 +243,10 @@ func manualClaimDeposit(ctx context.Context, testData *bridge2e2TestData, deposi return err } -func generateGlobalIndex(deposit *pb.Deposit, rollupID uint) *big.Int { +func generateGlobalIndex(deposit *pb.Deposit, rollupID uint32) *big.Int { mainnetFlag := deposit.NetworkId == 0 rollupIndex := rollupID - 1 - localExitRootIndex := uint(deposit.DepositCnt) + localExitRootIndex := deposit.DepositCnt globalIndex := etherman.GenerateGlobalIndex(mainnetFlag, rollupIndex, localExitRootIndex) return globalIndex } diff --git a/test/e2e/bridge_test.go b/test/e2e/bridge_test.go index 7e8f10f74..8fe6b3a14 100644 --- a/test/e2e/bridge_test.go +++ b/test/e2e/bridge_test.go @@ -83,7 +83,7 @@ func TestE2E(t *testing.T) { require.NoError(t, err) // Check globalExitRoot - globalExitRoot2, err := opsman.GetTrustedGlobalExitRootSynced(ctx, uint(destNetwork)) + globalExitRoot2, err := opsman.GetTrustedGlobalExitRootSynced(ctx, destNetwork) require.NoError(t, err) log.Debugf("Before deposit global exit root: %v", globalExitRootSMC) log.Debugf("After deposit global exit root: %v", globalExitRoot2) @@ -129,7 +129,7 @@ func TestE2E(t *testing.T) { require.NoError(t, err) require.Equal(t, 0, big.NewInt(0).Cmp(balance)) // Get the claim data - smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, uint(deposits[0].NetworkId), uint(deposits[0].DepositCnt)) + smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, deposits[0].NetworkId, deposits[0].DepositCnt) require.NoError(t, err) // Claim funds in L1 @@ -189,7 +189,7 @@ func TestE2E(t *testing.T) { err = opsman.SendL1Deposit(ctx, tokenAddr, amount1, destNetwork, &destAddr) require.NoError(t, err) // Check globalExitRoot - globalExitRoot2, err := opsman.GetTrustedGlobalExitRootSynced(ctx, uint(destNetwork)) + globalExitRoot2, err := opsman.GetTrustedGlobalExitRootSynced(ctx, destNetwork) require.NoError(t, err) log.Debugf("Before deposits global exit root: %v", globalExitRootSMC) log.Debugf("After deposits global exit root: %v", globalExitRoot2) @@ -204,7 +204,7 @@ func TestE2E(t *testing.T) { deposits, err = opsman.GetBridgeInfoByDestAddr(ctx, &origAddr) require.NoError(t, err) t.Log("deposit: ", deposits[0]) - smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, uint(deposits[0].NetworkId), uint(deposits[0].DepositCnt)) + smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, deposits[0].NetworkId, deposits[0].DepositCnt) require.NoError(t, err) // Claim funds in L1 err = opsman.SendL1Claim(ctx, deposits[0], smtProof, smtRollupProof, globaExitRoot) @@ -267,7 +267,7 @@ func TestE2E(t *testing.T) { t.Log("Deposit: ", deposits[0]) t.Log("Before getClaimData: ", deposits[0].NetworkId, deposits[0].DepositCnt) // Get the claim data - smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, uint(deposits[0].NetworkId), uint(deposits[0].DepositCnt)) + smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, deposits[0].NetworkId, deposits[0].DepositCnt) require.NoError(t, err) // Claim funds in L1 log.Debugf("globalExitRoot: %+v", globaExitRoot) @@ -303,7 +303,7 @@ func TestE2E(t *testing.T) { require.NoError(t, err) time.Sleep(2 * time.Second) // Check globalExitRoot - globalExitRoot4, err := opsman.GetTrustedGlobalExitRootSynced(ctx, uint(destNetwork)) + globalExitRoot4, err := opsman.GetTrustedGlobalExitRootSynced(ctx, destNetwork) require.NoError(t, err) log.Debugf("Global3 %+v: ", globalExitRoot3) log.Debugf("Global4 %+v: ", globalExitRoot4) @@ -339,7 +339,7 @@ func TestE2E(t *testing.T) { err = opsman.SendL1Deposit(ctx, tokenAddr, amount, destNetwork, &destAddr) require.NoError(t, err) // Check globalExitRoot - globalExitRoot2, err := opsman.GetTrustedGlobalExitRootSynced(ctx, uint(destNetwork)) + globalExitRoot2, err := opsman.GetTrustedGlobalExitRootSynced(ctx, destNetwork) require.NoError(t, err) log.Debugf("Before deposit global exit root: %v", globalExitRootSMC) log.Debugf("After deposit global exit root: %v", globalExitRoot2) @@ -387,7 +387,7 @@ func TestE2E(t *testing.T) { require.NoError(t, err) require.Equal(t, 0, big.NewInt(0).Cmp(balance)) // Get the claim data - smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, uint(deposits[0].NetworkId), uint(deposits[0].DepositCnt)) + smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, deposits[0].NetworkId, deposits[0].DepositCnt) require.NoError(t, err) // Claim funds in L1 err = opsman.SendL1Claim(ctx, deposits[0], smtProof, smtRollupProof, globaExitRoot) @@ -439,7 +439,7 @@ func TestE2E(t *testing.T) { err = opsman.SendL1Deposit(ctx, tokenAddr, amount3, destNetwork, &destAddr) require.NoError(t, err) // Check globalExitRoot - globalExitRoot2, err := opsman.GetTrustedGlobalExitRootSynced(ctx, uint(destNetwork)) + globalExitRoot2, err := opsman.GetTrustedGlobalExitRootSynced(ctx, destNetwork) require.NoError(t, err) log.Debugf("Before deposits global exit root: %v", globalExitRootSMC) log.Debugf("After deposits global exit root: %v", globalExitRoot2) @@ -490,7 +490,7 @@ func TestE2E(t *testing.T) { deposits, err := opsman.GetBridgeInfoByDestAddr(ctx, &destAddr) require.NoError(t, err) // Get the claim data - smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, uint(deposits[0].NetworkId), uint(deposits[0].DepositCnt)) + smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, deposits[0].NetworkId, deposits[0].DepositCnt) require.NoError(t, err) // Check the claim tx err = opsman.SendL2Claim(ctx, deposits[0], smtProof, smtRollupProof, globaExitRoot, operations.L2) @@ -510,7 +510,7 @@ func TestE2E(t *testing.T) { deposits, err = opsman.GetBridgeInfoByDestAddr(ctx, &destAddr) require.NoError(t, err) // Get the claim data - smtProof, smtRollupProof, globaExitRoot, err = opsman.GetClaimData(ctx, uint(deposits[0].NetworkId), uint(deposits[0].DepositCnt)) + smtProof, smtRollupProof, globaExitRoot, err = opsman.GetClaimData(ctx, deposits[0].NetworkId, deposits[0].DepositCnt) require.NoError(t, err) // Claim a bridge message in L1 log.Debugf("globalExitRoot: %+v", globaExitRoot) @@ -553,7 +553,7 @@ func TestE2E(t *testing.T) { deposits, err = opsman.GetBridgeInfoByDestAddr(ctx, &destAddr) require.NoError(t, err) // Get the claim data - smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, uint(deposits[0].NetworkId), uint(deposits[0].DepositCnt)) + smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, deposits[0].NetworkId, deposits[0].DepositCnt) require.NoError(t, err) // Claim a bridge message in L1 log.Debugf("globalExitRoot: %+v", globaExitRoot) @@ -573,14 +573,14 @@ func TestE2E(t *testing.T) { deposits, err := opsman.GetBridgeInfoByDestAddr(ctx, &destAddr) require.NoError(t, err) // Get the claim data - smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, uint(deposits[0].NetworkId), uint(deposits[0].DepositCnt)) + smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, deposits[0].NetworkId, deposits[0].DepositCnt) require.NoError(t, err) var ger common.Hash = bridgectrl.Hash(globaExitRoot.ExitRoots[0], globaExitRoot.ExitRoots[1]) t.Logf("GetClaimDataByGER: network: %d deposit_cnt:%d GER:%s", deposits[0].NetworkId, deposits[0].DepositCnt, ger.String()) t.Logf("Checking same claim as GetClaim") - smtProofByGer, smtRollupProofByGer, globaExitRootByGer, err := opsman.GetClaimDataByGER(ctx, uint(deposits[0].NetworkId), uint(deposits[0].DepositCnt), ger) + smtProofByGer, smtRollupProofByGer, globaExitRootByGer, err := opsman.GetClaimDataByGER(ctx, deposits[0].NetworkId, deposits[0].DepositCnt, ger) require.NoError(t, err) require.Equal(t, ger, globaExitRootByGer.GlobalExitRoot) require.Equal(t, globaExitRoot.ExitRoots[1], globaExitRootByGer.ExitRoots[1]) diff --git a/test/e2e/edge_test.go b/test/e2e/edge_test.go index a746b8dd6..b81f2a881 100644 --- a/test/e2e/edge_test.go +++ b/test/e2e/edge_test.go @@ -47,7 +47,7 @@ func depositFromL2(ctx context.Context, opsman *operations.Manager, t *testing.T require.NoError(t, err) // Check globalExitRoot // Get the claim data - smtProof, smtRollupProof, globalExitRoot, err := opsman.GetClaimData(ctx, uint(deposits[0].NetworkId), uint(deposits[0].DepositCnt)) + smtProof, smtRollupProof, globalExitRoot, err := opsman.GetClaimData(ctx, deposits[0].NetworkId, deposits[0].DepositCnt) require.NoError(t, err) // Claim funds in L1 err = opsman.SendL1Claim(ctx, deposits[0], smtProof, smtRollupProof, globalExitRoot) diff --git a/test/e2e/l2_l2_test.go b/test/e2e/l2_l2_test.go index a8b806dea..f32e347d3 100644 --- a/test/e2e/l2_l2_test.go +++ b/test/e2e/l2_l2_test.go @@ -64,7 +64,7 @@ func TestL2L2(t *testing.T) { t.Log("balance: ", balance) require.Equal(t, 0, v.Cmp(balance)) // Get the claim data - smtProof, smtRollupProof, globaExitRoot, err := opsman1.GetClaimData(ctx, uint(deposits[0].NetworkId), uint(deposits[0].DepositCnt)) + smtProof, smtRollupProof, globaExitRoot, err := opsman1.GetClaimData(ctx, deposits[0].NetworkId, deposits[0].DepositCnt) require.NoError(t, err) time.Sleep(5 * time.Second) // Claim funds in destination L2 diff --git a/test/e2e/multiplerollups_test.go b/test/e2e/multiplerollups_test.go index cc9c781b7..3a37d1e50 100644 --- a/test/e2e/multiplerollups_test.go +++ b/test/e2e/multiplerollups_test.go @@ -20,9 +20,9 @@ func TestMultipleRollups(t *testing.T) { t.Skip() } const ( - mainnetID uint = 0 - rollup1ID uint = 1 - rollup2ID uint = 2 + mainnetID uint32 = 0 + rollup1ID uint32 = 1 + rollup2ID uint32 = 2 ) ctx := context.Background() opsman1, err := operations.GetOpsman(ctx, "http://localhost:8123", "test_db", "8080", "9090", "5435", 1) @@ -163,9 +163,9 @@ func TestMultipleRollups(t *testing.T) { } type bridgeData struct { - originNet uint - destNet uint - originTokenNet uint + originNet uint32 + destNet uint32 + originTokenNet uint32 originTokenAddr common.Address amount *big.Int } @@ -218,7 +218,7 @@ func bridge( log.Debug("deposit claimed on L2") } else { log.Debug("getting proof to perform claim from bridge service...") - smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, uint(deposit.NetworkId), uint(deposit.DepositCnt)) + smtProof, smtRollupProof, globaExitRoot, err := opsman.GetClaimData(ctx, deposit.NetworkId, deposit.DepositCnt) require.NoError(t, err) log.Debug("sending claim tx to L1") err = opsman.SendL1Claim(ctx, deposit, smtProof, smtRollupProof, globaExitRoot)