From fc377b926d259f3c7a155057806ee1782675a73f Mon Sep 17 00:00:00 2001 From: Cafe137 Date: Wed, 26 Jun 2024 18:14:35 +0200 Subject: [PATCH] feat: print helpful message after topup and dilute --- src/command/stamp/dilute.ts | 6 ++++-- src/command/stamp/topup.ts | 6 ++++-- test/command/stamp.spec.ts | 6 ++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/command/stamp/dilute.ts b/src/command/stamp/dilute.ts index 44c373e4..88e3e3ff 100644 --- a/src/command/stamp/dilute.ts +++ b/src/command/stamp/dilute.ts @@ -37,7 +37,7 @@ export class Dilute extends StampCommand implements LeafCommand { throw new CommandLineError(`This postage stamp already has depth ${details.depth}. The new value must be higher.`) } - const spinner = createSpinner('Dilute in progress. This may take a while.') + const spinner = createSpinner('Dilute in progress. This may take a few minutes.') if (this.verbosity !== VerbosityLevel.Quiet && !this.curl) { spinner.start() @@ -49,6 +49,8 @@ export class Dilute extends StampCommand implements LeafCommand { spinner.stop() } - await this.printDepthAndAmount(this.stamp) + this.console.log(`Dilute finished. Your Bee node will soon synchronize the new values from the blockchain.`) + this.console.log(`This can take a few minutes until the value is updated.`) + this.console.log(`Check it later with swarm-cli stamp show ${this.stamp}`) } } diff --git a/src/command/stamp/topup.ts b/src/command/stamp/topup.ts index 36d57b64..f169a3e0 100644 --- a/src/command/stamp/topup.ts +++ b/src/command/stamp/topup.ts @@ -29,7 +29,7 @@ export class Topup extends StampCommand implements LeafCommand { this.stamp = await pickStamp(this.bee, this.console) } - const spinner = createSpinner('Topup in progress. This may take a while.') + const spinner = createSpinner('Topup in progress. This may take a few minutes.') if (this.verbosity !== VerbosityLevel.Quiet && !this.curl) { spinner.start() @@ -41,6 +41,8 @@ export class Topup extends StampCommand implements LeafCommand { spinner.stop() } - await this.printDepthAndAmount(this.stamp) + this.console.log(`Topup finished. Your Bee node will soon synchronize the new values from the blockchain.`) + this.console.log(`This can take a few minutes until the value is updated.`) + this.console.log(`Check it later with swarm-cli stamp show ${this.stamp}`) } } diff --git a/test/command/stamp.spec.ts b/test/command/stamp.spec.ts index 20e4d4e5..e31e325f 100644 --- a/test/command/stamp.spec.ts +++ b/test/command/stamp.spec.ts @@ -159,8 +159,7 @@ describeCommand( expect(hasMessageContaining('This postage stamp already has depth 19. The new value must be higher.')).toBe(true) consoleMessages.length = 0 await invokeTestCli(['stamp', 'dilute', '--stamp', postageBatchId, '--depth', '20']) - expect(getNthLastMessage(2)).toContain('Depth') - expect(getNthLastMessage(2)).toContain('20') + expect(getNthLastMessage(3)).toContain('Dilute finished') }) it.skip('should top up stamp', async () => { @@ -181,8 +180,7 @@ describeCommand( const { postageBatchId } = command consoleMessages.length = 0 await invokeTestCli(['stamp', 'topup', '--stamp', postageBatchId, '--amount', '1k']) - expect(getNthLastMessage(1)).toContain('Amount') - expect(getNthLastMessage(1)).toContain('2000') + expect(getNthLastMessage(3)).toContain('Topup finished') }) }, )