diff --git a/resources/maintainer_scripts/node_util.py b/resources/maintainer_scripts/node_util.py index 08b0488..83f7b27 100755 --- a/resources/maintainer_scripts/node_util.py +++ b/resources/maintainer_scripts/node_util.py @@ -74,8 +74,8 @@ def _rpc_call(method: str, server: str, params: list, port: int = 7777, timeout: req = request.Request(url, method="POST") req.add_header('content-type', "application/json") req.add_header('cache-control', "no-cache") - payload = json.dumps({"jsonrpc": "2.0", "method": method, "params": params, "id": 1}).encode() - r = request.urlopen(req, data=payload, timeout=timeout) + payload = json.dumps({"jsonrpc": "2.0", "method": method, "params": params, "id": 1}).encode('utf-8') + r = request.urlopen(req, payload, timeout=timeout) json_data = json.loads(r.read()) return json_data["result"] @@ -86,7 +86,7 @@ def _rpc_get_block(server: str, block_height=None, port: int = 7777, timeout: in """ params = [] if block_height: - params = [{"Height": block_height}] + params = [{"Height": int(block_height)}] return NodeUtil._rpc_call("chain_get_block", server, params, port) @staticmethod