From 74c617f4636244417b1a9d116e2bd468c4e587a6 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Thu, 29 Jul 2021 14:20:43 +0000 Subject: [PATCH] Remove unused and deprecated Parity methods --- mmgen/altcoins/eth/contract.py | 3 +-- mmgen/altcoins/eth/tx.py | 3 +-- mmgen/rpc.py | 11 ----------- test/unit_tests_d/ut_rpc.py | 2 +- 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/mmgen/altcoins/eth/contract.py b/mmgen/altcoins/eth/contract.py index ba1d0e7c..6e24d79d 100755 --- a/mmgen/altcoins/eth/contract.py +++ b/mmgen/altcoins/eth/contract.py @@ -114,8 +114,7 @@ class TokenBase(MMGenObject): # ERC20 from .pyethereum.transactions import Transaction if chain_id is None: - chain_id_method = ('parity_chainId','eth_chainId')['eth_chainId' in self.rpc.caps] - chain_id = int(await self.rpc.call(chain_id_method),16) + chain_id = int(await self.rpc.call('eth_chainId'),16) tx = Transaction(**tx_in).sign(key,chain_id) hex_tx = rlp.encode(tx).hex() coin_txid = CoinTxID(tx.hash.hex()) diff --git a/mmgen/altcoins/eth/tx.py b/mmgen/altcoins/eth/tx.py index 96c76ae8..234d5527 100755 --- a/mmgen/altcoins/eth/tx.py +++ b/mmgen/altcoins/eth/tx.py @@ -88,7 +88,6 @@ class EthereumMMGenTX: return ETHNonce(int(await self.rpc.call('parity_nextNonce','0x'+self.inputs[0].addr),16)) async def make_txobj(self): # called by create_raw() - chain_id_method = ('parity_chainId','eth_chainId')['eth_chainId' in self.rpc.caps] self.txobj = { 'from': self.inputs[0].addr, 'to': self.outputs[0].addr if self.outputs else Str(''), @@ -96,7 +95,7 @@ class EthereumMMGenTX: 'gasPrice': self.fee_abs2rel(self.usr_fee,to_unit='eth'), 'startGas': self.start_gas, 'nonce': await self.get_nonce(), - 'chainId': Int(await self.rpc.call(chain_id_method),16), + 'chainId': Int(await self.rpc.call('eth_chainId'),16), 'data': self.usr_contract_data, } diff --git a/mmgen/rpc.py b/mmgen/rpc.py index 1c477667..48aa4682 100755 --- a/mmgen/rpc.py +++ b/mmgen/rpc.py @@ -643,21 +643,10 @@ class EthereumRPCClient(RPCClient,metaclass=aInitMeta): 'net_version', 'parity_chain', 'parity_chainId', # superseded by eth_chainId - 'parity_chainStatus', - 'parity_composeTransaction', - 'parity_gasCeilTarget', - 'parity_gasFloorTarget', 'parity_getBlockHeaderByNumber', - 'parity_localTransactions', - 'parity_minGasPrice', - 'parity_mode', - 'parity_netPeers', 'parity_nextNonce', 'parity_nodeKind', - 'parity_nodeName', 'parity_pendingTransactions', - 'parity_pendingTransactionsStats', - 'parity_versionInfo', ) class MoneroRPCClient(RPCClient): diff --git a/test/unit_tests_d/ut_rpc.py b/test/unit_tests_d/ut_rpc.py index 6bca1f2f..88f158d7 100755 --- a/test/unit_tests_d/ut_rpc.py +++ b/test/unit_tests_d/ut_rpc.py @@ -58,7 +58,7 @@ class init_test: async def eth(proto,backend): rpc = await rpc_init(proto,backend) do_msg(rpc) - await rpc.call('parity_versionInfo',timeout=300) + await rpc.call('eth_blockNumber',timeout=300) def run_test(coin,auth): proto = init_proto(coin,network=('mainnet','regtest')[coin=='eth']) # FIXME CoinDaemon's network handling broken