Skip to content

Commit

Permalink
fix hang goroutine [goreleaser]
Browse files Browse the repository at this point in the history
  • Loading branch information
trajan0x committed Jul 19, 2024
1 parent 2dd78c3 commit 22560ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ethergo/backends/anvil/anvil.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (f *Backend) FundAccount(ctx context.Context, address common.Address, amoun
defer unlocker.Unlock()

prevBalance, err := f.Backend.BalanceAt(ctx, address, nil)
require.Nil(f.T(), err)
require.NoError(f.T(), err)

newBal := new(big.Int).Add(prevBalance, &amount)

Expand Down
7 changes: 6 additions & 1 deletion services/rfq/e2e/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,25 @@ func (i *IntegrationSuite) setupBE(backend backends.SimulatedTestBackend) {
backend.FundAccount(i.GetTestContext(), i.guardWallet.Address(), ethAmount)
backend.FundAccount(i.GetTestContext(), i.userWallet.Address(), ethAmount)

var wg sync.WaitGroup
wg.Add(1)
go func() {
defer wg.Done()
i.manager.BulkDeploy(i.GetTestContext(), core.ToSlice(backend), predeploys...)
}()

// TODO: in the case of relayer this not finishing before the test starts can lead to race conditions since
// nonce may be shared between submitter and relayer. Think about how to deal w/ this.
for _, user := range []wallet.Wallet{i.relayerWallet, i.guardWallet, i.userWallet} {
wg.Add(1)
go func(userWallet wallet.Wallet) {
defer wg.Done()
for _, token := range predeployTokens {
i.Approve(backend, i.manager.Get(i.GetTestContext(), backend, token), userWallet)
}
}(user)
}

wg.Wait()
}

func (i *IntegrationSuite) setupCCTP() {
Expand Down

0 comments on commit 22560ce

Please sign in to comment.