WaitForBlocks waits for the next amount of blocks to be committed, returning an error upon failure.
(blocks int64)
| 549 | // WaitForBlocks waits for the next amount of blocks to be committed, returning an error |
| 550 | // upon failure. |
| 551 | func (n *Network) WaitForBlocks(blocks int64) error { |
| 552 | lastBlock, err := n.LatestHeight() |
| 553 | if err != nil { |
| 554 | return err |
| 555 | } |
| 556 | |
| 557 | _, err = n.WaitForHeight(lastBlock + blocks) |
| 558 | if err != nil { |
| 559 | return err |
| 560 | } |
| 561 | |
| 562 | return err |
| 563 | } |
| 564 | |
| 565 | // Cleanup removes the root testing (temporary) directory and stops both the |
| 566 | // Tendermint and API services. It allows other callers to create and start |