Skip to content

convert refactor

Refactored the conversion functionality between bitcoin units to clear some unexpected behaviors with edge cases. In particular this allowed:

  • to enforce correct computations through use of Decimals instead of floats, inexact conversions raise explicit errors, for instance when the value input by user exceeds the maximum available precision;
  • better modularity between convert and its helper _convert_value
  • improved error handling, docstring and comments
  • wider test suite

Merge request reports

Loading