validateAddressHash static method

List<int> validateAddressHash(
  1. List<int> bytes
)

Implementation

static List<int> validateAddressHash(List<int> bytes) {
  if (bytes.length != _TonAddressConst.addressHashLength) {
    throw AddressConverterException.addressBytesValidationFailed(
      reason: "Invalid address bytes.",
      details: {
        "expected": _TonAddressConst.addressHashLength,
        "length": bytes.length,
      },
    );
  }
  return bytes.asImmutableBytes;
}