LedgerBounds constructor Null safety

LedgerBounds(
  1. int _minLedger,
  2. int _maxLedger
)

Constructor _minLedger and _maxLedger are 64bit Unix timestamps.

Implementation

LedgerBounds(this._minLedger, this._maxLedger) {
  if (_minLedger < 0) {
    throw Exception("minLdeger cannot be negative");
  }

  if (_maxLedger < 0) {
    throw new Exception("maxLedger cannot be negative");
  }
  if (_maxLedger != 0 && _minLedger >= _maxLedger) {
    throw Exception("minLedger must be >= maxLedger");
  }
}