diff options
author | Murch <murch@murch.one> | 2022-01-12 13:59:41 -0500 |
---|---|---|
committer | Murch <murch@murch.one> | 2022-03-29 16:37:47 -0400 |
commit | 49090ec4025152c847be8a5ab6aa6f379e345260 (patch) | |
tree | c0e9b1badef2d4a5b3f9d2b2b680264e629c8291 /test/functional/test_runner.py | |
parent | 902793c7772e5bdd5aae5b0d20a32c02a1a6dc7c (diff) | |
download | bitcoin-49090ec4025152c847be8a5ab6aa6f379e345260.tar.xz |
Add sendall RPC née sweep
_Motivation_
Currently, the wallet uses a fSubtractFeeAmount (SFFO) flag on the
recipients objects for all forms of sending calls. According to the
commit discussion, this flag was chiefly introduced to permit sweeping
without manually calculating the fees of transactions. However, the flag
leads to unintuitive behavior and makes it more complicated to test
many wallet RPCs exhaustively. We proposed to introduce a dedicated
`sendall` RPC with the intention to cover this functionality.
Since the proposal, it was discovered in further discussion that our
proposed `sendall` rpc and SFFO have subtly different scopes of
operation.
• sendall:
Use _specific UTXOs_ to pay a destination the remainder after fees.
• SFFO:
Use a _specific budget_ to pay an address the remainder after fees.
While `sendall` will simplify cases of spending from specific UTXOs,
emptying a wallet, or burning dust, we realized that there are some
cases in which SFFO is used to pay other parties from a limited budget,
which can often lead to the creation of change outputs. This cannot be
easily replicated using `sendall` as it would require manual computation
of the appropriate change amount.
As such, sendall cannot replace all uses of SFFO, but it still has a
different use case and will aid in simplifying some wallet calls and
numerous wallet tests.
_Sendall call details_
The proposed sendall call builds a transaction from a specific subset of
the wallet's UTXO pool (by default all of them) and assigns the funds to
one or more receivers. Receivers can either be specified with a specific
amount or receive an equal share of the remaining unassigned funds. At
least one recipient must be provided without assigned amount to collect
the remainder. The `sendall` call will never create change. The call has
a `send_max` option that changes the default behavior of spending all
UTXOs ("no UTXO left behind"), to maximizing the output amount of the
transaction by skipping uneconomic UTXOs. The `send_max` option is
incompatible with providing a specific set of inputs.
Diffstat (limited to 'test/functional/test_runner.py')
-rwxr-xr-x | test/functional/test_runner.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 306c8e7ff0..94181b2cf0 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -278,6 +278,8 @@ BASE_SCRIPTS = [ 'wallet_create_tx.py --legacy-wallet', 'wallet_send.py --legacy-wallet', 'wallet_send.py --descriptors', + 'wallet_sendall.py --legacy-wallet', + 'wallet_sendall.py --descriptors', 'wallet_create_tx.py --descriptors', 'wallet_taproot.py', 'wallet_inactive_hdchains.py', |