forked from cerc-io/ipld-eth-server
Roy Crihfield
6d7487152c
Now uses: * ipld direct_by_leaf StateDB for basic queries * trie_by_cid StateDB for trie slice and proof queries Also: * vulcanize => cerc refactor * Backend method to close dbs * state tests are in multiple packages, to allow separate ginkgo suites * removes gap-filler module * integration tests and github workflows * run stack-orchestrator for testnet * fix various issues with tests, hardhat server, dockerfile * fix cmd flags / env vars * fix flaky tests and clean up code * remove unused code, scripts * remove outdated docs * update version
29 lines
466 B
Go
29 lines
466 B
Go
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
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|