validateAndRemovePrefixBytes static method
Validate and remove prefix from an address.
Implementation
static List<int> validateAndRemovePrefixBytes(
List<int> addr,
List<int> prefix,
) {
final prefixGot = addr.sublist(0, prefix.length);
if (!BytesUtils.bytesEqual(prefix, prefixGot)) {
throw AddressConverterException.addressValidationFailed(
reason: "Invalid address prefix.",
);
}
return addr.sublist(prefix.length);
}