You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
544 B

  1. package main
  2. import (
  3. "fmt"
  4. "time"
  5. e2e "github.com/tendermint/tendermint/test/e2e/pkg"
  6. )
  7. // Wait waits for a number of blocks to be produced, and for all nodes to catch
  8. // up with it.
  9. func Wait(testnet *e2e.Testnet, blocks int64) error {
  10. block, _, err := waitForHeight(testnet, 0)
  11. if err != nil {
  12. return err
  13. }
  14. waitFor := block.Height + blocks
  15. logger.Info(fmt.Sprintf("Waiting for all nodes to reach height %v...", waitFor))
  16. _, err = waitForAllNodes(testnet, waitFor, 20*time.Second)
  17. if err != nil {
  18. return err
  19. }
  20. return nil
  21. }