Add convenience for lgging combination of copy/paste CLI cmds for peer

This commit is contained in:
ghubstan 2022-06-30 13:13:35 -03:00
parent dd2619bd3b
commit dee8e5baa8
No known key found for this signature in database
GPG Key ID: E35592D6800A861E
2 changed files with 21 additions and 6 deletions

View File

@ -552,7 +552,6 @@ public class BotUtils {
log.warn(BANNER);
}
/**
* Log a CLI gettrade command for a simulated trading peer.
*
@ -574,6 +573,23 @@ public class BotUtils {
log.warn(BANNER);
}
/**
* Log 1 or more CLI commands for a simulated trading peer.
* Commands need to be separated by newlines to be legible.
*
* @param log calling bot's logger
* @param description description of CLI commands
* @param commands CLI commands separated by newlines.
*/
public static void printCliCommands(Logger log,
String description,
String commands) {
log.warn(BANNER);
log.warn(description);
log.warn(commands);
log.warn(BANNER);
}
/**
* Run a bash script to count down the given number of seconds, printing each character of output from stdout.
* <p>

View File

@ -105,12 +105,11 @@ public class RegtestTradePaymentSimulator extends AbstractBot {
closeTrade(tradeId);
log.info("You closed the trade here in the bot (mandatory, to move trades to history list).");
log.warn("##############################################################################");
log.warn("Bob closes trade in the CLI (mandatory, to move trades to history list):");
String copyPasteCliCommands = "./bisq-cli --password=xyz --port=9999 closetrade --trade-id=" + trade.getTradeId()
String cliCommandDescription = "Trading peer inspects and closes trade in the CLI (mandatory, to move trades to history list):";
String copyPasteCliCommands = "./bisq-cli --password=xyz --port=9999 gettrade --trade-id=" + trade.getTradeId()
+ "\n" + "./bisq-cli --password=xyz --port=9999 closetrade --trade-id=" + trade.getTradeId()
+ "\n" + "./bisq-cli --password=xyz --port=9999 gettrades --category=closed";
log.warn(copyPasteCliCommands);
log.warn("##############################################################################");
printCliCommands(log, cliCommandDescription, copyPasteCliCommands);
log.debug("Closing {}'s gRPC channel.", this.getClass().getSimpleName());
super.grpcStubs.close();