diff --git a/e2e-polybft/e2e/apex_bridge_test.go b/e2e-polybft/e2e/apex_bridge_test.go index 5dbc9e7e5a..1e8fe13358 100644 --- a/e2e-polybft/e2e/apex_bridge_test.go +++ b/e2e-polybft/e2e/apex_bridge_test.go @@ -717,6 +717,10 @@ func TestE2E_ApexBridge_ValidScenarios(t *testing.T) { fmt.Printf("Funding %v Wallets\n", instances) for i := 0; i < instances; i++ { + if (i+1)%100 == 0 { + fmt.Printf("Funded %v..%v\n", i-99, i) + } + walletKeys[i], err = wallet.NewStakeWalletManager().Create(path.Join(apex.PrimeCluster.Config.Dir("keys")), true) require.NoError(t, err) @@ -754,21 +758,18 @@ func TestE2E_ApexBridge_ValidScenarios(t *testing.T) { user.PrimeAddress, receivers, cardanofw.GetDestinationChainID(true)) require.NoError(t, err) - txHash, err := cardanofw.SendTx( + _, err = cardanofw.SendTx( ctx, txProviderPrime, walletKeys[idx], (sendAmount + feeAmount), apex.Bridge.PrimeMultisigAddr, apex.PrimeCluster.Config.NetworkMagic, bridgingRequestMetadata) require.NoError(t, err) - - apiURL, err := apex.Bridge.GetBridgingAPI() - require.NoError(t, err) - cardanofw.WaitForInvalidState(t, ctx, apiURL, apiKey, txHash) - fmt.Printf("Tx %v invalid. hash: %s\n", idx+1, txHash) } }(i) } wg.Wait() + fmt.Printf("All tx sent, waiting for confirmation.\n") + expectedAmount := prevAmount.Uint64() + uint64(succeededCount)*sendAmount err = wallet.WaitForAmount(context.Background(), txProviderVector, user.VectorAddress, func(val *big.Int) bool { return val.Cmp(new(big.Int).SetUint64(expectedAmount)) == 0 @@ -799,6 +800,10 @@ func TestE2E_ApexBridge_ValidScenarios(t *testing.T) { fmt.Printf("Funding %v Wallets\n", instances) for i := 0; i < instances; i++ { + if (i+1)%100 == 0 { + fmt.Printf("Funded %v..%v\n", i-99, i) + } + walletKeys[i], err = wallet.NewStakeWalletManager().Create(path.Join(apex.PrimeCluster.Config.Dir("keys")), true) require.NoError(t, err) @@ -836,25 +841,22 @@ func TestE2E_ApexBridge_ValidScenarios(t *testing.T) { user.PrimeAddress, receivers, cardanofw.GetDestinationChainID(true)) require.NoError(t, err) - txHash, err := cardanofw.SendTx( + _, err = cardanofw.SendTx( ctx, txProviderPrime, walletKeys[idx], (sendAmount + feeAmount), apex.Bridge.PrimeMultisigAddr, apex.PrimeCluster.Config.NetworkMagic, bridgingRequestMetadata) require.NoError(t, err) - - apiURL, err := apex.Bridge.GetBridgingAPI() - require.NoError(t, err) - cardanofw.WaitForInvalidState(t, ctx, apiURL, apiKey, txHash) - fmt.Printf("Tx %v invalid. hash: %s\n", idx+1, txHash) } }(i) } wg.Wait() + fmt.Printf("All tx sent, waiting for confirmation.\n") + expectedAmount := prevAmount.Uint64() + uint64(succeededCount)*sendAmount err = wallet.WaitForAmount(context.Background(), txProviderVector, user.VectorAddress, func(val *big.Int) bool { return val.Cmp(new(big.Int).SetUint64(expectedAmount)) == 0 - }, 100, time.Second*10) + }, 1000, time.Second*10) require.NoError(t, err) fmt.Printf("%v TXs confirmed\n", succeededCount) @@ -884,6 +886,10 @@ func TestE2E_ApexBridge_ValidScenarios(t *testing.T) { fmt.Printf("Funding %v Wallets\n", instances) for i := 0; i < instances; i++ { + if (i+1)%100 == 0 { + fmt.Printf("Funded %v..%v on prime\n", i-99, i) + } + walletKeysPrime[i], err = wallet.NewStakeWalletManager().Create(path.Join(apex.PrimeCluster.Config.Dir("keys")), true) require.NoError(t, err) @@ -894,6 +900,10 @@ func TestE2E_ApexBridge_ValidScenarios(t *testing.T) { } for i := 0; i < instances; i++ { + if (i+1)%100 == 0 { + fmt.Printf("Funded %v..%v on vector\n", i-99, i) + } + walletKeysVector[i], err = wallet.NewStakeWalletManager().Create(path.Join(apex.VectorCluster.Config.Dir("keys")), true) require.NoError(t, err) @@ -932,15 +942,10 @@ func TestE2E_ApexBridge_ValidScenarios(t *testing.T) { user.PrimeAddress, receivers, cardanofw.GetDestinationChainID(true)) require.NoError(t, err) - txHash, err := cardanofw.SendTx( + _, err = cardanofw.SendTx( ctx, txProviderPrime, walletKeysPrime[idx], (sendAmount + feeAmount), apex.Bridge.PrimeMultisigAddr, apex.PrimeCluster.Config.NetworkMagic, bridgingRequestMetadata) require.NoError(t, err) - - apiURL, err := apex.Bridge.GetBridgingAPI() - require.NoError(t, err) - cardanofw.WaitForInvalidState(t, ctx, apiURL, apiKey, txHash) - fmt.Printf("Prime Tx %v invalid. hash: %s\n", idx+1, txHash) } }(i) @@ -967,32 +972,29 @@ func TestE2E_ApexBridge_ValidScenarios(t *testing.T) { user.VectorAddress, receivers, cardanofw.GetDestinationChainID(false)) require.NoError(t, err) - txHash, err := cardanofw.SendTx( + _, err = cardanofw.SendTx( ctx, txProviderVector, walletKeysVector[idx], (sendAmount + feeAmount), apex.Bridge.VectorMultisigAddr, apex.VectorCluster.Config.NetworkMagic, bridgingRequestMetadata) require.NoError(t, err) - - apiURL, err := apex.Bridge.GetBridgingAPI() - require.NoError(t, err) - cardanofw.WaitForInvalidState(t, ctx, apiURL, apiKey, txHash) - fmt.Printf("Tx %v invalid. hash: %s\n", idx+1, txHash) } }(i) } wg.Wait() + fmt.Printf("All tx sent, waiting for confirmation.\n") + expectedAmountPrime := prevAmountPrime.Uint64() + uint64(succeededCountPrime)*sendAmount err = wallet.WaitForAmount(context.Background(), txProviderVector, user.VectorAddress, func(val *big.Int) bool { return val.Cmp(new(big.Int).SetUint64(expectedAmountPrime)) == 0 - }, 100, time.Second*10) + }, 1000, time.Second*10) require.NoError(t, err) fmt.Printf("%v TXs confirmed on Prime\n", succeededCountPrime) expectedAmountVector := prevAmountVector.Uint64() + uint64(succeededCountVector)*sendAmount err = wallet.WaitForAmount(context.Background(), txProviderPrime, user.PrimeAddress, func(val *big.Int) bool { return val.Cmp(new(big.Int).SetUint64(expectedAmountVector)) == 0 - }, 100, time.Second*10) + }, 1000, time.Second*10) require.NoError(t, err) fmt.Printf("%v TXs confirmed on Vector\n", succeededCountVector)