move package test/ => integration/

This commit is contained in:
2023-05-28 15:49:25 +08:00
parent 026dafcfc9
commit c6040dd514
7 changed files with 6 additions and 6 deletions
+28
View File
@@ -0,0 +1,28 @@
package integration_test
import (
"context"
"errors"
"time"
"github.com/ethereum/go-ethereum/ethclient"
)
func waitForBlock(ctx context.Context, client *ethclient.Client, target int64) error {
timeout := 10 * time.Second
for {
select {
case <-time.After(timeout):
return errors.New("timed out")
default:
latest, err := client.BlockNumber(ctx)
if err != nil {
return err
}
if uint64(target) <= latest {
return nil
}
}
}
}