Page MenuHomePhabricator

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

Authored by majcosta on May 28 2021, 15:22.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

fix oversight on test cases

remove spurious include in amount_tests.cpp

This revision is now accepted and ready to land.May 28 2021, 19:54