Browse Source

minor fixes

The MMGen Project 3 years ago
parent
commit
9090df312f

+ 0 - 26
mmgen/node_tools/Global.py

@@ -1,26 +0,0 @@
-#!/usr/bin/env python3
-#
-# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
-# Copyright (C)2013-2016 Philemon <mmgen-py@yandex.com>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-"""
-mmgen.node_tools.Global: global variables for MMGen node tools
-"""
-
-import os
-
-class nt(object):
-	system_data_dir = '/usr/local/share/mmgen/node_tools'
-	data_dir = os.getenv('HOME') + '/.mmgen/node_tools'

+ 2 - 2
mmnode-halving-calculator

@@ -83,7 +83,7 @@ async def main():
 	if proto.name == 'BitcoinCash':
 	if proto.name == 'BitcoinCash':
 		sub = proto.coin_amt(str(cur['subsidy']))
 		sub = proto.coin_amt(str(cur['subsidy']))
 	else:
 	else:
-		sub = cur['subsidy'] * proto.coin_amt.min_coin_unit
+		sub = cur['subsidy'] * proto.coin_amt.satoshi
 
 
 	def print_current_stats():
 	def print_current_stats():
 		print(
 		print(
@@ -104,7 +104,7 @@ async def main():
 		hist_halvings = await c.gathered_call('getblockstats',([(n,) for n in halving_blocknums if n <= tip]))
 		hist_halvings = await c.gathered_call('getblockstats',([(n,) for n in halving_blocknums if n <= tip]))
 		halving_secs = bdr_proj * 60 * proto.halving_interval
 		halving_secs = bdr_proj * 60 * proto.halving_interval
 		nhist = len(hist_halvings)
 		nhist = len(hist_halvings)
-		nSubsidy = int(proto.start_subsidy / proto.coin_amt.min_coin_unit)
+		nSubsidy = int(proto.start_subsidy / proto.coin_amt.satoshi)
 
 
 		block0_hash = await c.call('getblockhash',0)
 		block0_hash = await c.call('getblockhash',0)
 		block0_date = (await c.call('getblock',block0_hash))['time']
 		block0_date = (await c.call('getblock',block0_hash))['time']

+ 3 - 0
test/test-release.sh

@@ -3,6 +3,8 @@
 export MMGEN_TEST_SUITE=1
 export MMGEN_TEST_SUITE=1
 export PYTHONPATH=.
 export PYTHONPATH=.
 
 
+orig_pwd=$(pwd)
+
 RED="\e[31;1m" GREEN="\e[32;1m" YELLOW="\e[33;1m" BLUE="\e[34;1m" MAGENTA="\e[35;1m" CYAN="\e[36;1m"
 RED="\e[31;1m" GREEN="\e[32;1m" YELLOW="\e[33;1m" BLUE="\e[34;1m" MAGENTA="\e[35;1m" CYAN="\e[36;1m"
 RESET="\e[0m"
 RESET="\e[0m"
 
 
@@ -46,6 +48,7 @@ check_mmgen_repo() {
 
 
 create_links() {
 create_links() {
 	( cd 'mmgen'; [ -L 'node_tools' ] || ln -s "../$nt_repo/mmgen/node_tools" )
 	( cd 'mmgen'; [ -L 'node_tools' ] || ln -s "../$nt_repo/mmgen/node_tools" )
+	( cd $mm_repo && [ -L 'mmgen_node_tools' ] || ln -s "$orig_pwd/mmgen_node_tools" )
 	(
 	(
 		cd 'test/unit_tests_d'
 		cd 'test/unit_tests_d'
 		for fn in ../../$nt_repo/test/unit_tests_d/nt_*.py; do
 		for fn in ../../$nt_repo/test/unit_tests_d/nt_*.py; do

+ 3 - 1
test/unit_tests_d/nt_BlocksInfo.py

@@ -105,7 +105,9 @@ class unit_tests:
 		def test(spec,foo,chk):
 		def test(spec,foo,chk):
 			b = BlocksInfo(spec if type(spec) == tuple else [spec],dummyOpt(),dummyRPC())
 			b = BlocksInfo(spec if type(spec) == tuple else [spec],dummyOpt(),dummyRPC())
 			ret = (b.first,b.last,b.block_list)
 			ret = (b.first,b.last,b.block_list)
-			vmsg('{:13} => {}'.format(repr(spec) if type(spec) == tuple else spec,chk))
+			vmsg('{:13} => {}'.format(
+				(repr(spec) if type(spec) == tuple else spec),
+				chk ))
 			assert ret == chk, f'{ret} != {chk}'
 			assert ret == chk, f'{ret} != {chk}'
 
 
 		for vec in range_vecs:
 		for vec in range_vecs: