Browse Source

minor whitespace, variable renames

The MMGen Project 6 months ago
parent
commit
5ea4884c65
4 changed files with 16 additions and 10 deletions
  1. 7 1
      mmgen/amt.py
  2. 4 4
      mmgen/proto/rune/params.py
  3. 4 4
      mmgen/proto/rune/rpc/remote.py
  4. 1 1
      mmgen/util.py

+ 7 - 1
mmgen/amt.py

@@ -163,7 +163,13 @@ class CoinAmt(Decimal, Hilite, InitErrors): # abstract class
 
 def is_coin_amt(proto, num, *, from_unit=None, from_decimal=False):
 	assert proto.coin_amt, 'proto.coin_amt is None!  Did you call init_proto() with ‘need_amt’?'
-	return get_obj(proto.coin_amt, num=num, from_unit=from_unit, from_decimal=from_decimal, silent=True, return_bool=True)
+	return get_obj(
+		proto.coin_amt,
+		num          = num,
+		from_unit    = from_unit,
+		from_decimal = from_decimal,
+		silent       = True,
+		return_bool  = True)
 
 class BTCAmt(CoinAmt):
 	coin = 'BTC'

+ 4 - 4
mmgen/proto/rune/params.py

@@ -43,7 +43,7 @@ class mainnet(CoinProtocol.Secp256k1):
 	decode_wif = btc_mainnet.decode_wif
 
 	rpc_remote_params      = {'server_domain': Hostname('ninerealms.com')}
-	rpc_remote_http_params = {'host': Hostname('thornode.ninerealms.com')}
+	rpc_remote_rest_params = {'host': Hostname('thornode.ninerealms.com')}
 	rpc_remote_rpc_params  = {'host': Hostname('rpc.ninerealms.com')}
 
 	def decode_addr(self, addr):
@@ -63,15 +63,15 @@ class mainnet(CoinProtocol.Secp256k1):
 
 class testnet(mainnet): # testnet is stagenet
 	bech32_hrp = 'sthor'
-	rpc_remote_http_params = {'host': Hostname('stagenet-thornode.ninerealms.com')}
+	rpc_remote_rest_params = {'host': Hostname('stagenet-thornode.ninerealms.com')}
 	rpc_remote_rpc_params  = {'host': Hostname('stagenet-rpc.ninerealms.com')}
 
 class regtest(testnet): # regtest is deprecated testnet
 	bech32_hrp = 'tthor'
 	rpc_remote_params = {
 		'server_domain': Hostname('localhost')}
-	rpc_remote_http_params = {
+	rpc_remote_rest_params = {
 		'proto': 'http',
 		'host': Hostname('localhost:18800'),
 		'verify': False}
-	rpc_remote_rpc_params = rpc_remote_http_params
+	rpc_remote_rpc_params = rpc_remote_rest_params

+ 4 - 4
mmgen/proto/rune/rpc/remote.py

@@ -17,13 +17,13 @@ import json
 from ....http import HTTPClient
 from ....rpc.remote import RemoteRPCClient
 
-class ThornodeRemoteHTTPClient(HTTPClient):
+class ThornodeRemoteRESTClient(HTTPClient):
 
 	http_hdrs = {'Content-Type': 'application/json'}
 	timeout = 5
 
 	def __init__(self, cfg, *, proto=None, host=None):
-		for k, v in cfg._proto.rpc_remote_http_params.items():
+		for k, v in cfg._proto.rpc_remote_rest_params.items():
 			setattr(self, k, v)
 		super().__init__(cfg, proto=proto, host=host)
 
@@ -35,11 +35,11 @@ class THORChainRemoteRPCClient(RemoteRPCClient):
 			setattr(self, k, v)
 		super().__init__(cfg, proto)
 		self.caps = ('lbl_id',)
-		self.http = ThornodeRemoteHTTPClient(cfg)
+		self.rest_api = ThornodeRemoteRESTClient(cfg)
 
 	# throws exception on error
 	def get_balance(self, addr, *, block):
-		http_res = self.http.get(path=f'/bank/balances/{addr}')
+		http_res = self.rest_api.get(path=f'/bank/balances/{addr}')
 		data = json.loads(http_res)
 		if data['result'] is None:
 			from ....util import die

+ 1 - 1
mmgen/util.py

@@ -175,7 +175,7 @@ def Die(ev=0, s=''):
 
 def pp_fmt(d):
 	import pprint
-	return pprint.PrettyPrinter(indent=4, compact=False).pformat(d)
+	return pprint.PrettyPrinter().pformat(d)
 
 def pp_msg(d):
 	msg(pp_fmt(d))