diff --git a/mmgen/addr.py b/mmgen/addr.py index e140f211..03fa2734 100755 --- a/mmgen/addr.py +++ b/mmgen/addr.py @@ -1050,12 +1050,12 @@ def coinaddr2mmaddr(self,coinaddr): @classmethod def get_tw_data(cls,wallet=None): vmsg('Getting address data from tracking wallet') - if 'label_api' in g.rpch.caps: - accts = g.rpch.listlabels() - alists = [list(a.keys()) for a in g.rpch.getaddressesbylabel([[k] for k in accts],batch=True)] + if 'label_api' in g.rpc.caps: + accts = g.rpc.listlabels() + alists = [list(a.keys()) for a in g.rpc.getaddressesbylabel([[k] for k in accts],batch=True)] else: - accts = g.rpch.listaccounts(0,True) - alists = g.rpch.getaddressesbyaccount([[k] for k in accts],batch=True) + accts = g.rpc.listaccounts(0,True) + alists = g.rpc.getaddressesbyaccount([[k] for k in accts],batch=True) return list(zip(accts,alists)) def add_tw_data(self,wallet): diff --git a/mmgen/altcoins/eth/contract.py b/mmgen/altcoins/eth/contract.py index 84752d16..1f89e235 100755 --- a/mmgen/altcoins/eth/contract.py +++ b/mmgen/altcoins/eth/contract.py @@ -66,7 +66,7 @@ def do_call(self,method_sig,method_args='',toUnit=False): data = create_method_id(method_sig) + method_args if g.debug: msg('ETH_CALL {}: {}'.format(method_sig,'\n '.join(parse_abi(data)))) - ret = g.rpch.eth_call({ 'to': '0x'+self.addr, 'data': '0x'+data }) + ret = g.rpc.eth_call({ 'to': '0x'+self.addr, 'data': '0x'+data }) if toUnit: return int(ret,16) * self.base_unit else: @@ -108,7 +108,7 @@ def info(self): 'total supply:', self.total_supply()) def code(self): - return g.rpch.eth_getCode('0x'+self.addr)[2:] + return g.rpc.eth_getCode('0x'+self.addr)[2:] def create_data(self,to_addr,amt,method_sig='transfer(address,uint256)',from_addr=None): from_arg = from_addr.rjust(64,'0') if from_addr else '' @@ -131,8 +131,8 @@ def txsign(self,tx_in,key,from_addr,chain_id=None): from .pyethereum.transactions import Transaction if chain_id is None: - chain_id_method = ('parity_chainId','eth_chainId')['eth_chainId' in g.rpch.caps] - chain_id = int(g.rpch.request(chain_id_method),16) + chain_id_method = ('parity_chainId','eth_chainId')['eth_chainId' in g.rpc.caps] + chain_id = int(g.rpc.request(chain_id_method),16) tx = Transaction(**tx_in).sign(key,chain_id) hex_tx = rlp.encode(tx).hex() coin_txid = CoinTxID(tx.hash.hex()) @@ -148,7 +148,7 @@ def txsign(self,tx_in,key,from_addr,chain_id=None): # The following are used for token deployment only: def txsend(self,hex_tx): - return g.rpch.eth_sendRawTransaction('0x'+hex_tx).replace('0x','',1) + return g.rpc.eth_sendRawTransaction('0x'+hex_tx).replace('0x','',1) def transfer( self,from_addr,to_addr,amt,key,start_gas,gasPrice, method_sig='transfer(address,uint256)', @@ -157,7 +157,7 @@ def transfer( self,from_addr,to_addr,amt,key,start_gas,gasPrice, tx_in = self.make_tx_in( from_addr,to_addr,amt, start_gas,gasPrice, - nonce = int(g.rpch.parity_nextNonce('0x'+from_addr),16), + nonce = int(g.rpc.parity_nextNonce('0x'+from_addr),16), method_sig = method_sig, from_addr2 = from_addr2 ) (hex_tx,coin_txid) = self.txsign(tx_in,key,from_addr) diff --git a/mmgen/altcoins/eth/tw.py b/mmgen/altcoins/eth/tw.py index 593e08a1..3bc2c1aa 100755 --- a/mmgen/altcoins/eth/tw.py +++ b/mmgen/altcoins/eth/tw.py @@ -88,7 +88,7 @@ def add_token_params_fields(): def rpc_init(self): pass def rpc_get_balance(self,addr): - return ETHAmt(int(g.rpch.eth_getBalance('0x'+addr),16),'wei') + return ETHAmt(int(g.rpc.eth_getBalance('0x'+addr),16),'wei') @write_mode def import_address(self,addr,label,foo): diff --git a/mmgen/altcoins/eth/tx.py b/mmgen/altcoins/eth/tx.py index 0b7b4a4b..480e0b90 100755 --- a/mmgen/altcoins/eth/tx.py +++ b/mmgen/altcoins/eth/tx.py @@ -60,7 +60,7 @@ def __init__(self,*args,**kwargs): @classmethod def get_exec_status(cls,txid,silent=False): - d = g.rpch.eth_getTransactionReceipt('0x'+txid) + d = g.rpc.eth_getTransactionReceipt('0x'+txid) if not silent: if 'contractAddress' in d and d['contractAddress']: msg('Contract address: {}'.format(d['contractAddress'].replace('0x',''))) @@ -121,10 +121,10 @@ def check_txfile_hex_data(self): return d # 'token_addr','decimals' required by Token subclass def get_nonce(self): - return ETHNonce(int(g.rpch.parity_nextNonce('0x'+self.inputs[0].addr),16)) + return ETHNonce(int(g.rpc.parity_nextNonce('0x'+self.inputs[0].addr),16)) def make_txobj(self): # called by create_raw() - chain_id_method = ('parity_chainId','eth_chainId')['eth_chainId' in g.rpch.caps] + chain_id_method = ('parity_chainId','eth_chainId')['eth_chainId' in g.rpc.caps] self.txobj = { 'from': self.inputs[0].addr, 'to': self.outputs[0].addr if self.outputs else Str(''), @@ -132,7 +132,7 @@ def make_txobj(self): # called by create_raw() 'gasPrice': self.usr_rel_fee or self.fee_abs2rel(self.fee,to_unit='eth'), 'startGas': self.start_gas, 'nonce': self.get_nonce(), - 'chainId': Int(g.rpch.request(chain_id_method),16), + 'chainId': Int(g.rpc.request(chain_id_method),16), 'data': self.usr_contract_data, } @@ -157,7 +157,7 @@ def update_txid(self): self.txid = MMGenTxID(make_chksum_6(self.hex).upper()) def get_blockcount(self): - return Int(g.rpch.eth_blockNumber(),16) + return Int(g.rpc.eth_blockNumber(),16) def process_cmd_args(self,cmd_args,ad_f,ad_w): lc = len(cmd_args) @@ -195,7 +195,7 @@ def fee_abs2rel(self,abs_fee,to_unit='Gwei'): # get rel_fee (gas price) from network, return in native wei def get_rel_fee_from_network(self): - return Int(g.rpch.eth_gasPrice(),16),'eth_gasPrice' # ==> rel_fee,fe_type + return Int(g.rpc.eth_gasPrice(),16),'eth_gasPrice' # ==> rel_fee,fe_type # given rel fee and units, return absolute fee using tx_gas def convert_fee_spec(self,foo,units,amt,unit): @@ -327,14 +327,14 @@ def get_status(self,status=False): class r(object): pass def is_in_mempool(): - if not 'full_node' in g.rpch.caps: + if not 'full_node' in g.rpc.caps: return False - return '0x'+self.coin_txid in [x['hash'] for x in g.rpch.parity_pendingTransactions()] + return '0x'+self.coin_txid in [x['hash'] for x in g.rpc.parity_pendingTransactions()] def is_in_wallet(): - d = g.rpch.eth_getTransactionReceipt('0x'+self.coin_txid) + d = g.rpc.eth_getTransactionReceipt('0x'+self.coin_txid) if d and 'blockNumber' in d and d['blockNumber'] is not None: - r.confs = 1 + int(g.rpch.eth_blockNumber(),16) - int(d['blockNumber'],16) + r.confs = 1 + int(g.rpc.eth_blockNumber(),16) - int(d['blockNumber'],16) r.exec_status = int(d['status'],16) return True return False @@ -372,7 +372,7 @@ def send(self,prompt_user=True,exit_on_fail=False): if prompt_user: self.confirm_send() - ret = None if g.bogus_send else g.rpch.eth_sendRawTransaction('0x'+self.hex,on_fail='return') + ret = None if g.bogus_send else g.rpc.eth_sendRawTransaction('0x'+self.hex,on_fail='return') from mmgen.rpc import rpc_error,rpc_errmsg if rpc_error(ret): diff --git a/mmgen/globalvars.py b/mmgen/globalvars.py index 65948e8a..8fea2d35 100755 --- a/mmgen/globalvars.py +++ b/mmgen/globalvars.py @@ -107,7 +107,7 @@ def die(ev=0,s=''): monero_wallet_rpc_user = 'monero' monero_wallet_rpc_password = '' rpc_fail_on_command = '' - rpch = None # global RPC handle + rpc = None # global RPC handle use_cached_balances = False # regtest: diff --git a/mmgen/main_split.py b/mmgen/main_split.py index d405b7dd..8058f61d 100755 --- a/mmgen/main_split.py +++ b/mmgen/main_split.py @@ -121,7 +121,7 @@ opt.no_blank = True gmsg("Creating timelocked transaction for long chain ({})".format(g.coin)) -locktime = int(opt.locktime or 0) or g.rpch.getblockcount() +locktime = int(opt.locktime or 0) or g.rpc.getblockcount() tx1.create(mmids[0],locktime) tx1.format() diff --git a/mmgen/rpc.py b/mmgen/rpc.py index eb44bb71..cbc7c6f4 100755 --- a/mmgen/rpc.py +++ b/mmgen/rpc.py @@ -435,7 +435,7 @@ def resolve_token_arg(token_arg): conn.caps += ('full_node',) if g.token: - g.rpch = conn # set g.rpch so rpc_init() will return immediately + g.rpc = conn # set g.rpc so rpc_init() will return immediately (g.token,g.dcoin) = resolve_token_arg(g.token) return conn diff --git a/mmgen/tw.py b/mmgen/tw.py index 7bd88938..7b11bb39 100755 --- a/mmgen/tw.py +++ b/mmgen/tw.py @@ -35,7 +35,7 @@ def get_tw_label(s): except: return None _date_formatter = { - 'days': lambda secs: (g.rpch.cur_date - secs) // 86400, + 'days': lambda secs: (g.rpc.cur_date - secs) // 86400, 'date': lambda secs: '{}-{:02}-{:02}'.format(*time.gmtime(secs)[:3])[2:], 'date_time': lambda secs: '{}-{:02}-{:02} {:02}:{:02}'.format(*time.gmtime(secs)[:5]), } @@ -43,7 +43,7 @@ def get_tw_label(s): def _set_dates(us): if us and us[0].date is None: # 'blocktime' differs from 'time', is same as getblockheader['time'] - dates = [o['blocktime'] for o in g.rpch.calls('gettransaction',[(o.txid,) for o in us])] + dates = [o['blocktime'] for o in g.rpc.calls('gettransaction',[(o.txid,) for o in us])] for o,date in zip(us,dates): o.date = date @@ -149,7 +149,7 @@ def get_unspent_rpc(self): # for now, self.addrs is just an empty list for Bitcoin and friends add_args = (9999999,self.addrs) if self.addrs else () - return g.rpch.listunspent(self.minconf,*add_args) + return g.rpc.listunspent(self.minconf,*add_args) def get_unspent_data(self): if g.bogus_wallet_data: # for debugging purposes only @@ -159,7 +159,7 @@ def get_unspent_data(self): if not us_rpc: die(0,self.wmsg['no_spendable_outputs']) tr_rpc = [] - lbl_id = ('account','label')['label_api' in g.rpch.caps] + lbl_id = ('account','label')['label_api' in g.rpc.caps] for o in us_rpc: if not lbl_id in o: continue # coinbase outputs have no account field @@ -325,7 +325,7 @@ def format_for_printing(self,color=False,show_confs=True): A=i.amt.fmt(color=color), A2=(i.amt2.fmt(color=color) if i.amt2 is not None else ''), c=i.confs, - b=g.rpch.blockcount - (i.confs - 1), + b=g.rpc.blockcount - (i.confs - 1), D=self.age_disp(i,'date_time'), l=i.label.hl(color=color) if i.label else TwComment.fmtc('',color=color,nullrepl='-',width=max_lbl_len)).rstrip()) @@ -333,8 +333,8 @@ def format_for_printing(self,color=False,show_confs=True): fs = '{} (block #{}, {} UTC)\nSort order: {}\n{}\n\nTotal {}: {}\n' self.fmt_print = fs.format( capfirst(self.desc), - g.rpch.blockcount, - make_timestr(g.rpch.cur_date), + g.rpc.blockcount, + make_timestr(g.rpc.cur_date), ' '.join(self.sort_info(include_group=False)), '\n'.join(out), g.dcoin, @@ -454,7 +454,7 @@ def age_disp(self,o,age_fmt): if age_fmt == 'confs': return o.confs elif age_fmt == 'block': - return g.rpch.blockcount - (o.confs - 1) + return g.rpc.blockcount - (o.confs - 1) else: return _date_formatter[age_fmt](o.date) @@ -492,8 +492,8 @@ def check_addr_array_lens(acct_pairs): self.total = g.proto.coin_amt('0') rpc_init() - lbl_id = ('account','label')['label_api' in g.rpch.caps] - for d in g.rpch.listunspent(0): + lbl_id = ('account','label')['label_api' in g.rpc.caps] + for d in g.rpc.listunspent(0): if not lbl_id in d: continue # skip coinbase outputs with missing account if d['confirmations'] < minconf: continue label = get_tw_label(d[lbl_id]) @@ -519,12 +519,12 @@ def check_addr_array_lens(acct_pairs): if showempty or all_labels: # for compatibility with old mmids, must use raw RPC rather than native data for matching # args: minconf,watchonly, MUST use keys() so we get list, not dict - if 'label_api' in g.rpch.caps: - acct_list = g.rpch.listlabels() - acct_addrs = [list(a.keys()) for a in g.rpch.getaddressesbylabel([[k] for k in acct_list],batch=True)] + if 'label_api' in g.rpc.caps: + acct_list = g.rpc.listlabels() + acct_addrs = [list(a.keys()) for a in g.rpc.getaddressesbylabel([[k] for k in acct_list],batch=True)] else: - acct_list = list(g.rpch.listaccounts(0,True).keys()) # raw list, no 'L' - acct_addrs = g.rpch.getaddressesbyaccount([[a] for a in acct_list],batch=True) # use raw list here + acct_list = list(g.rpc.listaccounts(0,True).keys()) # raw list, no 'L' + acct_addrs = g.rpc.getaddressesbyaccount([[a] for a in acct_list],batch=True) # use raw list here acct_labels = MMGenList([get_tw_label(a) for a in acct_list]) check_dup_mmid(acct_labels) assert len(acct_list) == len(acct_addrs),( @@ -753,11 +753,11 @@ def mmid_ordered_dict(self): @write_mode def import_address(self,addr,label,rescan): - return g.rpch.importaddress(addr,label,rescan,timeout=(False,3600)[rescan]) + return g.rpc.importaddress(addr,label,rescan,timeout=(False,3600)[rescan]) @write_mode def batch_import_address(self,arg_list): - return g.rpch.importaddress(arg_list,batch=True) + return g.rpc.importaddress(arg_list,batch=True) def force_write(self): mode_save = self.mode @@ -796,13 +796,13 @@ def is_in_wallet(self,addr): def set_label(self,coinaddr,lbl): # bitcoin-abc 'setlabel' RPC is broken, so use old 'importaddress' method to set label # broken behavior: new label is set OK, but old label gets attached to another address - if 'label_api' in g.rpch.caps and g.coin != 'BCH': - return g.rpch.setlabel(coinaddr,lbl,on_fail='return') + if 'label_api' in g.rpc.caps and g.coin != 'BCH': + return g.rpc.setlabel(coinaddr,lbl,on_fail='return') else: # NOTE: this works because importaddress() removes the old account before # associating the new account with the address. # RPC args: addr,label,rescan[=true],p2sh[=none] - return g.rpch.importaddress(coinaddr,lbl,False,on_fail='return') + return g.rpc.importaddress(coinaddr,lbl,False,on_fail='return') # returns on failure @write_mode @@ -885,8 +885,8 @@ def __init__(self,minconf,quiet): def create_data(self): # 0: unconfirmed, 1: below minconf, 2: confirmed, 3: spendable (privkey in wallet) - lbl_id = ('account','label')['label_api' in g.rpch.caps] - for d in g.rpch.listunspent(0): + lbl_id = ('account','label')['label_api' in g.rpc.caps] + for d in g.rpc.listunspent(0): lbl = get_tw_label(d[lbl_id]) if lbl: if lbl.mmid.type == 'mmgen': diff --git a/mmgen/tx.py b/mmgen/tx.py index 3ab0c230..3e881a44 100755 --- a/mmgen/tx.py +++ b/mmgen/tx.py @@ -83,7 +83,7 @@ def mmaddr2coinaddr(mmaddr,ad_w,ad_f): def segwit_is_active(exit_on_error=False): rpc_init() - d = g.rpch.getblockchaininfo() + d = g.rpc.getblockchaininfo() if d['chain'] == 'regtest': return True if ( 'bip9_softforks' in d @@ -405,7 +405,7 @@ def create_raw(self): if self.inputs[0].sequence: i[0]['sequence'] = self.inputs[0].sequence o = {e.addr:e.amt for e in self.outputs} - self.hex = HexStr(g.rpch.createrawtransaction(i,o)) + self.hex = HexStr(g.rpc.createrawtransaction(i,o)) self.update_txid() def print_contract_addr(self): pass @@ -438,7 +438,7 @@ def has_segwit_inputs(self): def compare_size_and_estimated_size(self): est_vsize = self.estimate_size() - d = g.rpch.decoderawtransaction(self.hex) + d = g.rpc.decoderawtransaction(self.hex) vsize = d['vsize'] if 'vsize' in d else d['size'] vmsg('\nVsize: {} (true) {} (estimated)'.format(vsize,est_vsize)) m1 = 'Estimated transaction vsize is {:1.2f} times the true vsize\n' @@ -523,7 +523,7 @@ def get_witness_size(): # coin-specific fee routines def get_relay_fee(self): - kb_fee = g.proto.coin_amt(g.rpch.getnetworkinfo()['relayfee']) + kb_fee = g.proto.coin_amt(g.rpc.getnetworkinfo()['relayfee']) ret = kb_fee * self.estimate_size() // 1024 vmsg('Relay fee: {} {c}/kB, for transaction: {} {c}'.format(kb_fee,ret,c=g.coin)) return ret @@ -535,7 +535,7 @@ def fee_abs2rel(self,abs_fee,to_unit=None): def get_rel_fee_from_network(self): try: - ret = g.rpch.estimatesmartfee(opt.tx_confs,opt.fee_estimate_mode.upper()) + ret = g.rpc.estimatesmartfee(opt.tx_confs,opt.fee_estimate_mode.upper()) fee_per_kb = ret['feerate'] if 'feerate' in ret else -2 fe_type = 'estimatesmartfee' except: @@ -678,7 +678,7 @@ def set_hex_locktime(self,val): self.hex = self.hex[:-8] + bytes.fromhex('{:08x}'.format(val))[::-1].hex() def get_blockcount(self): - return int(g.rpch.getblockcount()) + return int(g.rpc.getblockcount()) def add_blockcount(self): self.blockcount = self.get_blockcount() @@ -754,9 +754,9 @@ def sign(self,tx_num_str,keys): # return True or False; don't exit or raise exce wifs = [d.sec.wif for d in keys] try: - ret = g.rpch.signrawtransactionwithkey(self.hex,wifs,sig_data,g.proto.sighash_type) \ - if 'sign_with_key' in g.rpch.caps else \ - g.rpch.signrawtransaction(self.hex,sig_data,wifs,g.proto.sighash_type) + ret = g.rpc.signrawtransactionwithkey(self.hex,wifs,sig_data,g.proto.sighash_type) \ + if 'sign_with_key' in g.rpc.caps else \ + g.rpc.signrawtransaction(self.hex,sig_data,wifs,g.proto.sighash_type) except Exception as e: msg(yellow('This is not the BCH chain.\nRe-run the script without the --coin=bch option.' if 'Invalid sighash param' in e.args[0] else e.args[0])) @@ -774,7 +774,7 @@ def sign(self,tx_num_str,keys): # return True or False; don't exit or raise exce self.check_hex_tx_matches_mmgen_tx(dt) self.coin_txid = CoinTxID(dt['txid'],on_fail='raise') self.check_sigs(dt) - if not self.coin_txid == g.rpch.decoderawtransaction(ret['hex'])['txid']: + if not self.coin_txid == g.rpc.decoderawtransaction(ret['hex'])['txid']: raise BadMMGenTxID('txid mismatch (after signing)') msg('OK') return True @@ -879,7 +879,7 @@ def get_status(self,status=False): class r(object): pass def is_in_wallet(): - ret = g.rpch.gettransaction(self.coin_txid,on_fail='silent') + ret = g.rpc.gettransaction(self.coin_txid,on_fail='silent') if 'confirmations' in ret and ret['confirmations'] > 0: r.confs = ret['confirmations'] return True @@ -887,14 +887,14 @@ def is_in_wallet(): return False def is_in_utxos(): - return 'txid' in g.rpch.getrawtransaction(self.coin_txid,True,on_fail='silent') + return 'txid' in g.rpc.getrawtransaction(self.coin_txid,True,on_fail='silent') def is_in_mempool(): - return 'height' in g.rpch.getmempoolentry(self.coin_txid,on_fail='silent') + return 'height' in g.rpc.getmempoolentry(self.coin_txid,on_fail='silent') def is_replaced(): if is_in_mempool(): return False - ret = g.rpch.gettransaction(self.coin_txid,on_fail='silent') + ret = g.rpc.gettransaction(self.coin_txid,on_fail='silent') if not 'bip125-replaceable' in ret or not 'confirmations' in ret or ret['confirmations'] > 0: return False @@ -905,7 +905,7 @@ def is_replaced(): if is_in_mempool(): if status: - d = g.rpch.gettransaction(self.coin_txid,on_fail='silent') + d = g.rpc.gettransaction(self.coin_txid,on_fail='silent') brs = 'bip125-replaceable' rep = '{}replaceable'.format(('NOT ','')[brs in d and d[brs]=='yes']) t = d['timereceived'] @@ -930,7 +930,7 @@ def is_replaced(): msg('{}\n{}'.format(m1,m2)) if not opt.quiet: msg('Replacing transactions:') - d = ((t,g.rpch.getmempoolentry(t,on_fail='silent')) for t in r.replacing_txs) + d = ((t,g.rpc.getmempoolentry(t,on_fail='silent')) for t in r.replacing_txs) for txid,mp_entry in d: msg(' {}{}'.format(txid,' in mempool' if ('height' in mp_entry) else '')) die(0,'') @@ -965,7 +965,7 @@ def send(self,prompt_user=True,exit_on_fail=False): if prompt_user: self.confirm_send() - ret = None if g.bogus_send else g.rpch.sendrawtransaction(self.hex,on_fail='return') + ret = None if g.bogus_send else g.rpc.sendrawtransaction(self.hex,on_fail='return') from .rpc import rpc_error,rpc_errmsg if rpc_error(ret): @@ -1061,7 +1061,7 @@ def view(self,pager=False,pause=True,terse=False): msg('') # def is_replaceable_from_rpc(self): -# dec_tx = g.rpch.decoderawtransaction(self.hex) +# dec_tx = g.rpc.decoderawtransaction(self.hex) # return None < dec_tx['vin'][0]['sequence'] <= g.max_int - 2 def is_replaceable(self): diff --git a/mmgen/util.py b/mmgen/util.py index 64f5f60d..b2c4dfa4 100755 --- a/mmgen/util.py +++ b/mmgen/util.py @@ -843,10 +843,10 @@ def get_coin_daemon_auth_cookie(): def rpc_init(reinit=False): if not 'rpc' in g.proto.mmcaps: die(1,'Coin daemon operations not supported for coin {}!'.format(g.coin)) - if g.rpch != None and not reinit: return g.rpch + if g.rpc != None and not reinit: return g.rpc from .rpc import init_daemon - g.rpch = init_daemon(g.proto.daemon_family) - return g.rpch + g.rpc = init_daemon(g.proto.daemon_family) + return g.rpc def format_par(s,indent=0,width=80,as_list=False): words,lines = s.split(),[] diff --git a/test/test_py_d/ts_main.py b/test/test_py_d/ts_main.py index 647a9789..a1830856 100755 --- a/test/test_py_d/ts_main.py +++ b/test/test_py_d/ts_main.py @@ -147,7 +147,7 @@ def __init__(self,trunner,cfgs,spawn): if g.coin.lower() not in self.networks: return rpc_init() - self.lbl_id = ('account','label')['label_api' in g.rpch.caps] + self.lbl_id = ('account','label')['label_api' in g.rpc.caps] if g.coin in ('BTC','BCH','LTC'): self.tx_fee = {'btc':'0.0001','bch':'0.001','ltc':'0.01'}[g.coin.lower()] self.txbump_fee = {'btc':'123s','bch':'567s','ltc':'12345s'}[g.coin.lower()] diff --git a/test/unit_tests_d/ut_tx_deserialize.py b/test/unit_tests_d/ut_tx_deserialize.py index eec560dc..1e6d6922 100755 --- a/test/unit_tests_d/ut_tx_deserialize.py +++ b/test/unit_tests_d/ut_tx_deserialize.py @@ -25,7 +25,7 @@ def has_nonstandard_outputs(outputs): return True return False - d = g.rpch.decoderawtransaction(txhex) + d = g.rpc.decoderawtransaction(txhex) if has_nonstandard_outputs(d['vout']): return False