Add a test network setup and patch for E2E tests #18
@ -64,3 +64,9 @@ A typical testing flow might look like the following:
|
||||
}
|
||||
*/
|
||||
package network
|
||||
|
||||
/*
|
||||
NOTE:
|
||||
Copied over from https://github.com/cosmos/cosmos-sdk/tree/v0.50.3/testutil/network
|
||||
Patch: Skipped network.LatestHeight() call at the end of New()
|
||||
*/
|
||||
|
@ -619,12 +619,12 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) {
|
||||
l.Log("started validator", idx)
|
||||
}
|
||||
|
||||
height, err := network.LatestHeight()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// height, err := network.LatestHeight()
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
|
||||
l.Log("started test network at height:", height)
|
||||
// l.Log("started test network at height:", height)
|
||||
|
||||
// Ensure we cleanup incase any test was abruptly halted (e.g. SIGINT) as any
|
||||
// defer in a test would not be called.
|
||||
@ -745,7 +745,7 @@ func (n *Network) WaitForHeightWithTimeout(h int64, t time.Duration) (int64, err
|
||||
// blocks has been reached.
|
||||
func (n *Network) RetryForBlocks(retryFunc func() error, blocks int) error {
|
||||
for i := 0; i < blocks; i++ {
|
||||
n.WaitForNextBlock()
|
||||
_ = n.WaitForNextBlock()
|
||||
err := retryFunc()
|
||||
if err == nil {
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user