Skip to content

Commit 69cf5d4

Browse files
committed
[test] Make sure send rpc returns fee reason
1 parent d5863c0 commit 69cf5d4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/functional/wallet_basic.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,5 +661,17 @@ def run_test(self):
661661
assert_array_result(tx["details"], {"category": "receive"}, expected_receive_vout)
662662
assert_equal(tx[verbose_field], self.nodes[0].decoderawtransaction(tx["hex"]))
663663

664+
self.log.info("Test send* RPCs with verbose=True")
665+
address = self.nodes[0].getnewaddress("test")
666+
txid_feeReason_one = self.nodes[2].sendtoaddress(address = address, amount = 5, verbose = True)
667+
assert_equal(txid_feeReason_one["fee_reason"], "Fallback fee")
668+
txid_feeReason_two = self.nodes[2].sendmany(dummy = '', amounts = {address: 5}, verbose = True)
669+
assert_equal(txid_feeReason_two["fee_reason"], "Fallback fee")
670+
self.log.info("Test send* RPCs with verbose=False")
671+
txid_feeReason_three = self.nodes[2].sendtoaddress(address = address, amount = 5, verbose = False)
672+
assert_equal(self.nodes[2].gettransaction(txid_feeReason_three)['txid'], txid_feeReason_three)
673+
txid_feeReason_four = self.nodes[2].sendmany(dummy = '', amounts = {address: 5}, verbose = False)
674+
assert_equal(self.nodes[2].gettransaction(txid_feeReason_four)['txid'], txid_feeReason_four)
675+
664676
if __name__ == '__main__':
665677
WalletTest().main()

0 commit comments

Comments
 (0)