Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Refactor Balance to Use Dictionary and Struct Patterns
Notes to the reviewers
Previously in 0.30.0
Balance
was a dictionary. Currently in the 1.0 migrationBalance
is an interface.The main motivation for this PR came via testing our bdk-swift 1.0.0 bindings locally in an iOS app where
Balance
was an interface; it made me wantBalance
to go back to being a dictionary instead of an interface if possible.Example: In bdk-swift
Balance
is more ergonomic as a concrete type in my opinion (a struct instead of a protocol); an example where that is nice is ifBalance
is a struct it can be instantiated and mocked out, as opposed to ifBalance
is a protocol then aMyBalance
struct needs to be created that conforms to the protocol Balance.Key Changes:
Balance
is now a dictionary instead of an interface.Balance
is now a struct instead of an implTests across all platforms have been updated to reflect this refactor.
Changelog notice
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
Bugfixes: