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
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
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | stickies-v, 0xB10C, ishaanam |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Concept ACK, but any reason not to put this in wallet_sendall.py?
Concept ACK, but any reason not to put this in wallet_sendall.py?
You're right it makes more sense. Updated.
329 | @@ -325,6 +330,7 @@ def sendall_fails_with_transaction_too_large(self): 330 | self.wallet.sendall, 331 | recipients=[self.remainder_target]) 332 | 333 | +
nit: this newline is not in line with PEP8
Whoops missed this thanks
384 | @@ -379,6 +385,9 @@ def run_test(self): 385 | # Sendall succeeds with watchonly wallets spending specific UTXOs 386 | self.sendall_watchonly_specific_inputs() 387 | 388 | + # Sendall fails when fee rate is lower than minimum 389 | + self.sendall_fails_on_low_fee()
nit: would be more logical to put this right before/after the high fees test?
310 | @@ -311,6 +311,11 @@ def sendall_watchonly_specific_inputs(self): 311 | assert_equal(decoded["tx"]["vin"][0]["vout"], utxo["vout"]) 312 | assert_equal(decoded["tx"]["vout"][0]["scriptPubKey"]["address"], self.remainder_target) 313 | 314 | + @cleanup 315 | + def sendall_fails_on_low_fee(self): 316 | + assert_raises_rpc_error(-8, "Fee rate (0.999 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)",
every other test starts with a self.log.info, probably best to be consistent?
Approach ACK 705a03cdc7a6e0feee24a0522162c53cc9b9ff00
Updated per feedback, thanks @stickies-v.
283 | @@ -284,6 +284,12 @@ def sendall_fails_on_high_fee(self): 284 | recipients=[self.remainder_target], 285 | fee_rate=100000) 286 | 287 | + @cleanup 288 | + def sendall_fails_on_low_fee(self): 289 | + self.log.info("Test sendall fails if the transaction fee is too low")
nit: would prefer to be precise
self.log.info("Test sendall fails if the transaction fee is lower than the minimum fee rate setting")
Done
283 | @@ -284,6 +284,12 @@ def sendall_fails_on_high_fee(self): 284 | recipients=[self.remainder_target], 285 | fee_rate=100000) 286 | 287 | + @cleanup 288 | + def sendall_fails_on_low_fee(self): 289 | + self.log.info("Test sendall fails if the transaction fee is too low") 290 | + assert_raises_rpc_error(-8, "Fee rate (0.999 sat/vB) is lower than the minimum fee rate setting (1.000 sat/vB)", 291 | + self.wallet.sendall, recipients=[self.recipient], options={"fee_rate": 0.999})
nit: fee_rate is also defined as a regular argument, so no need to use options
self.wallet.sendall, recipients=[self.recipient], fee_rate=0.999)
Done
ACK 1bfa0de5f
re-ACK cb44c59
ACK cb44c5923a7c0ba15400d2b420faedd39cdce128
Applied the diff from your mutation test and checked that the test now fails and would kill the mutation.
Maybe a feature to consider for your mutation testing: Pushing a failed mutation diff to a branch somewhere. Allows to quickly cherry-pick the fix on top and test that it's fixed.
Maybe a feature to consider for your mutation testing: Pushing a failed mutation diff to a branch somewhere. Allows to quickly cherry-pick the fix on top and test that it's fixed.
Thanks, will look into it.
ACK cb44c5923a7c0ba15400d2b420faedd39cdce128