From 9090df312f6348d45a3fcd1807f8a7611ba95248 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Wed, 13 Oct 2021 19:50:58 +0000 Subject: [PATCH] minor fixes --- mmgen/node_tools/Global.py | 26 -------------------------- mmnode-halving-calculator | 4 ++-- test/test-release.sh | 3 +++ test/unit_tests_d/nt_BlocksInfo.py | 4 +++- 4 files changed, 8 insertions(+), 29 deletions(-) delete mode 100644 mmgen/node_tools/Global.py diff --git a/mmgen/node_tools/Global.py b/mmgen/node_tools/Global.py deleted file mode 100644 index 4384096..0000000 --- a/mmgen/node_tools/Global.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python3 -# -# mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution -# Copyright (C)2013-2016 Philemon -# -# 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 . -""" -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' diff --git a/mmnode-halving-calculator b/mmnode-halving-calculator index 3409c5a..7ddf0a1 100755 --- a/mmnode-halving-calculator +++ b/mmnode-halving-calculator @@ -83,7 +83,7 @@ async def main(): if proto.name == 'BitcoinCash': sub = proto.coin_amt(str(cur['subsidy'])) else: - sub = cur['subsidy'] * proto.coin_amt.min_coin_unit + sub = cur['subsidy'] * proto.coin_amt.satoshi def print_current_stats(): print( @@ -104,7 +104,7 @@ async def main(): hist_halvings = await c.gathered_call('getblockstats',([(n,) for n in halving_blocknums if n <= tip])) halving_secs = bdr_proj * 60 * proto.halving_interval 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_date = (await c.call('getblock',block0_hash))['time'] diff --git a/test/test-release.sh b/test/test-release.sh index 4b2df03..45c3ee7 100755 --- a/test/test-release.sh +++ b/test/test-release.sh @@ -3,6 +3,8 @@ export MMGEN_TEST_SUITE=1 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" RESET="\e[0m" @@ -46,6 +48,7 @@ check_mmgen_repo() { create_links() { ( 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' for fn in ../../$nt_repo/test/unit_tests_d/nt_*.py; do diff --git a/test/unit_tests_d/nt_BlocksInfo.py b/test/unit_tests_d/nt_BlocksInfo.py index 307f6e8..da411f4 100755 --- a/test/unit_tests_d/nt_BlocksInfo.py +++ b/test/unit_tests_d/nt_BlocksInfo.py @@ -105,7 +105,9 @@ class unit_tests: def test(spec,foo,chk): b = BlocksInfo(spec if type(spec) == tuple else [spec],dummyOpt(),dummyRPC()) 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}' for vec in range_vecs: