diff options
author | ishaanam <ishaana.misra@gmail.com> | 2022-02-21 17:31:52 -0500 |
---|---|---|
committer | Murch <murch@murch.one> | 2022-03-29 16:37:49 -0400 |
commit | bb84b7145b31dbfdcb4cf0b9b6e612a57e573993 (patch) | |
tree | 55b3791642c69742be1305e22a4e10b804e47576 /test/functional/wallet_sendall.py | |
parent | 49090ec4025152c847be8a5ab6aa6f379e345260 (diff) |
add tests for no recipient and using send_max while inputs are specified
Diffstat (limited to 'test/functional/wallet_sendall.py')
-rwxr-xr-x | test/functional/wallet_sendall.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/functional/wallet_sendall.py b/test/functional/wallet_sendall.py index ff620f04cb..aa8d2a9d2c 100755 --- a/test/functional/wallet_sendall.py +++ b/test/functional/wallet_sendall.py @@ -240,6 +240,30 @@ class SendallTest(BitcoinTestFramework): foreign_utxo["vout"]), self.wallet.sendall, recipients=[self.remainder_target], options={"inputs": [foreign_utxo]}) + @cleanup + def sendall_fails_on_no_address(self): + self.log.info("Test sendall fails because no address is provided") + self.add_utxos([19, 2]) + + assert_raises_rpc_error( + -8, + "Must provide at least one address without a specified amount" , + self.wallet.sendall, + [] + ) + + @cleanup + def sendall_fails_on_specific_inputs_with_send_max(self): + self.log.info("Test sendall fails because send_max is used while specific inputs are provided") + self.add_utxos([15, 6]) + utxo = self.wallet.listunspent()[0] + + assert_raises_rpc_error(-8, + "Cannot combine send_max with specific inputs.", + self.wallet.sendall, + recipients=[self.remainder_target], + options={"inputs": [utxo], "send_max": True}) + def run_test(self): self.nodes[0].createwallet("activewallet") self.wallet = self.nodes[0].get_wallet_rpc("activewallet") @@ -282,5 +306,11 @@ class SendallTest(BitcoinTestFramework): # Fails for the right reasons on missing or previously spent UTXOs self.sendall_fails_on_missing_input() + # Sendall fails when no address is provided + self.sendall_fails_on_no_address() + + # Sendall fails when using send_max while specifying inputs + self.sendall_fails_on_specific_inputs_with_send_max() + if __name__ == '__main__': SendallTest().main() |