validateAddressKeyBytesLength static method

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

Validate address key bytes length.

Implementation

static void validateAddressKeyBytesLength(
  List<int> addr,
  int lenExp, {
  int? minLength,
}) {
  if ((minLength != null && addr.length < minLength) ||
      (minLength == null && addr.length != lenExp)) {
    throw CoreErrors.addressValidationFailed(
      reason: "Invalid address bytes length.",
    );
  }
}