From f6b588647aa674f2aaf72c02eca8d742757ced45 Mon Sep 17 00:00:00 2001 From: mat-if <97762857+mat-if@users.noreply.github.com> Date: Tue, 13 Aug 2024 13:51:05 -0700 Subject: [PATCH] update mempool descriptions and add json support to status (#5221) --- ironfish-cli/src/commands/mempool/status.ts | 11 +++++++---- ironfish-cli/src/commands/mempool/transactions.ts | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ironfish-cli/src/commands/mempool/status.ts b/ironfish-cli/src/commands/mempool/status.ts index 14bb320e1d..06067158c4 100644 --- a/ironfish-cli/src/commands/mempool/status.ts +++ b/ironfish-cli/src/commands/mempool/status.ts @@ -6,14 +6,16 @@ import { GetMempoolStatusResponse } from '@ironfish/sdk' import { Flags } from '@oclif/core' import blessed from 'blessed' import { IronfishCommand } from '../../command' -import { RemoteFlags } from '../../flags' +import { JsonFlags, RemoteFlags } from '../../flags' import * as ui from '../../ui' export default class Status extends IronfishCommand { - static description = 'Show the status of the Mempool' + static description = "show the mempool's status" + static enableJsonFlag = true static flags = { ...RemoteFlags, + ...JsonFlags, follow: Flags.boolean({ char: 'f', default: false, @@ -21,14 +23,15 @@ export default class Status extends IronfishCommand { }), } - async start(): Promise { + async start(): Promise { const { flags } = await this.parse(Status) if (!flags.follow) { const client = await this.connectRpc() const response = await client.mempool.getMempoolStatus() this.log(renderStatus(response.content)) - this.exit(0) + + return response.content } // Console log will create display issues with Blessed diff --git a/ironfish-cli/src/commands/mempool/transactions.ts b/ironfish-cli/src/commands/mempool/transactions.ts index a2d82b5829..70f3878cea 100644 --- a/ironfish-cli/src/commands/mempool/transactions.ts +++ b/ironfish-cli/src/commands/mempool/transactions.ts @@ -31,7 +31,7 @@ const parseMinMax = (input: string): MinMax | undefined => { } export class TransactionsCommand extends IronfishCommand { - static description = `List transactions in the mempool` + static description = `list mempool transactions` static flags = { ...RemoteFlags,