legacyEip712Encode method

  1. @override
EncoderResult legacyEip712Encode(
  1. AbiParameter params,
  2. List<int> input,
  3. bool keepSize
)
override

Legacy EIP-712 encoding for byte arrays. Optionally keeps the size unchanged based on the keepSize parameter.

Implementation

@override
EncoderResult legacyEip712Encode(
    AbiParameter params, List<int> input, bool keepSize) {
  final size = _ABIUtils.bytesSize(params.type);
  if (size != null && input.length != size) {
    throw const SolidityAbiException("Invalid bytes length");
  }
  return EncoderResult(isDynamic: false, encoded: input, name: params.name);
}