ethersphere / swarm-cli

Manage your Bee node and interact with the Swarm network via the CLI
BSD 3-Clause "New" or "Revised" License
48 stars 21 forks source link

feat: display estimated effective volume during buy (#479) #485

Open LevilkTheReal opened 8 months ago

LevilkTheReal commented 8 months ago

Issue: https://github.com/ethersphere/swarm-cli/issues/479

Solution:

Screenshot 2023-12-05 at 15 34 12

@Cafe137 FYI

I could not run the tests. I am getting this error. Any idea?

Screenshot 2023-12-05 at 16 34 37

(I've extended the tests with this line tho: expect(consoleMessages[2]).toBe('Estimated effective volume: 41.17 GB'))

Another thing. The Storage class is not that precise. For instance, it converts the incoming effective bytes to 41.17 GB which should be 44.21 GB.

Also, there are different converters/repos. Is it worth creating a shared one?

Cafe137 commented 6 months ago

@LevilkTheReal For depths <= 21, I would maybe remove the message:

Estimated effective volume: 0 B

It looks like a bug.

Instead I would print a human friendly message, something like "effective volume is likely to be smaller than estimated capacity".

What do you think?

LevilkTheReal commented 6 months ago

@LevilkTheReal For depths <= 21, I would maybe remove the message:

Estimated effective volume: 0 B

It looks like a bug.

Instead I would print a human friendly message, something like "effective volume is likely to be smaller than estimated capacity".

What do you think?

Sounds good! What do you think about the fix? Should I just write that message or can I keep the key for the message?