dash/test/functional/rpc_coinjoin.py
Wladimir J. van der Laan 71b4cf307b Merge #14180: qa: Run all tests even if wallet is not compiled
fac95398366f644911b58f1605e6bc37fb76782d qa: Run all tests even if wallet is not compiled (MarcoFalke)
faa669cbcd1fc799517b523b0f850e01b11bf40a qa: Premine to deterministic address with -disablewallet (MarcoFalke)

Pull request description:

  Currently the test_runner would exit if the wallet was not compiled into the Bitcoin Core executable. However, a lot of the tests run without the wallet just fine and there is no need to globally require the wallet to run the tests.

Tree-SHA512: 63177260aa29126fd20f0be217a82b10b62288ab846f96f1cbcc3bd2c52702437703475d91eae3f8d821a3149fc62b725a4c5b2a7b3657b67ffcbc81532a03bb
2021-09-21 17:24:56 -04:00

64 lines
1.9 KiB
Python
Executable File

#!/usr/bin/env python3
# Copyright (c) 2019-2021 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal
'''
rpc_coinjoin.py
Tests CoinJoin basic RPC
'''
class CoinJoinTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
def run_test(self):
self.test_coinjoin_start_stop()
self.test_coinjoin_setamount()
self.test_coinjoin_setrounds()
def test_coinjoin_start_stop(self):
# Start Mixing
self.nodes[0].coinjoin("start")
# Get CoinJoin info
cj_info = self.nodes[0].getcoinjoininfo()
# Ensure that it started properly
assert_equal(cj_info['enabled'], True)
assert_equal(cj_info['running'], True)
# Stop mixing
self.nodes[0].coinjoin("stop")
# Get CoinJoin info
cj_info = self.nodes[0].getcoinjoininfo()
# Ensure that it stopped properly
assert_equal(cj_info['enabled'], True)
assert_equal(cj_info['running'], False)
def test_coinjoin_setamount(self):
# Try normal values
self.nodes[0].setcoinjoinamount(50)
cj_info = self.nodes[0].getcoinjoininfo()
assert_equal(cj_info['max_amount'], 50)
# Try large values
self.nodes[0].setcoinjoinamount(1200000)
cj_info = self.nodes[0].getcoinjoininfo()
assert_equal(cj_info['max_amount'], 1200000)
def test_coinjoin_setrounds(self):
# Try normal values
self.nodes[0].setcoinjoinrounds(5)
cj_info = self.nodes[0].getcoinjoininfo()
assert_equal(cj_info['max_rounds'], 5)
if __name__ == '__main__':
CoinJoinTest().main()