// WaitUntilBalance should be used to ensure that the ledger's balance
// is of a specific value before continuing.
WaitUntilBalance should be used to ensure that the ledger's balance
is of a specific value before continuing.
// WaitUntilBalance should be used to ensure that the ledger ' s balance // is of a specific value before continuing .
func (l *TestLedger) WaitUntilBalance(balance uint64) error {
	ticker := time.NewTicker(time.Millisecond * 200)
	timeout := time.NewTimer(time.Second * 30)
	for {
		select {
		case <-ticker.C:
			if l.Balance() == balance {
				return nil
			}
		case <-timeout.C:
			return errors.New("timed out waiting for balance")
		}
	}
}
func ( l * TestLedger ) WaitUntilBalance ( balance uint64 ) error { ticker := time . NewTicker ( time . Millisecond * 200 ) timeout := time . NewTimer ( time . Second * 30 ) for { select { case <- ticker . C : if l . Balance ( ) == balance { return nil } case <- timeout . C : return errors . New ( " " ) } } }
WaitUntilBalance should be used to ensure that the ledger's balance
is of a specific value before continuing.
WaitUntilBalance should be used to ensure that the ledger ' s balance is of a specific value before continuing .