Merge bitcoin/bitcoin#26622: test: Add test for sendall min-fee setting

cb44c5923a test: Add sendall test for min-fee setting (Aurèle Oulès)

Pull request description:

  While experimenting with mutation testing it appeared that the minimum fee-rate check was not tested for the `sendall` RPC.

  https://bcm-ui.aureleoules.com/mutations/3581479318544ea6b97f788cec6e6ef1

ACKs for top commit:
  0xB10C:
    ACK cb44c5923a
  ishaanam:
    ACK cb44c5923a
  stickies-v:
    re-ACK [cb44c59](cb44c5923a)

Tree-SHA512: 31978436e1f01cc6abf44addc62b6887e65611e9a7ae7dc72e6a73cdfdb3a6a4f0a6c53043b47ecd1b10fc902385a172921e68818a7f5061c96e5e1ef5280b48
This commit is contained in:
MarcoFalke 2022-12-03 12:19:55 +01:00
commit cac29f5cd6
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

View File

@ -284,6 +284,12 @@ class SendallTest(BitcoinTestFramework):
recipients=[self.remainder_target], recipients=[self.remainder_target],
fee_rate=100000) fee_rate=100000)
@cleanup
def sendall_fails_on_low_fee(self):
self.log.info("Test sendall fails if the transaction fee is lower than the minimum fee rate setting")
assert_raises_rpc_error(-8, "Fee rate (0.999 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)",
self.wallet.sendall, recipients=[self.recipient], fee_rate=0.999)
@cleanup @cleanup
def sendall_watchonly_specific_inputs(self): def sendall_watchonly_specific_inputs(self):
self.log.info("Test sendall with a subset of UTXO pool in a watchonly wallet") self.log.info("Test sendall with a subset of UTXO pool in a watchonly wallet")
@ -376,6 +382,9 @@ class SendallTest(BitcoinTestFramework):
# Sendall fails when providing a fee that is too high # Sendall fails when providing a fee that is too high
self.sendall_fails_on_high_fee() self.sendall_fails_on_high_fee()
# Sendall fails when fee rate is lower than minimum
self.sendall_fails_on_low_fee()
# Sendall succeeds with watchonly wallets spending specific UTXOs # Sendall succeeds with watchonly wallets spending specific UTXOs
self.sendall_watchonly_specific_inputs() self.sendall_watchonly_specific_inputs()