Stuck in the grind

This commit is contained in:
Duke Leto
2020-12-16 22:10:59 -05:00
parent 7136da99ae
commit 980350b9b4
132 changed files with 529 additions and 853 deletions

View File

@@ -1,3 +1,6 @@
# Copyright (c) 2016-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
import binascii
import calendar
import json
@@ -10,13 +13,13 @@ import sys
import tarfile
import time
ZCASH_CLI = './src/zcash-cli'
HUSH_CLI = './src/hush-cli'
USAGE = """
Requirements:
- find
- xz
- %s (edit ZCASH_CLI in this script to alter the path)
- A running mainnet zcashd using the default datadir with -txindex=1
- %s (edit HUSH_CLI in this script to alter the path)
- A running mainnet hushd using the default datadir with -txindex=1
Example usage:
@@ -25,11 +28,11 @@ virtualenv venv
. venv/bin/activate
pip install --global-option=build_ext --global-option="-L$(pwd)/src/leveldb/" --global-option="-I$(pwd)/src/leveldb/include/" plyvel
pip install progressbar2
LD_LIBRARY_PATH=src/leveldb python qa/zcash/create_benchmark_archive.py
""" % ZCASH_CLI
LD_LIBRARY_PATH=src/leveldb python qa/hush/create_benchmark_archive.py
""" % HUSH_CLI
def check_deps():
if subprocess.call(['which', 'find', 'xz', ZCASH_CLI], stdout=subprocess.PIPE):
if subprocess.call(['which', 'find', 'xz', HUSH_CLI], stdout=subprocess.PIPE):
print USAGE
sys.exit()
@@ -154,15 +157,15 @@ def deterministic_filter(tarinfo):
return tarinfo
def create_benchmark_archive(blk_hash):
blk = json.loads(subprocess.check_output([ZCASH_CLI, 'getblock', blk_hash]))
blk = json.loads(subprocess.check_output([HUSH_CLI, 'getblock', blk_hash]))
print 'Height: %d' % blk['height']
print 'Transactions: %d' % len(blk['tx'])
os.mkdir('benchmark')
with open('benchmark/block-%d.dat' % blk['height'], 'wb') as f:
f.write(binascii.unhexlify(subprocess.check_output([ZCASH_CLI, 'getblock', blk_hash, 'false']).strip()))
f.write(binascii.unhexlify(subprocess.check_output([HUSH_CLI, 'getblock', blk_hash, 'false']).strip()))
txs = [json.loads(subprocess.check_output([ZCASH_CLI, 'getrawtransaction', tx, '1'])
txs = [json.loads(subprocess.check_output([HUSH_CLI, 'getrawtransaction', tx, '1'])
) for tx in blk['tx']]
js_txs = len([tx for tx in txs if len(tx['vjoinsplit']) > 0])
@@ -187,7 +190,7 @@ def create_benchmark_archive(blk_hash):
bar = progressbar.ProgressBar(redirect_stdout=True)
print 'Collecting input coins for block'
for tx in bar(unique_inputs.keys()):
rawtx = json.loads(subprocess.check_output([ZCASH_CLI, 'getrawtransaction', tx, '1']))
rawtx = json.loads(subprocess.check_output([HUSH_CLI, 'getrawtransaction', tx, '1']))
mask_size = 0
mask_code = 0
@@ -235,7 +238,7 @@ def create_benchmark_archive(blk_hash):
binascii.unhexlify(rawtx['vout'][i]['scriptPubKey']['hex'])))
# - VARINT(nHeight)
coins.extend(encode_varint(json.loads(
subprocess.check_output([ZCASH_CLI, 'getblockheader', rawtx['blockhash']])
subprocess.check_output([HUSH_CLI, 'getblockheader', rawtx['blockhash']])
)['height']))
db_key = b'c' + bytes(binascii.unhexlify(tx)[::-1])

View File

@@ -1,9 +1,8 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2017 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#
# Create a large wallet
#
# To use:
@@ -11,7 +10,6 @@
# - Add wallet_large.py to RPC tests list
# - ./qa/pull-tester/rpc-tests.sh wallet_large --nocleanup
# - Archive the resulting /tmp/test###### directory
#
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (

View File

@@ -1,7 +1,8 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Released under the GPLv3
# Execute all of the automated tests related to Hush
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
import argparse
import os

View File

@@ -1,9 +1,8 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Released under the GPLv3
#
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
# Execute all of the automated tests related to Hush
#
import argparse
from glob import glob

View File

@@ -20,10 +20,9 @@ Possible options:
```
-h, --help show this help message and exit
--nocleanup Leave komodods and test.* datadir on exit or error
--noshutdown Don't stop komodods after the test execution
--srcdir=SRCDIR Source directory containing hushd/hush-cli (default:
../../src)
--nocleanup Leave binaries and test.* datadir on exit or error
--noshutdown Don't stop full node after the test execution
--srcdir=SRCDIR Source directory containing hushd/hush-cli (default: ../../src)
--tmpdir=TMPDIR Root directory for datadirs
--tracerpc Print out all RPC calls as they are made
```
@@ -39,8 +38,7 @@ After the first run, the cache/ blockchain and wallets are
copied into a temporary directory and used as the initial
test state.
If you get into a bad state, you should be able
to recover with:
If you get into a bad state, you should be able to recover with:
```bash
rm -rf cache

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env python2
# Copyright (c) 2018-2020 The Hush developers
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Released under the GPLv3
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,11 +1,9 @@
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2016-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#
# Test addressindex generation and fetching
#
import time
from test_framework.test_framework import BitcoinTestFramework
@@ -346,4 +344,4 @@ class AddressIndexTest(BitcoinTestFramework):
if __name__ == '__main__':
AddressIndexTest().main()
AddressIndexTest().main()

View File

@@ -1,8 +1,7 @@
#!/usr/bin/env python2
#
# Distributed under the GPLv3/X11 software license, see the accompanying
# Copyright (c) 2016-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import start_nodes

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python2
#
# Copyright (c) 2016-2020 The Hush developers
# Distributed under the GPLv3/X11 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2016 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
#
# Test hard fork detection

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
#
# Distributed under the GPLv3/X11 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2019 Bartlomiej Lisiecki
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2017 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
#
# Distributed under the GPLv3/X11 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2017 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,7 +1,11 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
import sys
sys.path.append('../../src/tui')
from lib import tuilib
# tuilib was removed, tests left here as inspiration
#sys.path.append('../../src/tui')
#from lib import tuilib
import unittest
import time
@@ -11,17 +15,17 @@ change chain parameters if needed or add a new chain to test below
added 1 second sleep after each case to surely not face the nSPV server limitation (1 call/second)
'''
wif = ''
wif = ''
dest_address = ''
amount = '0.01'
chain = 'ILN'
amount = '0.01'
chain = 'HUSH3'
if not wif or not dest_address:
raise Exception("Please set test wif and address to send transactions to")
rpc_proxy = tuilib.def_credentials(chain)
chain_params = {"KMD": {
chain_params = {"HUSH3": {
'tx_list_address': 'RGShWG446Pv24CKzzxjA23obrzYwNbs1kA',
'min_chain_height': 1468080,
'notarization_height': '1468000',
@@ -33,19 +37,6 @@ chain_params = {"KMD": {
'tx_proof_id': 'f7beb36a65bc5bcbc9c8f398345aab7948160493955eb4a1f05da08c4ac3784f',
'tx_spent_height': 1456212,
'tx_proof_height': '1468520',
},
"ILN": {
'tx_list_address': 'RUp3xudmdTtxvaRnt3oq78FJBjotXy55uu',
'min_chain_height': 3689,
'notarization_height': '2000',
'prev_notarization_h': 1998,
'next_notarization_h': 2008,
'hdrs_proof_low': '2000',
'hdrs_proof_high': '2100',
'numhdrs_expected': 113,
'tx_proof_id': '67ffe0eaecd6081de04675c492a59090b573ee78955c4e8a85b8ac0be0e8e418',
'tx_spent_height': 2681,
'tx_proof_height': '2690',
}
}
@@ -98,7 +89,7 @@ class TestNspvClient(unittest.TestCase):
print("testing nspv_login")
result = rpc_proxy.nspv_login(wif)
self.assertEqual(result["result"], "success")
self.assertEqual(result["status"], "wif will expire in 777 seconds")
self.assertEqual(result["status"], "wif will expire in 555 seconds")
time.sleep(1)
def test_nspv_listunspent(self):
@@ -156,9 +147,9 @@ class TestNspvClient(unittest.TestCase):
time.sleep(1)
def test_nspv_login_timout(self):
print("testing auto-logout in 777 seconds")
print("testing auto-logout in 555 seconds")
rpc_proxy.nspv_login(wif)
time.sleep(778)
time.sleep(556)
result = rpc_proxy.nspv_spend(dest_address, amount)
self.assertEqual(result["result"], "error")
self.assertEqual(result["error"], "wif expired")

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
#
# Distributed under the GPLv3/X11 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2017 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
#
# Distributed under the GPLv3/X11 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,7 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_true, initialize_chain_clean, start_node
@@ -54,4 +57,4 @@ class SignOfflineTest (BitcoinTestFramework):
assert_true(len(online_tx_hash) > 0)
if __name__ == '__main__':
SignOfflineTest().main()
SignOfflineTest().main()

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
@@ -136,4 +137,4 @@ class SpentIndexTest(BitcoinTestFramework):
if __name__ == '__main__':
SpentIndexTest().main()
SpentIndexTest().main()

View File

@@ -1,3 +1,6 @@
# Copyright (c) 2016-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
"""
Copyright 2011 Jeff Garzik
@@ -47,10 +50,8 @@ try:
except ImportError:
import urlparse
USER_AGENT = "AuthServiceProxy/0.1"
USER_AGENT = "FUCKjl777LULZ"
HTTP_TIMEOUT = 600
log = logging.getLogger("BitcoinRPC")
class JSONRPCException(Exception):

