Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
}
if (cmd === "r") {
//reset if given the reset command
//(but not if nothing is loaded)
if (this.session.view(selectors.session.status.loaded)) {
await this.session.reset();
} else {
this.printer.print("No transaction loaded.");
this.printer.print("");
}
}
if (cmd === "t") {
if (!this.session.view(selectors.session.status.loaded)) {
let txSpinner = ora(DebugUtils.formatTransactionStartMessage()).start();
await this.session.load(cmdArgs);
//if load succeeded
if (this.session.view(selectors.session.status.success)) {
txSpinner.succeed();
//if successful, change prompt
this.setPrompt(DebugUtils.formatPrompt(this.network, cmdArgs));
} else {
txSpinner.fail();
loadFailed = true;
}
} else {
loadFailed = true;
this.printer.print(
"Please unload the current transaction before loading a new one."
);
}