Skip to content

Commit 3f592b8

Browse files
committed
[QA] add wallet-rbf test
1 parent 8222e05 commit 3f592b8

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

test/functional/test_runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
'feature_cltv.py',
127127
'rpc_uptime.py',
128128
'wallet_resendwallettransactions.py',
129+
'wallet_fallbackfee.py',
129130
'feature_minchainwork.py',
130131
'p2p_fingerprint.py',
131132
'feature_uacomment.py',

test/functional/wallet_fallbackfee.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env python3
2+
# Copyright (c) 2017 The Bitcoin Core developers
3+
# Distributed under the MIT software license, see the accompanying
4+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5+
"""Test wallet replace-by-fee capabilities in conjunction with the fallbackfee."""
6+
from test_framework.test_framework import BitcoinTestFramework
7+
from test_framework.util import *
8+
9+
class WalletRBFTest(BitcoinTestFramework):
10+
def set_test_params(self):
11+
self.num_nodes = 1
12+
self.setup_clean_chain = True
13+
14+
def run_test(self):
15+
self.nodes[0].generate(101)
16+
17+
# sending a transaction without fee estimations must be possible by default on regtest
18+
self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)
19+
20+
# test sending a tx with disabled fallback fee (must fail)
21+
self.restart_node(0, extra_args=["-fallbackfee=0"])
22+
assert_raises_rpc_error(-4, "Fee estimation failed", lambda: self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1))
23+
assert_raises_rpc_error(-4, "Fee estimation failed", lambda: self.nodes[0].fundrawtransaction(self.nodes[0].createrawtransaction([], {self.nodes[0].getnewaddress(): 1})))
24+
assert_raises_rpc_error(-4, "Fee estimation failed", lambda: self.nodes[0].sendfrom("", self.nodes[0].getnewaddress(), 1))
25+
assert_raises_rpc_error(-6, "Fee estimation failed", lambda: self.nodes[0].sendmany("", {self.nodes[0].getnewaddress(): 1}))
26+
27+
if __name__ == '__main__':
28+
WalletRBFTest().main()

0 commit comments

Comments
 (0)