Skip to content
  • David Vorick's avatar
    add human readable conversions to storage prices · f2e3c1f9
    David Vorick authored
    Storage prices as interprested by the consensus package are in the units
    'Hastings per Block per Byte'. Now there are functions in the modules
    package to correctly convert between that and SC / TB / Mo.
    
    That conversion is currently defined in multiple places throughout the
    repo and has caused errors in the past. Now the conversion is defined in
    a single place and has a significant amount of testing to ensure that
    the conversion is happening correctly.
    
    TB was chosen as the base unit for space because when dealing with large
    volumes of storage TB is a lot easier to read. Furthermore, it's not
    super unreasonable that a host would want to go below 1 SC / GB / Mo,
    but lower than 1 SC / TB / Mo is effectively zero for any human level
    comprehension, even when storing data for many months.
    
    The value in the api test changed because there is now improved
    precision in the conversion as compared to the original conversion.
    f2e3c1f9