From 9ac1781c6cd2c3eef8da2d82101268ba0d5f017f Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Tue, 25 Jun 2024 11:38:12 +0100 Subject: [PATCH] chore: wait for blocks after wallet creation (#6689) --- e2e/testsuite/testsuite.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/e2e/testsuite/testsuite.go b/e2e/testsuite/testsuite.go index c127043d5ae..0dc60cba2a5 100644 --- a/e2e/testsuite/testsuite.go +++ b/e2e/testsuite/testsuite.go @@ -467,7 +467,10 @@ func (s *E2ETestSuite) CreateUserOnChainC(ctx context.Context, amount int64) ibc // createWalletOnChainIndex creates a wallet with the given amount of funds on the chain of the given index. func (s *E2ETestSuite) createWalletOnChainIndex(ctx context.Context, amount, chainIndex int64) ibc.Wallet { chain := s.GetAllChains()[chainIndex] - return interchaintest.GetAndFundTestUsers(s.T(), ctx, strings.ReplaceAll(s.T().Name(), " ", "-"), sdkmath.NewInt(amount), chain)[0] + wallet := interchaintest.GetAndFundTestUsers(s.T(), ctx, strings.ReplaceAll(s.T().Name(), " ", "-"), sdkmath.NewInt(amount), chain)[0] + // note the GetAndFundTestUsers requires the caller to wait for some blocks before the funds are accessible. + s.Require().NoError(test.WaitForBlocks(ctx, 2, chain)) + return wallet } // GetChainANativeBalance gets the balance of a given user on chain A.