-
Notifications
You must be signed in to change notification settings - Fork 439
Closed
Labels
discussionThere's still a discussion ongoingThere's still a discussion ongoing
Milestone
Description
It was decided initially to only include bitcoin::Amount at the API boundary. No doubt this makes for a better UX. Would it be worth replacing all satoshi amounts represented internally as u64 with the Amount type?
One concern would be: why introduce an abstraction over the denomination when sats are already the standard used throughout the library, but it's possible this fear is overblown.
Alternatives:
- Use a type alias such as
pub type Satoshis = u64;However this serves no real purpose at the type level other than to enhance readability. - Use a custom new type and provide conversions to/from
Amount. The problem with this is re-inventing the wheel when theAmounttype already exists.
So with respect to the internals we should either use Amount everywhere or (almost) nowhere, which seems to be similarly expressed here #823 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
discussionThere's still a discussion ongoingThere's still a discussion ongoing
Type
Projects
Status
Done