packUnsignedTxBody method

List packUnsignedTxBody()

Pack the objects bytes in a fixed order.

Implementation

List packUnsignedTxBody() {
  // Prepare reserved.

  //FIXME: check if reserved can be null
  List<Uint8List> _reserved = reserved!.pack();
  // Prepare clauses.
  List<List<Uint8List>> _clauses = [];
  for (Clause c in clauses) {
    _clauses.add(c.pack());
  }
  // Prepare unsigned tx.
  List unsignedBody = [
    chainTag.toBytes(),
    blockRef.toBytes(),
    expiration.toBytes(),
    _clauses,
    gasPriceCoef.toBytes(),
    gas.toBytes(),
    dependsOn.toBytes(),
    nonce.toBytes(),
    _reserved
  ];

  return unsignedBody;
}