Browse Source

obj.py,rpc.py: minor changes

MMGen 6 years ago
parent
commit
3793852920
2 changed files with 14 additions and 3 deletions
  1. 3 2
      mmgen/obj.py
  2. 11 1
      mmgen/rpc.py

+ 3 - 2
mmgen/obj.py

@@ -147,7 +147,8 @@ class Hilite(object):
 		add_len = len(a) + len(b) + len(append_chars)
 		if width == None: width = cls.width
 		if trunc_ok == None: trunc_ok = cls.trunc_ok
-		assert width >= 2 + add_len,'Width must be at least 2' # 2 because CJK
+		assert width >= 2 + add_len,( # 2 because CJK
+			"'{!r}': invalid width ({}) (width must be at least 2)".format(s,width))
 		if len(s) + s_wide_count + add_len > width:
 			assert trunc_ok, "If 'trunc_ok' is false, 'width' must be >= screen width of string"
 			s = truncate_str(s,width-add_len)
@@ -303,7 +304,7 @@ class BTCAmt(Decimal,Hilite,InitErrors):
 	color = 'yellow'
 	max_prec = 8
 	max_amt = 21000000
-	min_coin_unit = Decimal('0.00000001')
+	min_coin_unit = Decimal('0.00000001') # satoshi
 
 	def __new__(cls,num,on_fail='die'):
 		if type(num) == cls: return num

+ 11 - 1
mmgen/rpc.py

@@ -208,6 +208,7 @@ class EthereumRPCConnection(CoinDaemonRPCConnection):
 		'eth_blockNumber',
 		'eth_gasPrice',
 		'eth_getBalance',
+		'eth_getBlock',
 		'eth_getBlockByHash',
 		'eth_getBlockByNumber',
 		'eth_getTransactionByHash',
@@ -215,12 +216,21 @@ class EthereumRPCConnection(CoinDaemonRPCConnection):
 		'eth_sendRawTransaction',
 		'eth_signTransaction',
 		'eth_syncing',
-		'parity_accountsInfo',
+		'net_listening',
+		'net_peerCount',
+		'net_version',
+		'parity_chain',
 		'parity_chainStatus',
 		'parity_gasCeilTarget',
 		'parity_gasFloorTarget',
+		'parity_localTransactions',
 		'parity_minGasPrice',
+		'parity_mode',
 		'parity_netPeers',
+		'parity_nodeKind',
+		'parity_nodeName',
+		'parity_pendingTransactions',
+		'parity_pendingTransactionsStats',
 		'parity_versionInfo',
 	)