Skip to content
This repository was archived by the owner on Oct 24, 2020. It is now read-only.
This repository was archived by the owner on Oct 24, 2020. It is now read-only.

misleading use of BigDecimal #4

@spicylobe

Description

@spicylobe

Every field that represents a value in the "model" classes uses a BigDecimal. This is misleading because BlockCypher always sends and receives satoshis (which are whole numbers, not decimals).

Affected fields include:

Address.value
Transaction.fees
Transaction.total
Input.outputValue
Output.value
TransactionSummary.value

The TransactionService has two methods that take satoshi parameters as longs, and then wrap them in BigDecimal. This implies that longs are large enough to cover any value we may wish to represent. I'm not an expert on bitcoin/altcoin internals and do not know how many satoshis (or altcoin units) could theoretically exist, but if it's more than 9223372036854775807 (which is 92233720368 BTC) then BigInteger would be a safer bet. I'd probably lean towards playing it safe.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions