mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
[QA] add wallet-rbf test
This commit is contained in:
parent
8222e057fe
commit
3f592b81dc
@ -126,6 +126,7 @@ BASE_SCRIPTS= [
|
|||||||
'feature_cltv.py',
|
'feature_cltv.py',
|
||||||
'rpc_uptime.py',
|
'rpc_uptime.py',
|
||||||
'wallet_resendwallettransactions.py',
|
'wallet_resendwallettransactions.py',
|
||||||
|
'wallet_fallbackfee.py',
|
||||||
'feature_minchainwork.py',
|
'feature_minchainwork.py',
|
||||||
'p2p_fingerprint.py',
|
'p2p_fingerprint.py',
|
||||||
'feature_uacomment.py',
|
'feature_uacomment.py',
|
||||||
|
28
test/functional/wallet_fallbackfee.py
Executable file
28
test/functional/wallet_fallbackfee.py
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# Copyright (c) 2017 The Bitcoin Core developers
|
||||||
|
# Distributed under the MIT software license, see the accompanying
|
||||||
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
"""Test wallet replace-by-fee capabilities in conjunction with the fallbackfee."""
|
||||||
|
from test_framework.test_framework import BitcoinTestFramework
|
||||||
|
from test_framework.util import *
|
||||||
|
|
||||||
|
class WalletRBFTest(BitcoinTestFramework):
|
||||||
|
def set_test_params(self):
|
||||||
|
self.num_nodes = 1
|
||||||
|
self.setup_clean_chain = True
|
||||||
|
|
||||||
|
def run_test(self):
|
||||||
|
self.nodes[0].generate(101)
|
||||||
|
|
||||||
|
# sending a transaction without fee estimations must be possible by default on regtest
|
||||||
|
self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)
|
||||||
|
|
||||||
|
# test sending a tx with disabled fallback fee (must fail)
|
||||||
|
self.restart_node(0, extra_args=["-fallbackfee=0"])
|
||||||
|
assert_raises_rpc_error(-4, "Fee estimation failed", lambda: self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1))
|
||||||
|
assert_raises_rpc_error(-4, "Fee estimation failed", lambda: self.nodes[0].fundrawtransaction(self.nodes[0].createrawtransaction([], {self.nodes[0].getnewaddress(): 1})))
|
||||||
|
assert_raises_rpc_error(-4, "Fee estimation failed", lambda: self.nodes[0].sendfrom("", self.nodes[0].getnewaddress(), 1))
|
||||||
|
assert_raises_rpc_error(-6, "Fee estimation failed", lambda: self.nodes[0].sendmany("", {self.nodes[0].getnewaddress(): 1}))
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
WalletRBFTest().main()
|
Loading…
Reference in New Issue
Block a user