diff --git a/tests/core/json-rpc/test_ipc.py b/tests/core/json-rpc/test_ipc.py index d3a09b8f44..438d67c795 100644 --- a/tests/core/json-rpc/test_ipc.py +++ b/tests/core/json-rpc/test_ipc.py @@ -175,6 +175,14 @@ async def mock_event_bus_interaction(bus): build_request('eth_mining'), {'result': False, 'id': 3, 'jsonrpc': '2.0'}, ), + ( + build_request('eth_coinbase'), + {'result': '0x0000000000000000000000000000000000000000', 'id': 3, 'jsonrpc': '2.0'}, + ), + ( + build_request('eth_hashrate'), + {'result': '0x0', 'id': 3, 'jsonrpc': '2.0'}, + ), ( build_request('web3_clientVersion'), {'result': construct_trinity_client_identifier(), 'id': 3, 'jsonrpc': '2.0'}, diff --git a/trinity/rpc/modules/eth.py b/trinity/rpc/modules/eth.py index e0081ad9c9..2bd21af810 100644 --- a/trinity/rpc/modules/eth.py +++ b/trinity/rpc/modules/eth.py @@ -156,8 +156,10 @@ async def call(self, txn_dict: Dict[str, Any], at_block: Union[str, int]) -> str result = self._chain.get_transaction_result(transaction, header) return encode_hex(result) - async def coinbase(self) -> Hash32: - raise NotImplementedError() + async def coinbase(self) -> str: + # Trinity doesn't support mining yet and hence coinbase_address is default (ZERO_ADDRESS) + coinbase_address = ZERO_ADDRESS + return encode_hex(coinbase_address) @format_params(identity, to_int_if_hex) async def estimateGas(self, txn_dict: Dict[str, Any], at_block: Union[str, int]) -> str: @@ -263,7 +265,9 @@ async def getUncleByBlockNumberAndIndex(self, return header_to_dict(uncle) async def hashrate(self) -> str: - raise NotImplementedError() + # Trinity doesn't support mining yet and hence hashrate is default (0) + hashrate = 0 + return hex(hashrate) async def mining(self) -> bool: return False