p2pderivatives / rust-bitcoin-coin-selection

10 stars 5 forks source link

Use effective_value in Rust Bitcoin #27

Closed yancyribbens closed 10 months ago

yancyribbens commented 10 months ago

This PR removes the effective_value calculation instead preferring to outsource the calculation to Rust Bitcoin. Also, temporarily remove the error mod for now since Rust Bitcoin returns Option instead of Result. Leaving in Draft state until the outcome of https://github.com/rust-bitcoin/rust-bitcoin/pull/2230 is decided.

yancyribbens commented 10 months ago

@Tibo-lg maybe you care to comment on this or https://github.com/rust-bitcoin/rust-bitcoin/pull/2230

Tibo-lg commented 10 months ago

It doesn't build for me locally:

error[E0599]: no method named `effective_value` found for struct `TxOut` in the current scope
  --> src/single_random_draw.rs:46:25
   |
46 |             w_utxo.utxo.effective_value(fee_rate, w_utxo.satisfaction_weight)?;
   |                         ^^^^^^^^^^^^^^^ method not found in `TxOut`
yancyribbens commented 10 months ago

It doesn't build for me locally:

Oops, I was asked to make this a stand-alone function instead of a method on TxOut. I updated this PR so it should work again now.

yancyribbens commented 10 months ago

Merging for now since there seems to be no further feedback. Waiting on MR https://github.com/rust-bitcoin/rust-bitcoin/pull/2230 to resolve. Will circle back and remove my fork of rust-bitcoin once resolved.