toPactCommand method

Implementation

QuicksignResponsePactCommand toPactCommand() {
  // If there was an error, return null
  if (outcome.result != QuicksignOutcome.success) {
    return QuicksignResponsePactCommand(
      msg: '${outcome.result}: ${outcome.msg}',
    );
  }

  // If any of the signers have no sig, return null
  if (commandSigData.sigs.any((e) => e.sig == null)) {
    return QuicksignResponsePactCommand(
      msg: missingSignatures,
    );
  }

  return QuicksignResponsePactCommand(
    pactCommand: PactCommand(
      cmd: commandSigData.cmd,
      sigs: commandSigData.sigs.map((e) => e.toSigner()).toList(),
      hash: outcome.hash!,
    ),
  );
}