From 6f80a46afa9f8500dcd25d8456069dc4036c7ea7 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 21 Nov 2021 01:25:42 +0000 Subject: [PATCH] Add python method --- utils/python-rpc/framework/daemon.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/utils/python-rpc/framework/daemon.py b/utils/python-rpc/framework/daemon.py index 3bfe01826..93e91e8c8 100644 --- a/utils/python-rpc/framework/daemon.py +++ b/utils/python-rpc/framework/daemon.py @@ -61,6 +61,20 @@ class Daemon(object): } return self.rpc.send_json_rpc_request(get_miner_data) + def calc_pow(self, major_version, height, block_blob, seed_hash = ''): + calc_pow = { + 'method': 'calc_pow', + 'params': { + 'major_version': major_version, + 'height': height, + 'block_blob' : block_blob, + 'seed_hash' : seed_hash, + }, + 'jsonrpc': '2.0', + 'id': '0' + } + return self.rpc.send_json_rpc_request(calc_pow) + def send_raw_transaction(self, tx_as_hex, do_not_relay = False, do_sanity_checks = True, client = ""): send_raw_transaction = { 'client': client,