minor fixes
This commit is contained in:
parent
463431e586
commit
9090df312f
4 changed files with 8 additions and 29 deletions
|
|
@ -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'
|
||||
|
|
@ -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']
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue