Browse Source

Support BCH cashaddr format

The MMGen Project 2 months ago
parent
commit
92fdfc047e
4 changed files with 6 additions and 6 deletions
  1. 1 1
      mmgen_node_tools/data/version
  2. 3 3
      mmgen_node_tools/main_addrbal.py
  3. 1 1
      setup.cfg
  4. 1 1
      test/cmdtest_py_d/ct_regtest.py

+ 1 - 1
mmgen_node_tools/data/version

@@ -1 +1 @@
-3.4.0
+3.5.dev1

+ 3 - 3
mmgen_node_tools/main_addrbal.py

@@ -38,7 +38,7 @@ def do_output(proto,addr_data,blk_hdrs):
 	indent = ' ' * (col1w + 2)
 
 	for n,(addr,unspents) in enumerate(addr_data.items(),1):
-		Msg(f'\n{n:{col1w}}) Address: {addr.hl()}')
+		Msg(f'\n{n:{col1w}}) Address: {addr.hl(addr.view_pref)}')
 
 		if unspents:
 			heights = { u['height'] for u in unspents }
@@ -93,7 +93,7 @@ def do_output_tabular(proto,addr_data,blk_hdrs):
 		if unspents:
 			Msg(fs.format(
 				n = str(n) + ')',
-				a = addr.fmt(width=max_addrw,color=True),
+				a = addr.fmt(addr.view_pref, width=max_addrw, color=True),
 				u = red(str(len(unspents)).rjust(5)),
 				b = unspents[0]['height'],
 				t = make_timestr( blk_hdrs[unspents[0]['height']]['time'] ),
@@ -104,7 +104,7 @@ def do_output_tabular(proto,addr_data,blk_hdrs):
 		else:
 			Msg(fs.format(
 				n = str(n) + ')',
-				a = addr.fmt(width=max_addrw,color=True),
+				a = addr.fmt(addr.view_pref, width=max_addrw, color=True),
 				u = '    -',
 				b = '-',
 				t = '',

+ 1 - 1
setup.cfg

@@ -38,7 +38,7 @@ python_requires = >=3.9
 include_package_data = True
 
 install_requires =
-	mmgen-wallet==15.0.0
+	mmgen-wallet>=15.1.dev1
 	pyyaml
 	yahooquery
 

+ 1 - 1
test/cmdtest_py_d/ct_regtest.py

@@ -112,7 +112,7 @@ class CmdTestRegtest(CmdTestBase):
 		if cfg._proto.testnet:
 			die(2,'--testnet and --regtest options incompatible with regtest test suite')
 		self.proto = init_proto( cfg, self.proto.coin, network='regtest', need_amt=True )
-		self.addrs = gen_addrs(self.proto,'regtest',[1,2,3,4,5])
+		self.addrs = [a.views[a.view_pref] for a in gen_addrs(self.proto,'regtest',[1,2,3,4,5])]
 
 		self.use_bdb_wallet = self.bdb_wallet or self.proto.coin != 'BTC'
 		self.regtest = MMGenRegtest(cfg, self.proto.coin, bdb_wallet=self.use_bdb_wallet)