diff --git a/lbrynet/extras/daemon/Daemon.py b/lbrynet/extras/daemon/Daemon.py index d5006f531..d6f72662f 100644 --- a/lbrynet/extras/daemon/Daemon.py +++ b/lbrynet/extras/daemon/Daemon.py @@ -310,7 +310,7 @@ class Daemon(metaclass=JSONRPCServerType): @classmethod def get_api_definitions(cls): prefix = 'jsonrpc_' - not_grouped = ['block_show', 'report_bug', 'routing_table_get'] + not_grouped = ['routing_table_get'] api = { 'groups': { group_name[:-len('_DOC')].lower(): getattr(cls, group_name).strip() @@ -2902,23 +2902,6 @@ class Daemon(metaclass=JSONRPCServerType): """ return self.get_account_or_default(account_id).release_all_outputs() - @requires(WALLET_COMPONENT) - def jsonrpc_block_show(self, blockhash=None, height=None): - """ - Get contents of a block - - Usage: - block_show ( | --blockhash=) | ( | --height=) - - Options: - --blockhash= : (str) hash of the block to look up - --height= : (int) height of the block to look up - - Returns: - (dict) Requested block - """ - return self.wallet_manager.get_block(blockhash, height) - BLOB_DOC = """ Blob management. """ diff --git a/lbrynet/wallet/manager.py b/lbrynet/wallet/manager.py index e6fd8cdd1..8a9f3c2e9 100644 --- a/lbrynet/wallet/manager.py +++ b/lbrynet/wallet/manager.py @@ -308,13 +308,6 @@ class LbryWalletManager(BaseWalletManager): for wallet in self.wallets: wallet.save() - def get_block(self, block_hash=None, height=None): - if height is None: - height = self.ledger.headers.height - if block_hash is None: - block_hash = self.ledger.headers.hash(height).decode() - return self.ledger.network.get_block(block_hash) - def get_claim_by_claim_id(self, claim_id): return self.ledger.get_claim_by_claim_id(claim_id) diff --git a/lbrynet/wallet/network.py b/lbrynet/wallet/network.py index abed21dd9..85aa46a60 100644 --- a/lbrynet/wallet/network.py +++ b/lbrynet/wallet/network.py @@ -3,9 +3,6 @@ from torba.client.basenetwork import BaseNetwork class Network(BaseNetwork): - def get_block(self, block_hash): - return self.rpc('blockchain.block.get_block', block_hash) - def get_server_height(self): return self.rpc('blockchain.block.get_server_height') diff --git a/scripts/generate_json_api.py b/scripts/generate_json_api.py index c6a2f1573..bbb7c03ea 100644 --- a/scripts/generate_json_api.py +++ b/scripts/generate_json_api.py @@ -82,10 +82,6 @@ class Examples(CommandTestCase): 'Get settings', 'settings', 'get' ) - await r( - 'Show contents of the first block.', - 'block_show', '--height=1' - ) # accounts diff --git a/tests/integration/test_claim_commands.py b/tests/integration/test_claim_commands.py index 97a3e86bd..d3136a38d 100644 --- a/tests/integration/test_claim_commands.py +++ b/tests/integration/test_claim_commands.py @@ -783,8 +783,7 @@ class StreamCommands(CommandTestCase): self.assertNotEqual(r1c, r2c) await self.generate(50) - head = await self.daemon.jsonrpc_block_show() - self.assertTrue(head['height'] > 250) + self.assertTrue(self.ledger.headers.height > 250) r3 = await self.daemon.jsonrpc_resolve(urls='lbry://ΣίσυφοςfiÆ') r4 = await self.daemon.jsonrpc_resolve(urls='lbry://ΣΊΣΥΦΟσFIæ')