HomePhabricator

[Cashtab] Replace toSatoshi method in satoshisToSend calc

Description

[Cashtab] Replace toSatoshi method in satoshisToSend calc

Summary:
Replace the toSatoshi library method with new function toSmallestDenomination in one instances, the cacluation of the satoshisToSend amount. Add a unit test to confirm this function returns the same result as the previous method.

This is part of an ongoing refactor of the sendBch function to accept arbitrary decimal places for sending BCHA. Two more instances of toSatoshi need to be removed, but they require separate refactoring and should be in a different diff.

Test Plan: npm test

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Joey King <joseph.roy.king@gmail.com>Authored on Feb 1 2021, 21:36
bytesofmanPushed on Feb 3 2021, 13:31
Reviewer
Restricted Project
Differential Revision
D9127: [Cashtab] Replace toSatoshi method in satoshisToSend calc
Parents
rABC536bc56bda91: [Cashtab] Replace remaining instances of CashTab with Cashtab
Branches
Unknown
Tags
Unknown