validateBytesLength static method

void validateBytesLength(
  1. List<int> addr,
  2. int lenExp, {
  3. int? minLength,
})

Validate address length.

Implementation

static void validateBytesLength(List<int> addr, int lenExp,
    {int? minLength}) {
  if ((minLength != null && addr.length < minLength) ||
      (minLength == null && addr.length != lenExp)) {
    throw AddressConverterException(
      'Invalid length (expected ${minLength ?? lenExp}, got ${addr.length})',
    );
  }
}