HomePhabricator

[refactor] get ValueFromAmount via an implicit Amount::operator UniValue()

Description

[refactor] get ValueFromAmount via an implicit Amount::operator UniValue()

Summary:
the number of decimals of precision that an Amount represents is currently all over the place on the codebase, this is one step to getting it all under one roof.

this seems more correct as well, representing as a UniValue is the Amount's job, not some free function. also less verbose code.

AmountFromValue probably should be an Amount constructor next.

Test Plan:

ninja check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D9603

Details

Provenance
majcostaAuthored on May 26 2021, 19:13
majcostaPushed on May 28 2021, 20:10
Reviewer
Restricted Project
Differential Revision
D9603: [refactor] get ValueFromAmount via an implicit Amount::operator UniValue()
Parents
rABC7eb6c233b623: Change format of log2_work for uniform output (zero-padded)
Branches
Unknown
Tags
Unknown