setMsgs method

void setMsgs(
  1. List<GeneratedMessage> messages
)

Sets the given messages as the transaction messages.

Implementation

void setMsgs(List<GeneratedMessage> messages) {
  final serialized = messages.map((msg) => Codec.serialize(msg)).toList();

  // Create the body if non existing
  if (!_stdTx.hasBody()) {
    _stdTx.body = TxBody.create();
  }

  // Set the messages
  _stdTx.body.messages.clear();
  _stdTx.body.messages.addAll(serialized);
}