aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSishir Giri <sishirg27@gmail.com>2020-09-26 17:58:56 -0700
committerSishir Giri <sishirg27@gmail.com>2020-09-28 15:04:56 -0700
commit69cf5d4eeb73f7d685e915fc17af64634d88a4a2 (patch)
treebf3a3b9808e09ac2a66ab814d819a45f416b0a14 /test
parentd5863c0b3e20d56acf7246008b7832efde68ab21 (diff)
[test] Make sure send rpc returns fee reason
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/wallet_basic.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py
index 4f1cadc835..68498fdbf8 100755
--- a/test/functional/wallet_basic.py
+++ b/test/functional/wallet_basic.py
@@ -661,5 +661,17 @@ class WalletTest(BitcoinTestFramework):
assert_array_result(tx["details"], {"category": "receive"}, expected_receive_vout)
assert_equal(tx[verbose_field], self.nodes[0].decoderawtransaction(tx["hex"]))
+ self.log.info("Test send* RPCs with verbose=True")
+ address = self.nodes[0].getnewaddress("test")
+ txid_feeReason_one = self.nodes[2].sendtoaddress(address = address, amount = 5, verbose = True)
+ assert_equal(txid_feeReason_one["fee_reason"], "Fallback fee")
+ txid_feeReason_two = self.nodes[2].sendmany(dummy = '', amounts = {address: 5}, verbose = True)
+ assert_equal(txid_feeReason_two["fee_reason"], "Fallback fee")
+ self.log.info("Test send* RPCs with verbose=False")
+ txid_feeReason_three = self.nodes[2].sendtoaddress(address = address, amount = 5, verbose = False)
+ assert_equal(self.nodes[2].gettransaction(txid_feeReason_three)['txid'], txid_feeReason_three)
+ txid_feeReason_four = self.nodes[2].sendmany(dummy = '', amounts = {address: 5}, verbose = False)
+ assert_equal(self.nodes[2].gettransaction(txid_feeReason_four)['txid'], txid_feeReason_four)
+
if __name__ == '__main__':
WalletTest().main()