bitcoindevkit / bitcoindevkit/bdk_wallet
TxGraph::balance's API is too complicated
- Dominant language
- Rust
- Stars
- 59
- Forks
- 105
- Avg merge
- 10d 9h
- Merged PRs (30d)
- 1
Description
```rust
pub fn try_balance(
&self,
chain: &C,
chain_tip: BlockId,
outpoints: impl IntoIterator,
mut trust_predicate: impl FnMut(&OI, &Script) -> bool,
) -> Result {
```
`OI` is unnecessary. The caller passes it to us and then we query it. It can just be:
```rust
pub fn try_balance(
&self,
chain: &C,
chain_tip: BlockId,
outpoints: impl IntoIterator,
mut trust_predicate: impl FnMut(&OutPoint, &Script) -> bool,
) -> Result {
```
If the caller wants to know the value of `OI` in trust predicate it can just look it up itself via the `OutPoint`.
Contributor guide
Assessment
This issue has not been assessed yet.