[bisq-network/bisq] Refactor BtcWalletService to let api override fee rates (#4896)
Stan
notifications at github.com
Fri Dec 4 18:28:44 CET 2020
`BtcWalletService` was changed to allow the api to override tx fee rates from the `sendbsq` and `sendbtc` methods. The api methods will still be able to use the network fee service and custom tx fee rate preference, and set / unset the custom tx fee rate preference, but the change will permit the addition of an optional `txFeeRate` parameter to the `sendbsq` and `sendbtc` methods (todo). A few other minor changes (style and removal of never thrown ex spec) were also made to this class.
Two `BtcWalletService` methods were refactored.
- The redundant (was always true) `boolean isSendTx` argument was removed from the `completePreparedVoteRevealTx` method signature.
- The redundant (was always true) `boolean useCustomTxFee` was removed from the `completePreparedBsqTx` method signature.
- The `completePreparedSendBsqTx` method was overloaded with a 2nd parameter (`Coin txFeePerVbyte`) to allow api to override fee service and custom tx fee rate when sending BSQ or BTC.
- The `completePreparedBsqTx` method was overloaded with a 3rd parameter (`Coin txFeePerVbyte`) to allow api to override fee service and custom tx fee rate when sending BSQ or BTC.
The following line was deleted from the `completePreparedBsqTx` method because `txFeePerVbyte` is now an argument:
`Coin txFeePerVbyte = useCustomTxFee ? getTxFeeForWithdrawalPerVbyte() : feeService.getTxFeePerVbyte();`
This `useCustomTxFee` value was always true, and redundant here because `getTxFeeForWithdrawalPerVbyte()` returns `feeService.getTxFeePerVbyte()` or the custom fee rate preference. i.e.,
`Coin txFeePerVbyte = useCustomTxFee ? getTxFeeForWithdrawalPerVbyte() : feeService.getTxFeePerVbyte();`
is equivalent to
`Coin txFeePerVbyte = getTxFeeForWithdrawalPerVbyte();`
`LockupTxService`, `UnlockTxService`, `BsqSendView`, and `BsqTransferService` were adjusted to the `BtcWalletService` refactoring.
This is the 2st in a chain of PRs beginning with https://github.com/bisq-network/bisq/pull/4884.
PR https://github.com/bisq-network/bisq/pull/4884 should be reviewed before this one.
You can view, comment on, or merge this pull request online at:
https://github.com/bisq-network/bisq/pull/4896
-- Commit Summary --
* Refactor: move getDust(Transaction transaction)
* Refactor BtcWalletService to let api override fee rates
* Merge branch 'master' into 02-refactor-completePreparedSendBsqTx
-- File Changes --
M core/src/main/java/bisq/core/btc/wallet/BsqTransferService.java (2)
M core/src/main/java/bisq/core/btc/wallet/BtcWalletService.java (40)
M core/src/main/java/bisq/core/btc/wallet/WalletService.java (14)
M core/src/main/java/bisq/core/dao/governance/bond/lockup/LockupTxService.java (2)
M core/src/main/java/bisq/core/dao/governance/bond/unlock/UnlockTxService.java (2)
M desktop/src/main/java/bisq/desktop/main/dao/wallet/send/BsqSendView.java (4)
M desktop/src/main/java/bisq/desktop/main/funds/withdrawal/WithdrawalView.java (20)
-- Patch Links --
https://github.com/bisq-network/bisq/pull/4896.patch
https://github.com/bisq-network/bisq/pull/4896.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4896
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20201204/216bf20b/attachment.htm>
More information about the bisq-github
mailing list