validateAddressBytes static method

void validateAddressBytes(
  1. List<int> addrBytes
)

Validates decoded address bytes are a supported digest length.

Implementation

static void validateAddressBytes(List<int> addrBytes) {
  if (addrBytes.length != QuickCrypto.hash160DigestSize &&
      addrBytes.length != QuickCrypto.sha256DigestSize) {
    throw CoreErrors.addressBytesValidationFailed(
      details: {
        "length": addrBytes.length.toString(),
        "Expected":
            "${QuickCrypto.hash160DigestSize} or ${QuickCrypto.sha256DigestSize}",
      },
    );
  }
}