View File

@@ -1,12 +1,7 @@
#
#
# bignum.py
#
# This file is copied from python-bitcoinlib.
#
# Copyright (c) 2016-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#
# This file is from python-bitcoinlib.
"""Bignum routines"""

View File

@@ -1,3 +1,6 @@
# Copyright (c) 2016-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
# BlockStore: a helper class that keeps a map of blocks and implements
# helper functions for responding to getheaders and getdata,
# and for constructing a getheaders message

View File

@@ -1,9 +1,7 @@
# blocktools.py - utilities for manipulating blocks and transactions
#
# Copyright (c) 2016-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#
# blocktools.py - utilities for manipulating blocks and transactions
from mininode import CBlock, CTransaction, CTxIn, CTxOut, COutPoint
from script import CScript, OP_0, OP_EQUAL, OP_HASH160

View File

@@ -1,8 +1,7 @@
#!/usr/bin/env python2
#
# Copyright (c) 2016-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#
from mininode import CBlock, CTransaction, CInv, NodeConn, NodeConnCB, \
msg_inv, msg_getheaders, msg_ping, msg_mempool, mininode_lock, MAX_INV_SZ

View File

@@ -1,3 +1,6 @@
# Copyright (c) 2016-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
from operator import itemgetter
import struct

View File

@@ -1,6 +1,7 @@
# mininode.py - Bitcoin P2P network half-a-node
# Copyright (c) 2016-2020 The Hush developers
# Lovingly maintained and released under the GPLv3
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
# mininode.py - Bitcoin P2P network half-a-node
#
# This python code was modified from ArtForz' public domain half-a-node, as
# found in the mini-node branch of http://github.com/jgarzik/pynode.
@@ -40,18 +41,14 @@ from .equihash import (
zcash_person,
)
OVERWINTER_PROTO_VERSION = 170003
BIP0031_VERSION = 60000
SPROUT_PROTO_VERSION = 170002 # past bip-31 for ping/pong
SAPLING_PROTO_VERSION = 170006
MY_SUBVERSION = "/python-mininode-hush-tester:3.3.0/"
OVERWINTER_PROTO_VERSION = 170003
BIP0031_VERSION = 60000
SPROUT_PROTO_VERSION = 170002 # past bip-31 for ping/pong
SAPLING_PROTO_VERSION = 1987420
MY_SUBVERSION = "/SpicySand/"
OVERWINTER_VERSION_GROUP_ID = 0x03C48270
MAX_INV_SZ = 50000
COIN = 100000000 # 1 HUSH in puposhis
MAX_INV_SZ = 50000
COIN = 100000000 # 1 HUSH in puposhis
# Keep our own socket map for asyncore, so that we can track disconnects
# ourselves (to workaround an issue with closing an asyncore socket when
@@ -417,14 +414,14 @@ ZC_NOTEPLAINTEXT_LEADING = 1
ZC_V_SIZE = 8
ZC_RHO_SIZE = 32
ZC_R_SIZE = 32
ZC_MEMO_SIZE = 512
HUSH_MEMO_SIZE = 512
ZC_NOTEPLAINTEXT_SIZE = (
ZC_NOTEPLAINTEXT_LEADING +
ZC_V_SIZE +
ZC_RHO_SIZE +
ZC_R_SIZE +
ZC_MEMO_SIZE
HUSH_MEMO_SIZE
)
NOTEENCRYPTION_AUTH_BYTES = 16

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,15 +1,11 @@
#
# script.py
#
# This file is modified from python-bitcoinlib.
#
# Copyright (c) 2016-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#
# This file is modified from python-bitcoinlib.
"""Scripts
Functionality to build scripts, as well as SignatureHash().
Functionality to build Bitcoin style Scripts, as well as SignatureHash().
"""
from __future__ import absolute_import, division, print_function, unicode_literals
@@ -29,13 +25,11 @@ import binascii
from test_framework import bignum
MAX_SCRIPT_SIZE = 10000
MAX_SCRIPT_SIZE = 10000
MAX_SCRIPT_ELEMENT_SIZE = 520
MAX_SCRIPT_OPCODES = 201
OPCODE_NAMES = {}
_opcode_instances = []
MAX_SCRIPT_OPCODES = 201
OPCODE_NAMES = {}
_opcode_instances = []
class CScriptOp(int):
"""A single script opcode"""
__slots__ = []

