From 5ea862b1a29b50b0390c300000a046cd2ee00497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20B=C3=A9k=C3=A9si?= Date: Mon, 4 May 2026 13:47:34 +0200 Subject: [PATCH 1/5] feat: use amount argument and unit option for stake deposit --- src/command/stake/deposit.ts | 55 +++++++++++++++++++++++------------- test/command/stake.spec.ts | 4 +-- 2 files changed, 38 insertions(+), 21 deletions(-) diff --git a/src/command/stake/deposit.ts b/src/command/stake/deposit.ts index 984eb5a0..dd8e2cc8 100644 --- a/src/command/stake/deposit.ts +++ b/src/command/stake/deposit.ts @@ -1,9 +1,10 @@ import { BZZ } from '@ethersphere/bee-js' -import { LeafCommand, Option } from 'furious-commander' +import { Argument, LeafCommand, Option } from 'furious-commander' import { exit } from 'process' import { createSpinner } from '../../utils/spinner' import { RootCommand } from '../root-command' import { VerbosityLevel } from '../root-command/command-log' +import { Context } from 'vm' const MIN_DEPOSIT = BZZ.fromDecimalString('10') @@ -12,33 +13,49 @@ export class Deposit extends RootCommand implements LeafCommand { public readonly description = 'Stake xBZZ for the storage incentives' - @Option({ - key: 'bzz', - description: "Amount of BZZ to add to the node's stake", - type: 'string', - conflicts: 'plur', + @Argument({ + key: 'amount', + description: 'Amount of tokens to deposit', + type: 'decimal-string', required: true, + validate: (value: unknown, context: Context): string[] => { + if (context.options.unit === 'bzz') { + const amount = parseFloat(value as string) + + if (isNaN(amount) || amount <= 0) { + return [`Invalid amount '${value}'. Amount must be a positive number.`] + } + } else { + try { + const amount = BigInt(value as string) + + if (amount <= BigInt(0)) { + return [`Invalid amount '${value}'. Amount must be a positive integer.`] + } + } catch (e) { + return [`Invalid amount '${value}'. Amount must be a positive integer.`] + } + } + + return [] + }, }) - public amountBzz!: string | undefined + public amount!: string @Option({ - key: 'plur', - description: "Amount of PLUR to add to the node's stake", - type: 'bigint', - minimum: BigInt(1), - conflicts: 'bzz', - required: true, + key: 'unit', + type: 'enum', + description: 'Unit of the amount', + enum: ['bzz', 'plur'], + default: 'bzz', }) - public amountPlur!: bigint | undefined + public unit!: string public async run(): Promise { super.init() - if (this.amountPlur) { - await this.deposit(BZZ.fromPLUR(this.amountPlur)) - } else if (this.amountBzz) { - await this.deposit(BZZ.fromDecimalString(this.amountBzz)) - } + const amountBzz = this.unit === 'bzz' ? BZZ.fromDecimalString(this.amount) : BZZ.fromPLUR(this.amount) + await this.deposit(amountBzz) this.console.log('Stake deposited successfully!') this.console.log('Run `swarm-cli stake status` to check your stake status.') diff --git a/test/command/stake.spec.ts b/test/command/stake.spec.ts index 7c8edbd0..8ad0bb39 100644 --- a/test/command/stake.spec.ts +++ b/test/command/stake.spec.ts @@ -9,8 +9,8 @@ expect.extend({ describeCommand('Test Stake command', ({ consoleMessages }) => { test('should stake with bzz, plur, and print stake', async () => { await invokeTestCli(['stake', 'status', ...getBeeDevOption()]) - await invokeTestCli(['stake', 'deposit', '--bzz', '10', '--yes', ...getBeeDevOption()]) - await invokeTestCli(['stake', 'deposit', '--plur', '10', '--yes', ...getBeeDevOption()]) + await invokeTestCli(['stake', 'deposit', '10', '--unit', 'bzz', '--yes', ...getBeeDevOption()]) + await invokeTestCli(['stake', 'deposit', '10', '--unit', 'plur', '--yes', ...getBeeDevOption()]) await invokeTestCli(['stake', 'status', ...getBeeDevOption()]) expect(consoleMessages).toMatchLinesInOrder([ ['Staked xBZZ', '0.0000000000000000'], From ae0727f95d38a0203c38ef341060661eb1a5ec0b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 12:00:41 +0000 Subject: [PATCH 2/5] test: update test coverage --- test/coverage/coverage-summary.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/coverage/coverage-summary.json b/test/coverage/coverage-summary.json index ed815663..6fadc81a 100644 --- a/test/coverage/coverage-summary.json +++ b/test/coverage/coverage-summary.json @@ -1,4 +1,4 @@ -{"total": {"lines":{"total":2863,"covered":2186,"skipped":0,"pct":76.35},"statements":{"total":2884,"covered":2200,"skipped":0,"pct":76.28},"functions":{"total":343,"covered":271,"skipped":0,"pct":79},"branches":{"total":621,"covered":353,"skipped":0,"pct":56.84},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}} +{"total": {"lines":{"total":2871,"covered":2191,"skipped":0,"pct":76.31},"statements":{"total":2892,"covered":2205,"skipped":0,"pct":76.24},"functions":{"total":344,"covered":272,"skipped":0,"pct":79.06},"branches":{"total":626,"covered":356,"skipped":0,"pct":56.86},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/application.ts": {"lines":{"total":2,"covered":0,"skipped":0,"pct":0},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":2,"covered":0,"skipped":0,"pct":0},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/config.ts": {"lines":{"total":33,"covered":32,"skipped":0,"pct":96.96},"functions":{"total":1,"covered":0,"skipped":0,"pct":0},"statements":{"total":33,"covered":32,"skipped":0,"pct":96.96},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/curl.ts": {"lines":{"total":24,"covered":24,"skipped":0,"pct":100},"functions":{"total":7,"covered":7,"skipped":0,"pct":100},"statements":{"total":25,"covered":25,"skipped":0,"pct":100},"branches":{"total":13,"covered":12,"skipped":0,"pct":92.3}} @@ -67,7 +67,7 @@ ,"/home/runner/work/swarm-cli/swarm-cli/src/command/root-command/command-log.ts": {"lines":{"total":78,"covered":60,"skipped":0,"pct":76.92},"functions":{"total":9,"covered":6,"skipped":0,"pct":66.66},"statements":{"total":78,"covered":60,"skipped":0,"pct":76.92},"branches":{"total":11,"covered":7,"skipped":0,"pct":63.63}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/root-command/index.ts": {"lines":{"total":44,"covered":40,"skipped":0,"pct":90.9},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":44,"covered":40,"skipped":0,"pct":90.9},"branches":{"total":9,"covered":5,"skipped":0,"pct":55.55}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/root-command/printer.ts": {"lines":{"total":9,"covered":9,"skipped":0,"pct":100},"functions":{"total":6,"covered":6,"skipped":0,"pct":100},"statements":{"total":9,"covered":9,"skipped":0,"pct":100},"branches":{"total":1,"covered":1,"skipped":0,"pct":100}} -,"/home/runner/work/swarm-cli/swarm-cli/src/command/stake/deposit.ts": {"lines":{"total":40,"covered":31,"skipped":0,"pct":77.5},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":40,"covered":31,"skipped":0,"pct":77.5},"branches":{"total":17,"covered":11,"skipped":0,"pct":64.7}} +,"/home/runner/work/swarm-cli/swarm-cli/src/command/stake/deposit.ts": {"lines":{"total":48,"covered":36,"skipped":0,"pct":75},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":48,"covered":36,"skipped":0,"pct":75},"branches":{"total":22,"covered":14,"skipped":0,"pct":63.63}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/stake/index.ts": {"lines":{"total":8,"covered":8,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":8,"covered":8,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/stake/recover.ts": {"lines":{"total":22,"covered":10,"skipped":0,"pct":45.45},"functions":{"total":2,"covered":1,"skipped":0,"pct":50},"statements":{"total":22,"covered":10,"skipped":0,"pct":45.45},"branches":{"total":1,"covered":0,"skipped":0,"pct":0}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/stake/status.ts": {"lines":{"total":11,"covered":11,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":11,"covered":11,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} From c76f7123a23f9f13a797522eeb771f28fd151a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20B=C3=A9k=C3=A9si?= Date: Wed, 6 May 2026 10:24:17 +0200 Subject: [PATCH 3/5] refactor: make validation logic reusable --- src/command/cheque/deposit.ts | 24 ++---------------------- src/command/cheque/withdraw.ts | 24 ++---------------------- src/command/stake/deposit.ts | 24 ++---------------------- src/utils/validate.ts | 23 +++++++++++++++++++++++ 4 files changed, 29 insertions(+), 66 deletions(-) create mode 100644 src/utils/validate.ts diff --git a/src/command/cheque/deposit.ts b/src/command/cheque/deposit.ts index a516354a..9fae968f 100644 --- a/src/command/cheque/deposit.ts +++ b/src/command/cheque/deposit.ts @@ -1,8 +1,8 @@ import { Argument, LeafCommand, Option } from 'furious-commander' import { BZZ } from '@ethersphere/bee-js' -import { Context } from 'madlad' import { createKeyValue } from '../../utils/text' import { ChequeCommand } from './cheque-command' +import { validateTokenAmount } from '../../utils/validate' export class Deposit extends ChequeCommand implements LeafCommand { public readonly name = 'deposit' @@ -16,27 +16,7 @@ export class Deposit extends ChequeCommand implements LeafCommand { description: 'Amount of tokens to deposit', type: 'decimal-string', required: true, - validate: (value: unknown, context: Context): string[] => { - if (context.options.unit === 'bzz') { - const amount = parseFloat(value as string) - - if (isNaN(amount) || amount <= 0) { - return [`Invalid amount '${value}'. Amount must be a positive number.`] - } - } else { - try { - const amount = BigInt(value as string) - - if (amount <= BigInt(0)) { - return [`Invalid amount '${value}'. Amount must be a positive integer.`] - } - } catch (e) { - return [`Invalid amount '${value}'. Amount must be a positive integer.`] - } - } - - return [] - }, + validate: validateTokenAmount, }) public amount!: string diff --git a/src/command/cheque/withdraw.ts b/src/command/cheque/withdraw.ts index bf239e78..f404efbd 100644 --- a/src/command/cheque/withdraw.ts +++ b/src/command/cheque/withdraw.ts @@ -1,8 +1,8 @@ import { Argument, LeafCommand, Option } from 'furious-commander' import { BZZ } from '@ethersphere/bee-js' -import { Context } from 'madlad' import { createKeyValue } from '../../utils/text' import { ChequeCommand } from './cheque-command' +import { validateTokenAmount } from '../../utils/validate' export class Withdraw extends ChequeCommand implements LeafCommand { public readonly name = 'withdraw' @@ -16,27 +16,7 @@ export class Withdraw extends ChequeCommand implements LeafCommand { type: 'string', description: 'Amount of tokens to withdraw', required: true, - validate: (value: unknown, context: Context): string[] => { - if (context.options.unit === 'bzz') { - const amount = parseFloat(value as string) - - if (isNaN(amount) || amount <= 0) { - return [`Invalid amount '${value}'. Amount must be a positive number.`] - } - } else { - try { - const amount = BigInt(value as string) - - if (amount <= BigInt(0)) { - return [`Invalid amount '${value}'. Amount must be a positive integer.`] - } - } catch (e) { - return [`Invalid amount '${value}'. Amount must be a positive integer.`] - } - } - - return [] - }, + validate: validateTokenAmount, }) public amount!: string diff --git a/src/command/stake/deposit.ts b/src/command/stake/deposit.ts index dd8e2cc8..84f56df8 100644 --- a/src/command/stake/deposit.ts +++ b/src/command/stake/deposit.ts @@ -4,7 +4,7 @@ import { exit } from 'process' import { createSpinner } from '../../utils/spinner' import { RootCommand } from '../root-command' import { VerbosityLevel } from '../root-command/command-log' -import { Context } from 'vm' +import { validateTokenAmount } from '../../utils/validate' const MIN_DEPOSIT = BZZ.fromDecimalString('10') @@ -18,27 +18,7 @@ export class Deposit extends RootCommand implements LeafCommand { description: 'Amount of tokens to deposit', type: 'decimal-string', required: true, - validate: (value: unknown, context: Context): string[] => { - if (context.options.unit === 'bzz') { - const amount = parseFloat(value as string) - - if (isNaN(amount) || amount <= 0) { - return [`Invalid amount '${value}'. Amount must be a positive number.`] - } - } else { - try { - const amount = BigInt(value as string) - - if (amount <= BigInt(0)) { - return [`Invalid amount '${value}'. Amount must be a positive integer.`] - } - } catch (e) { - return [`Invalid amount '${value}'. Amount must be a positive integer.`] - } - } - - return [] - }, + validate: validateTokenAmount, }) public amount!: string diff --git a/src/utils/validate.ts b/src/utils/validate.ts new file mode 100644 index 00000000..7c512036 --- /dev/null +++ b/src/utils/validate.ts @@ -0,0 +1,23 @@ +import { Context } from 'madlad' + +export function validateTokenAmount(value: unknown, context: Context): string[] { + if (context.options.unit === 'bzz') { + const amount = parseFloat(value as string) + + if (isNaN(amount) || amount <= 0) { + return [`Invalid amount '${value}'. Amount must be a positive number.`] + } + } else { + try { + const amount = BigInt(value as string) + + if (amount <= BigInt(0)) { + return [`Invalid amount '${value}'. Amount must be a positive integer.`] + } + } catch (e) { + return [`Invalid amount '${value}'. Amount must be a positive integer.`] + } + } + + return [] +} From 9fd97fbf0fecf57a8a133686aef7abe29816aff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20B=C3=A9k=C3=A9si?= Date: Wed, 6 May 2026 10:31:28 +0200 Subject: [PATCH 4/5] ci: update deposit command --- .github/workflows/tests-rc.yaml | 10 +++++----- .github/workflows/tests.yaml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests-rc.yaml b/.github/workflows/tests-rc.yaml index 83c8ddc2..47cb462d 100644 --- a/.github/workflows/tests-rc.yaml +++ b/.github/workflows/tests-rc.yaml @@ -58,11 +58,11 @@ jobs: - name: Deposit to chequebook run: | - swarm-cli cheque deposit 100000000000000000 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:11633 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:21633 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:31633 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:41633 + swarm-cli cheque deposit 10 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:11633 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:21633 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:31633 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:41633 - name: Print swarm-cli status continue-on-error: true diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e752252a..7e8863bc 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -42,11 +42,11 @@ jobs: - name: Deposit to chequebook run: | - swarm-cli cheque deposit 100000000000000000 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:11633 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:21633 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:31633 - swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:41633 + swarm-cli cheque deposit 10 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:11633 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:21633 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:31633 + swarm-cli cheque deposit 10 --bee-api-url http://localhost:41633 - name: Print swarm-cli status continue-on-error: true From f2b99e3d6998325177e9f102ab528478a37582b7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 08:45:03 +0000 Subject: [PATCH 5/5] test: update test coverage --- test/coverage/coverage-summary.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/coverage/coverage-summary.json b/test/coverage/coverage-summary.json index 6fadc81a..98a99d9a 100644 --- a/test/coverage/coverage-summary.json +++ b/test/coverage/coverage-summary.json @@ -1,4 +1,4 @@ -{"total": {"lines":{"total":2871,"covered":2191,"skipped":0,"pct":76.31},"statements":{"total":2892,"covered":2205,"skipped":0,"pct":76.24},"functions":{"total":344,"covered":272,"skipped":0,"pct":79.06},"branches":{"total":626,"covered":356,"skipped":0,"pct":56.86},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}} +{"total": {"lines":{"total":2855,"covered":2180,"skipped":0,"pct":76.35},"statements":{"total":2876,"covered":2194,"skipped":0,"pct":76.28},"functions":{"total":342,"covered":270,"skipped":0,"pct":78.94},"branches":{"total":614,"covered":347,"skipped":0,"pct":56.51},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/application.ts": {"lines":{"total":2,"covered":0,"skipped":0,"pct":0},"functions":{"total":0,"covered":0,"skipped":0,"pct":100},"statements":{"total":2,"covered":0,"skipped":0,"pct":0},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/config.ts": {"lines":{"total":33,"covered":32,"skipped":0,"pct":96.96},"functions":{"total":1,"covered":0,"skipped":0,"pct":0},"statements":{"total":33,"covered":32,"skipped":0,"pct":96.96},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/curl.ts": {"lines":{"total":24,"covered":24,"skipped":0,"pct":100},"functions":{"total":7,"covered":7,"skipped":0,"pct":100},"statements":{"total":25,"covered":25,"skipped":0,"pct":100},"branches":{"total":13,"covered":12,"skipped":0,"pct":92.3}} @@ -12,11 +12,11 @@ ,"/home/runner/work/swarm-cli/swarm-cli/src/command/upload.ts": {"lines":{"total":223,"covered":157,"skipped":0,"pct":70.4},"functions":{"total":16,"covered":14,"skipped":0,"pct":87.5},"statements":{"total":224,"covered":158,"skipped":0,"pct":70.53},"branches":{"total":101,"covered":58,"skipped":0,"pct":57.42}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/cheque/cashout.ts": {"lines":{"total":32,"covered":30,"skipped":0,"pct":93.75},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":32,"covered":30,"skipped":0,"pct":93.75},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/cheque/cheque-command.ts": {"lines":{"total":25,"covered":21,"skipped":0,"pct":84},"functions":{"total":5,"covered":5,"skipped":0,"pct":100},"statements":{"total":26,"covered":22,"skipped":0,"pct":84.61},"branches":{"total":2,"covered":0,"skipped":0,"pct":0}} -,"/home/runner/work/swarm-cli/swarm-cli/src/command/cheque/deposit.ts": {"lines":{"total":25,"covered":23,"skipped":0,"pct":92},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":25,"covered":23,"skipped":0,"pct":92},"branches":{"total":8,"covered":7,"skipped":0,"pct":87.5}} +,"/home/runner/work/swarm-cli/swarm-cli/src/command/cheque/deposit.ts": {"lines":{"total":16,"covered":16,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":16,"covered":16,"skipped":0,"pct":100},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/cheque/index.ts": {"lines":{"total":9,"covered":9,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":9,"covered":9,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/cheque/list.ts": {"lines":{"total":13,"covered":13,"skipped":0,"pct":100},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":14,"covered":14,"skipped":0,"pct":100},"branches":{"total":1,"covered":1,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/cheque/withdraw-all.ts": {"lines":{"total":15,"covered":6,"skipped":0,"pct":40},"functions":{"total":2,"covered":1,"skipped":0,"pct":50},"statements":{"total":15,"covered":6,"skipped":0,"pct":40},"branches":{"total":1,"covered":0,"skipped":0,"pct":0}} -,"/home/runner/work/swarm-cli/swarm-cli/src/command/cheque/withdraw.ts": {"lines":{"total":25,"covered":23,"skipped":0,"pct":92},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":25,"covered":23,"skipped":0,"pct":92},"branches":{"total":8,"covered":7,"skipped":0,"pct":87.5}} +,"/home/runner/work/swarm-cli/swarm-cli/src/command/cheque/withdraw.ts": {"lines":{"total":16,"covered":16,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":16,"covered":16,"skipped":0,"pct":100},"branches":{"total":2,"covered":2,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/feed/feed-command.ts": {"lines":{"total":49,"covered":49,"skipped":0,"pct":100},"functions":{"total":5,"covered":5,"skipped":0,"pct":100},"statements":{"total":49,"covered":49,"skipped":0,"pct":100},"branches":{"total":13,"covered":13,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/feed/index.ts": {"lines":{"total":7,"covered":7,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":7,"covered":7,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/feed/print.ts": {"lines":{"total":80,"covered":26,"skipped":0,"pct":32.5},"functions":{"total":4,"covered":2,"skipped":0,"pct":50},"statements":{"total":81,"covered":26,"skipped":0,"pct":32.09},"branches":{"total":21,"covered":4,"skipped":0,"pct":19.04}} @@ -67,7 +67,7 @@ ,"/home/runner/work/swarm-cli/swarm-cli/src/command/root-command/command-log.ts": {"lines":{"total":78,"covered":60,"skipped":0,"pct":76.92},"functions":{"total":9,"covered":6,"skipped":0,"pct":66.66},"statements":{"total":78,"covered":60,"skipped":0,"pct":76.92},"branches":{"total":11,"covered":7,"skipped":0,"pct":63.63}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/root-command/index.ts": {"lines":{"total":44,"covered":40,"skipped":0,"pct":90.9},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":44,"covered":40,"skipped":0,"pct":90.9},"branches":{"total":9,"covered":5,"skipped":0,"pct":55.55}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/root-command/printer.ts": {"lines":{"total":9,"covered":9,"skipped":0,"pct":100},"functions":{"total":6,"covered":6,"skipped":0,"pct":100},"statements":{"total":9,"covered":9,"skipped":0,"pct":100},"branches":{"total":1,"covered":1,"skipped":0,"pct":100}} -,"/home/runner/work/swarm-cli/swarm-cli/src/command/stake/deposit.ts": {"lines":{"total":48,"covered":36,"skipped":0,"pct":75},"functions":{"total":4,"covered":4,"skipped":0,"pct":100},"statements":{"total":48,"covered":36,"skipped":0,"pct":75},"branches":{"total":22,"covered":14,"skipped":0,"pct":63.63}} +,"/home/runner/work/swarm-cli/swarm-cli/src/command/stake/deposit.ts": {"lines":{"total":39,"covered":30,"skipped":0,"pct":76.92},"functions":{"total":3,"covered":3,"skipped":0,"pct":100},"statements":{"total":39,"covered":30,"skipped":0,"pct":76.92},"branches":{"total":16,"covered":10,"skipped":0,"pct":62.5}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/stake/index.ts": {"lines":{"total":8,"covered":8,"skipped":0,"pct":100},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":8,"covered":8,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/stake/recover.ts": {"lines":{"total":22,"covered":10,"skipped":0,"pct":45.45},"functions":{"total":2,"covered":1,"skipped":0,"pct":50},"statements":{"total":22,"covered":10,"skipped":0,"pct":45.45},"branches":{"total":1,"covered":0,"skipped":0,"pct":0}} ,"/home/runner/work/swarm-cli/swarm-cli/src/command/stake/status.ts": {"lines":{"total":11,"covered":11,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":11,"covered":11,"skipped":0,"pct":100},"branches":{"total":0,"covered":0,"skipped":0,"pct":100}} @@ -109,4 +109,5 @@ ,"/home/runner/work/swarm-cli/swarm-cli/src/utils/rpc.ts": {"lines":{"total":37,"covered":9,"skipped":0,"pct":24.32},"functions":{"total":6,"covered":0,"skipped":0,"pct":0},"statements":{"total":37,"covered":9,"skipped":0,"pct":24.32},"branches":{"total":5,"covered":0,"skipped":0,"pct":0}} ,"/home/runner/work/swarm-cli/swarm-cli/src/utils/spinner.ts": {"lines":{"total":15,"covered":15,"skipped":0,"pct":100},"functions":{"total":2,"covered":2,"skipped":0,"pct":100},"statements":{"total":15,"covered":15,"skipped":0,"pct":100},"branches":{"total":5,"covered":3,"skipped":0,"pct":60}} ,"/home/runner/work/swarm-cli/swarm-cli/src/utils/text.ts": {"lines":{"total":21,"covered":18,"skipped":0,"pct":85.71},"functions":{"total":9,"covered":7,"skipped":0,"pct":77.77},"statements":{"total":22,"covered":19,"skipped":0,"pct":86.36},"branches":{"total":5,"covered":3,"skipped":0,"pct":60}} +,"/home/runner/work/swarm-cli/swarm-cli/src/utils/validate.ts": {"lines":{"total":11,"covered":9,"skipped":0,"pct":81.81},"functions":{"total":1,"covered":1,"skipped":0,"pct":100},"statements":{"total":11,"covered":9,"skipped":0,"pct":81.81},"branches":{"total":6,"covered":5,"skipped":0,"pct":83.33}} }