abiRawEncode static method

Uint8List abiRawEncode(
  1. dynamic encTypes,
  2. dynamic encValues
)

Implementation

static Uint8List abiRawEncode(encTypes, encValues) {
  String resultHex = '';
  if (encTypes.length != encValues.length) {
    throw ArgumentError('types/values length mismatch');
  }

  for (int i = 0; i < encTypes.length; i++) {
    String name = encTypes[i];
    dynamic data = encValues[i];
    LengthTrackingByteSink buffer = new LengthTrackingByteSink();
    // ignore: invalid_use_of_visible_for_testing_member
    parseAbiType(name).encode(data, buffer);
    print(buffer.asBytes());
    print(bytesToHex(buffer.asBytes()));
    resultHex += bytesToHex(buffer.asBytes());
  }

  return hexToBytes(resultHex);
}