View File

@@ -1,3 +1,4 @@
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,14 +1,12 @@
#!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Copyright (c) 2016-2020 The Hush developers
# Released under the GPLv3
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
# Base class for RPC testing
# Add python-bitcoinrpc to module search path:
import os
import sys
import shutil
import tempfile
import traceback
@@ -19,7 +17,6 @@ from util import assert_equal, check_json_precision, \
start_nodes, connect_nodes_bi, stop_nodes, \
sync_blocks, sync_mempools, wait_bitcoinds
class BitcoinTestFramework(object):
# These may be over-ridden by subclasses:

View File

@@ -1,12 +1,9 @@
# Copyright (c) 2018-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Copyright (c) 2018-2019 The SuperNET developers
# Copyright (c) 2018-2020 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#
# Helpful routines for regression testing
#
# Add python-bitcoinrpc to module search path:
import os
import sys

View File

@@ -1,17 +1,14 @@
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2016-2020 The Hush developers
# Released under the GPLv3
#
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
# Test timestampindex generation and fetching
#
import time
from test_framework.test_framework import HushTestFramework
from test_framework.util import *
class TimestampIndexTest(HushTestFramework):
def setup_chain(self):

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
@@ -70,4 +71,4 @@ class TxIndexTest(BitcoinTestFramework):
if __name__ == '__main__':
TxIndexTest().main()
TxIndexTest().main()

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2016 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
@@ -81,4 +82,4 @@ def parse_wallet_file_lines(file_lines, i):
return ("".join(keys), i)
if __name__ == '__main__':
WalletImportExportTest().main()
WalletImportExportTest().main()

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2017 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2016 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2018 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,9 +1,9 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2016 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.mininode import COIN
@@ -217,7 +217,7 @@ class WalletProtectCoinbaseTest (BitcoinTestFramework):
# UTXO selection in z_sendmany sorts in ascending order, so smallest utxos are consumed first.
# At this point in time, unspent notes all have a value of 10.0 and standard z_sendmany fee is 0.0001.
recipients = []
amount = Decimal('10.0') - Decimal('0.00010000') - Decimal('0.00000001') # this leaves change at 1 zatoshi less than dust threshold
amount = Decimal('10.0') - Decimal('0.00010000') - Decimal('0.00000001') # this leaves change at 1 puposhi less than dust threshold
recipients.append({"address":self.nodes[0].getnewaddress(), "amount":amount })
myopid = self.nodes[0].z_sendmany(mytaddr, recipients)
wait_and_assert_operationid_status(self.nodes[0], myopid, "failed", "Insufficient transparent funds, have 10.00, need 0.00000053 more to avoid creating invalid change output 0.00000001 (dust threshold is 0.00000054)")

View File

@@ -1,7 +1,8 @@
#!/usr/bin/env python2
# Copyright (c) 2018 The Zcash developers
# Copyright (c) 2016-2020 The Hush developers
# Released under the GPLv3
# Copyright (c) 2018 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSONRPCException

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2017 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Released under the GPLv3
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
import inspect
import os

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2016 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2017 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,11 +1,9 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2020 The Hush developers
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#
# Test ZMQ interface
#
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, bytes_to_hex_str, start_nodes