Skip to content

Commit

Permalink
fix e2e + unit test types
Browse files Browse the repository at this point in the history
  • Loading branch information
ARR552 committed Nov 19, 2024
1 parent 89bef95 commit 1a801ed
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion bridgectrl/merkletree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions claimtxman/claimtxman_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions db/pgstorage/migrations/0007_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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);"
Expand All @@ -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)
}

Expand Down
40 changes: 20 additions & 20 deletions db/pgstorage/pgstorage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions db/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/bridge_network_eth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -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)
}
Expand Down Expand Up @@ -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)
}
4 changes: 2 additions & 2 deletions test/e2e/bridge_network_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
28 changes: 14 additions & 14 deletions test/e2e/bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/edge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/l2_l2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions test/e2e/multiplerollups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1a801ed

Please sign in to comment.