toBytes method

  1. @override
List<int> toBytes()
override

Converts the program to bytes using Borsh serialization.

Implementation

@override
List<int> toBytes() {
  final data = List<int>.filled(length, 0);
  data.setAll(0, layout.serialize(serialize()));
  data.setAll(publicKeyOffset, publicKey.toBytes(false));
  data.setAll(signatureOffset, signature);
  data.setAll(messageDataOffset, message);
  return data;
}