aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_fallbackfee.py
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2017-12-12 12:33:39 -1000
committerJonas Schnelli <dev@jonasschnelli.ch>2018-02-25 09:38:38 +0800
commit3f592b81dcca3d2ef11403a623a6ba5b017567d7 (patch)
tree374d6d45cfaa0b6c86853c79881aa0b2290ccbfd /test/functional/wallet_fallbackfee.py
parent8222e057fe60934a57b1d8226b0e1bd071f8dac2 (diff)
[QA] add wallet-rbf test
Diffstat (limited to 'test/functional/wallet_fallbackfee.py')
-rwxr-xr-xtest/functional/wallet_fallbackfee.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/functional/wallet_fallbackfee.py b/test/functional/wallet_fallbackfee.py
new file mode 100755
index 0000000000..e9cd052344
--- /dev/null
+++ b/test/functional/wallet_fallbackfee.py
@@ -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()