From ddf789073046ca7a396c159550d5896aa7de709b Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 20 Apr 2019 15:46:48 +0000 Subject: [PATCH] python-rpc: add missing getblock RPC parameters --- tests/functional_tests/blockchain.py | 8 ++++---- utils/python-rpc/framework/daemon.py | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/functional_tests/blockchain.py b/tests/functional_tests/blockchain.py index 56164600d..ee84d84bc 100755 --- a/tests/functional_tests/blockchain.py +++ b/tests/functional_tests/blockchain.py @@ -66,7 +66,7 @@ class BlockchainTest(): # we should not see a block at height ok = False - try: daemon.getblock(height) + try: daemon.getblock(height = height) except: ok = True assert ok @@ -84,7 +84,7 @@ class BlockchainTest(): # get the blocks, check they have the right height res_getblock = [] for n in range(blocks): - res_getblock.append(daemon.getblock(height + n)) + res_getblock.append(daemon.getblock(height = height + n)) block_header = res_getblock[n].block_header assert abs(block_header.timestamp - time.time()) < 10 # within 10 seconds assert block_header.height == height + n @@ -103,7 +103,7 @@ class BlockchainTest(): # we should not see a block after that ok = False - try: daemon.getblock(height + blocks) + try: daemon.getblock(height = height + blocks) except: ok = True assert ok @@ -149,7 +149,7 @@ class BlockchainTest(): # we should not see the popped block anymore ok = False - try: daemon.getblock(height + blocks - 1) + try: daemon.getblock(height = height + blocks - 1) except: ok = True assert ok diff --git a/utils/python-rpc/framework/daemon.py b/utils/python-rpc/framework/daemon.py index 04fc5b5cf..18ce37221 100644 --- a/utils/python-rpc/framework/daemon.py +++ b/utils/python-rpc/framework/daemon.py @@ -67,11 +67,13 @@ class Daemon(object): } return self.rpc.send_json_rpc_request(submitblock) - def getblock(self, height=0): + def getblock(self, hash = '', height = 0, fill_pow_hash = False): getblock = { 'method': 'getblock', 'params': { - 'height': height + 'hash': hash, + 'height': height, + 'fill_pow_hash': fill_pow_hash, }, 'jsonrpc': '2.0', 'id': '0'