From a71d91cecf02b8071d6c5318655aac7cf1075df5 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 29 Apr 2019 19:54:11 +0000 Subject: functional_tests: add test for mining via wallet --- utils/python-rpc/framework/wallet.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'utils') diff --git a/utils/python-rpc/framework/wallet.py b/utils/python-rpc/framework/wallet.py index cfffb32a8..713ddcca8 100644 --- a/utils/python-rpc/framework/wallet.py +++ b/utils/python-rpc/framework/wallet.py @@ -781,6 +781,29 @@ class Wallet(object): } return self.rpc.send_json_rpc_request(validate_address) + def start_mining(self, threads_count, do_background_mining = False, ignore_battery = False): + start_mining = { + 'method': 'start_mining', + 'jsonrpc': '2.0', + 'params': { + 'threads_count': threads_count, + 'do_background_mining': do_background_mining, + 'ignore_battery': ignore_battery, + }, + 'id': '0' + } + return self.rpc.send_json_rpc_request(start_mining) + + def stop_mining(self): + stop_mining = { + 'method': 'stop_mining', + 'jsonrpc': '2.0', + 'params': { + }, + 'id': '0' + } + return self.rpc.send_json_rpc_request(stop_mining) + def get_version(self): get_version = { 'method': 'get_version', -- cgit v1.2.3