Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
327 stars 208 forks source link

feat: vesting calculator should support arbitrary coins #3447

Closed JimLarson closed 3 years ago

JimLarson commented 3 years ago

What is the Problem Being Solved?

The vesting calculator currently only handles a single currency at a time, and that currency must be ubld. It is also limited to 64-bit int quantities. It also does not use established external notation for coins in its input or pretty-printed output.

Description of the Design

Replace the current --amount and --denom flags with a single --coins flag, parsing sdk.Coins. Use appropriate sdk libraries throughout. Calculate the division of each denomination separately and zip them together for each vesting event.

Security Considerations

Will give up current restriction to ubld in the name of generality, but makes the denomination more subject to typos.

Giving up on plan for comma-separated numbers on input and output in the name of consistency with other tools, so sharing the risk of entering too few/many digits for large quantities.

Test Plan

Add appropriate unit tests.

JimLarson commented 3 years ago

Fixed by https://github.com/agoric-labs/cosmos-sdk/pull/73