Browse Source

Support OpenEthereum v3.3.0

The MMGen Project 3 years ago
parent
commit
be3823e2e0
2 changed files with 7 additions and 9 deletions
  1. 2 2
      mmgen/daemon.py
  2. 5 7
      mmgen/rpc.py

+ 2 - 2
mmgen/daemon.py

@@ -388,7 +388,7 @@ class CoinDaemon(Daemon):
 			'openethereum',
 			'Ethereum',
 			'Ethereum',
-			'OpenEthereum', 3000001, '3.0.1',
+			'OpenEthereum', 3003000, '3.3.0',
 			'openethereum',
 			'openethereum',
 			'parity.conf',
@@ -398,7 +398,7 @@ class CoinDaemon(Daemon):
 			'openethereum',
 			'Ethereum Classic',
 			'Ethereum',
-			'OpenEthereum', 3000001, '3.0.1',
+			'OpenEthereum', 3003000, '3.3.0',
 			'openethereum',
 			'openethereum',
 			'parity.conf',

+ 5 - 7
mmgen/rpc.py

@@ -601,18 +601,16 @@ class EthereumRPCClient(RPCClient,metaclass=aInitMeta):
 		self.blockcount = int(await self.call('eth_blockNumber'),16)
 
 		vi,bh,ch,nk = await self.gathered_call(None, (
-				('parity_versionInfo',()),
+				('web3_clientVersion',()),
 				('parity_getBlockHeaderByNumber',()),
 				('parity_chain',()),
 				('parity_nodeKind',()),
 			))
 
-		self.daemon_version = int((
-				lambda v: '{:d}{:03d}{:03d}'.format(v['major'],v['minor'],v['patch'])
-			)(vi['version']))
-		self.daemon_version_str = (
-				lambda v: '{}.{}.{}'.format(v['major'],v['minor'],v['patch'])
-			)(vi['version'])
+		import re
+		vip = re.match(r'OpenEthereum//v(\d+)\.(\d+)\.(\d+)',vi,re.ASCII)
+		self.daemon_version = int('{:d}{:03d}{:03d}'.format(*[int(e) for e in vip.groups()]))
+		self.daemon_version_str = '{}.{}.{}'.format(*vip.groups())
 		self.cur_date = int(bh['timestamp'],16)
 		self.chain = ch.replace(' ','_')
 		self.caps = ('full_node',) if nk['capability'] == 'full' else ()