Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ env:
- CCACHE_TEMPDIR=/tmp/.ccache-temp
- CCACHE_COMPRESS=1
- BASE_OUTDIR=$TRAVIS_BUILD_DIR/out
- SDK_URL=https://bitcoin.jonasschnelli.ch/sdks
- SDK_URL=https://bitcoincore.org/depends-sources/sdks
- PYTHON_DEBUG=1
- WINEDEBUG=fixme-all

Expand All @@ -52,16 +52,16 @@ env:

before_install:
- git clone https://github.com/dashpay/dash_hash
- travis_retry sudo apt-get install python-dev
- travis_retry sudo apt-get install python3-dev python3-pip
- travis_retry sudo add-apt-repository ppa:ubuntu-wine/ppa -y
- export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")
install:
- if [ "$PYZMQ" = "true" ]; then pip install pyzmq --user ; fi
- if [ "$PYZMQ" = "true" ]; then pip3 install pyzmq --user ; fi
- if [ -n "$PPA" ]; then travis_retry sudo add-apt-repository "$PPA" -y; fi
- if [ -n "$DPKG_ADD_ARCH" ]; then sudo dpkg --add-architecture "$DPKG_ADD_ARCH" ; fi
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi
- cd dash_hash && python setup.py install --user && cd ..
- cd dash_hash && python3 setup.py install --user && cd ..
before_script:
- unset CC; unset CXX
- unset DISPLAY
Expand Down
9 changes: 7 additions & 2 deletions depends/packages/fontconfig.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package=fontconfig
$(package)_version=2.11.1
$(package)_version=2.12.6
$(package)_download_path=http://www.freedesktop.org/software/fontconfig/release/
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=dc62447533bca844463a3c3fd4083b57c90f18a70506e7a9f4936b5a1e516a99
$(package)_sha256_hash=cf0c30807d08f6a28ab46c61b8dbd55c97d2f292cf88f3a07d3384687f31f017
$(package)_dependencies=freetype expat
$(package)_patches=fix_conflicting_types.patch

define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/fix_conflicting_types.patch
endef

define $(package)_set_vars
$(package)_config_opts=--disable-docs --disable-static
Expand Down
1 change: 0 additions & 1 deletion depends/packages/qt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ define $(package)_preprocess_cmds
endef

define $(package)_config_cmds
export PKG_CONFIG_SYSROOT_DIR=/ && \
export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \
export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig && \
./configure $($(package)_config_opts) && \
Expand Down
15 changes: 15 additions & 0 deletions depends/patches/fontconfig/fix_conflicting_types.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- a/src/fcobjs.c
+++ b/src/fcobjs.c
@@ -24,12 +24,6 @@

#include "fcint.h"

-static unsigned int
-FcObjectTypeHash (register const char *str, register FC_GPERF_SIZE_T len);
-
-static const struct FcObjectTypeInfo *
-FcObjectTypeLookup (register const char *str, register FC_GPERF_SIZE_T len);
-
#include "fcobjshash.h"

#include <string.h>
2 changes: 1 addition & 1 deletion doc/zmq.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ newer. Typically, it is packaged by distributions as something like
*libzmq3-dev*. The C++ wrapper for ZeroMQ is *not* needed.

In order to run the example Python client scripts in contrib/ one must
also install *python-zmq*, though this is not necessary for daemon
also install *python3-zmq*, though this is not necessary for daemon
operation.

## Enabling
Expand Down
4 changes: 2 additions & 2 deletions qa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Before running the tests, the following must be installed.

Unix
----
The python-zmq library is required. On Ubuntu or Debian it can be installed via:
The python3-zmq library is required. On Ubuntu or Debian it can be installed via:
```
sudo apt-get install python-zmq
sudo apt-get install python3-zmq
```

Running tests
Expand Down
10 changes: 5 additions & 5 deletions qa/pull-tester/rpc-tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand Down Expand Up @@ -70,14 +70,14 @@
if EXEEXT == ".exe" and "-win" not in opts:
# https://github.com/bitcoin/bitcoin/commit/d52802551752140cf41f0d9a225a43e84404d3e9
# https://github.com/bitcoin/bitcoin/pull/5677#issuecomment-136646964
print "Win tests currently disabled by default. Use -win option to enable"
print("Win tests currently disabled by default. Use -win option to enable")
sys.exit(0)

if not (ENABLE_WALLET == 1 and ENABLE_UTILS == 1 and ENABLE_BITCOIND == 1):
print "No rpc tests to run. Wallet, utils, and bitcoind must all be enabled"
print("No rpc tests to run. Wallet, utils, and bitcoind must all be enabled")
sys.exit(0)

# python-zmq may not be installed. Handle this gracefully and with some helpful info
# python3-zmq may not be installed. Handle this gracefully and with some helpful info
if ENABLE_ZMQ:
try:
import zmq
Expand Down
6 changes: 2 additions & 4 deletions qa/pull-tester/tests_config.py.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2013-2014 The Bitcoin Core developers
#!/usr/bin/env python3
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand All @@ -11,5 +11,3 @@ EXEEXT="@EXEEXT@"
@BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=1
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=1
@ENABLE_ZMQ_TRUE@ENABLE_ZMQ=1


17 changes: 7 additions & 10 deletions qa/rpc-tests/abandonconflict.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.


from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
try:
import urllib.parse as urlparse
except ImportError:
import urlparse
import urllib.parse

class AbandonConflictTest(BitcoinTestFramework):

Expand All @@ -34,7 +31,7 @@ def run_test(self):
assert(balance - newbalance < Decimal("0.001")) #no more than fees lost
balance = newbalance

url = urlparse.urlparse(self.nodes[1].url)
url = urllib.parse.urlparse(self.nodes[1].url)
self.nodes[0].disconnectnode(url.hostname+":"+str(p2p_port(1)))

# Identify the 10btc outputs
Expand Down Expand Up @@ -151,9 +148,9 @@ def run_test(self):
self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())
newbalance = self.nodes[0].getbalance()
#assert(newbalance == balance - Decimal("10"))
print "If balance has not declined after invalidateblock then out of mempool wallet tx which is no longer"
print "conflicted has not resumed causing its inputs to be seen as spent. See Issue #7315"
print balance , " -> " , newbalance , " ?"
print("If balance has not declined after invalidateblock then out of mempool wallet tx which is no longer")
print("conflicted has not resumed causing its inputs to be seen as spent. See Issue #7315")
print(str(balance) + " -> " + str(newbalance) + " ?")

if __name__ == '__main__':
AbandonConflictTest().main()
56 changes: 28 additions & 28 deletions qa/rpc-tests/addressindex.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
Expand Down Expand Up @@ -36,7 +36,7 @@ def setup_network(self):
self.sync_all()

def run_test(self):
print "Mining blocks..."
print("Mining blocks...")
self.nodes[0].generate(105)
self.sync_all()

Expand All @@ -50,7 +50,7 @@ def run_test(self):
assert_equal(balance0["balance"], 0)

# Check p2pkh and p2sh address indexes
print "Testing p2pkh and p2sh address index..."
print("Testing p2pkh and p2sh address index...")

txid0 = self.nodes[0].sendtoaddress("yMNJePdcKvXtWWQnFYHNeJ5u8TF2v1dfK4", 10)
self.nodes[0].generate(1)
Expand Down Expand Up @@ -85,7 +85,7 @@ def run_test(self):
assert_equal(txidsb[2], txidb2)

# Check that limiting by height works
print "Testing querying txids by range of block heights.."
print("Testing querying txids by range of block heights..")
height_txids = self.nodes[1].getaddresstxids({
"addresses": ["93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB"],
"start": 105,
Expand All @@ -110,8 +110,8 @@ def run_test(self):
assert_equal(balance0["balance"], 45 * 100000000)

# Check that outputs with the same address will only return one txid
print "Testing for txid uniqueness..."
addressHash = "FE30B718DCF0BF8A2A686BF1820C073F8B2C3B37".decode("hex")
print("Testing for txid uniqueness...")
addressHash = bytes.fromhex("FE30B718DCF0BF8A2A686BF1820C073F8B2C3B37")
scriptPubKey = CScript([OP_HASH160, addressHash, OP_EQUAL])
unspent = self.nodes[0].listunspent()
tx = CTransaction()
Expand All @@ -130,23 +130,23 @@ def run_test(self):
assert_equal(txidsmany[3], sent_txid)

# Check that balances are correct
print "Testing balances..."
print("Testing balances...")
balance0 = self.nodes[1].getaddressbalance("93bVhahvUKmQu8gu9g3QnPPa2cxFK98pMB")
assert_equal(balance0["balance"], 45 * 100000000 + 21)

# Check that balances are correct after spending
print "Testing balances after spending..."
print("Testing balances after spending...")
privkey2 = "cU4zhap7nPJAWeMFu4j6jLrfPmqakDAzy8zn8Fhb3oEevdm4e5Lc"
address2 = "yeMpGzMj3rhtnz48XsfpB8itPHhHtgxLc3"
addressHash2 = "C5E4FB9171C22409809A3E8047A29C83886E325D".decode("hex")
addressHash2 = bytes.fromhex("C5E4FB9171C22409809A3E8047A29C83886E325D")
scriptPubKey2 = CScript([OP_DUP, OP_HASH160, addressHash2, OP_EQUALVERIFY, OP_CHECKSIG])
self.nodes[0].importprivkey(privkey2)

unspent = self.nodes[0].listunspent()
tx = CTransaction()
tx.vin = [CTxIn(COutPoint(int(unspent[0]["txid"], 16), unspent[0]["vout"]))]
amount = unspent[0]["amount"] * 100000000
tx.vout = [CTxOut(amount, scriptPubKey2)]
amount = unspent[0]["amount"] * COIN
tx.vout = [CTxOut(int(amount), scriptPubKey2)]
tx.rehash()
signed_tx = self.nodes[0].signrawtransaction(binascii.hexlify(tx.serialize()).decode("utf-8"))
spending_txid = self.nodes[0].sendrawtransaction(signed_tx["hex"], True)
Expand All @@ -157,9 +157,9 @@ def run_test(self):

tx = CTransaction()
tx.vin = [CTxIn(COutPoint(int(spending_txid, 16), 0))]
send_amount = 1 * 100000000 + 12840
send_amount = 1 * COIN + 12840
change_amount = amount - send_amount - 10000
tx.vout = [CTxOut(change_amount, scriptPubKey2), CTxOut(send_amount, scriptPubKey)]
tx.vout = [CTxOut(int(change_amount), scriptPubKey2), CTxOut(int(send_amount), scriptPubKey)]
tx.rehash()

signed_tx = self.nodes[0].signrawtransaction(binascii.hexlify(tx.serialize()).decode("utf-8"))
Expand Down Expand Up @@ -188,13 +188,13 @@ def run_test(self):
assert_equal(len(deltas), 1)

# Check that unspent outputs can be queried
print "Testing utxos..."
print("Testing utxos...")
utxos = self.nodes[1].getaddressutxos({"addresses": [address2]})
assert_equal(len(utxos), 1)
assert_equal(utxos[0]["satoshis"], change_amount)

# Check that indexes will be updated with a reorg
print "Testing reorg..."
print("Testing reorg...")

best_hash = self.nodes[0].getbestblockhash()
self.nodes[0].invalidateblock(best_hash)
Expand Down Expand Up @@ -228,33 +228,33 @@ def run_test(self):
assert_equal(utxos3[2]["height"], 265)

# Check mempool indexing
print "Testing mempool indexing..."
print("Testing mempool indexing...")

privKey3 = "cRyrMvvqi1dmpiCmjmmATqjAwo6Wu7QTjKu1ABMYW5aFG4VXW99K"
address3 = "yWB15aAdpeKuSaQHFVJpBDPbNSLZJSnDLA"
addressHash3 = "6C186B3A308A77C779A9BB71C3B5A7EC28232A13".decode("hex")
addressHash3 = bytes.fromhex("6C186B3A308A77C779A9BB71C3B5A7EC28232A13")
scriptPubKey3 = CScript([OP_DUP, OP_HASH160, addressHash3, OP_EQUALVERIFY, OP_CHECKSIG])
# address4 = "2N8oFVB2vThAKury4vnLquW2zVjsYjjAkYQ"
scriptPubKey4 = CScript([OP_HASH160, addressHash3, OP_EQUAL])
unspent = self.nodes[2].listunspent()

tx = CTransaction()
tx.vin = [CTxIn(COutPoint(int(unspent[0]["txid"], 16), unspent[0]["vout"]))]
amount = unspent[0]["amount"] * 100000000
tx.vout = [CTxOut(amount, scriptPubKey3)]
amount = unspent[0]["amount"] * COIN
tx.vout = [CTxOut(int(amount), scriptPubKey3)]
tx.rehash()
signed_tx = self.nodes[2].signrawtransaction(binascii.hexlify(tx.serialize()).decode("utf-8"))
memtxid1 = self.nodes[2].sendrawtransaction(signed_tx["hex"], True)
time.sleep(2)

tx2 = CTransaction()
tx2.vin = [CTxIn(COutPoint(int(unspent[1]["txid"], 16), unspent[1]["vout"]))]
amount = unspent[1]["amount"] * 100000000
amount = unspent[1]["amount"] * COIN
tx2.vout = [
CTxOut(amount / 4, scriptPubKey3),
CTxOut(amount / 4, scriptPubKey3),
CTxOut(amount / 4, scriptPubKey4),
CTxOut(amount / 4, scriptPubKey4)
CTxOut(int(amount / 4), scriptPubKey3),
CTxOut(int(amount / 4), scriptPubKey3),
CTxOut(int(amount / 4), scriptPubKey4),
CTxOut(int(amount / 4), scriptPubKey4)
]
tx2.rehash()
signed_tx2 = self.nodes[2].signrawtransaction(binascii.hexlify(tx2.serialize()).decode("utf-8"))
Expand All @@ -281,7 +281,7 @@ def run_test(self):
CTxIn(COutPoint(int(memtxid2, 16), 0)),
CTxIn(COutPoint(int(memtxid2, 16), 1))
]
tx.vout = [CTxOut(amount / 2 - 10000, scriptPubKey2)]
tx.vout = [CTxOut(int(amount / 2 - 10000), scriptPubKey2)]
tx.rehash()
self.nodes[2].importprivkey(privKey3)
signed_tx3 = self.nodes[2].signrawtransaction(binascii.hexlify(tx.serialize()).decode("utf-8"))
Expand All @@ -298,7 +298,7 @@ def run_test(self):
# sending and receiving to the same address
privkey1 = "cMvZn1pVWntTEcsK36ZteGQXRAcZ8CoTbMXF1QasxBLdnTwyVQCc"
address1 = "yM9Eed1bxjy7tYxD3yZDHxjcVT48WdRoB1"
address1hash = "0909C84A817651502E020AAD0FBCAE5F656E7D8A".decode("hex")
address1hash = bytes.fromhex("0909C84A817651502E020AAD0FBCAE5F656E7D8A")
address1script = CScript([OP_DUP, OP_HASH160, address1hash, OP_EQUALVERIFY, OP_CHECKSIG])

self.nodes[0].sendtoaddress(address1, 10)
Expand All @@ -313,7 +313,7 @@ def run_test(self):
CTxIn(COutPoint(int(utxos[0]["txid"], 16), utxos[0]["outputIndex"]))
]
amount = utxos[0]["satoshis"] - 10000
tx.vout = [CTxOut(amount, address1script)]
tx.vout = [CTxOut(int(amount), address1script)]
tx.rehash()
self.nodes[0].importprivkey(privkey1)
signed_tx = self.nodes[0].signrawtransaction(binascii.hexlify(tx.serialize()).decode("utf-8"))
Expand All @@ -323,7 +323,7 @@ def run_test(self):
mempool_deltas = self.nodes[2].getaddressmempool({"addresses": [address1]})
assert_equal(len(mempool_deltas), 2)

print "Passed\n"
print("Passed\n")


if __name__ == '__main__':
Expand Down
11 changes: 5 additions & 6 deletions qa/rpc-tests/bip65-cltv-p2p.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#

from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
Expand Down Expand Up @@ -67,13 +66,13 @@ def get_tests(self):

self.coinbase_blocks = self.nodes[0].generate(2)
height = 3 # height of the next block to build
self.tip = int ("0x" + self.nodes[0].getbestblockhash() + "L", 0)
self.tip = int("0x" + self.nodes[0].getbestblockhash(), 0)
self.nodeaddress = self.nodes[0].getnewaddress()
self.last_block_time = int(time.time())

''' 98 more version 3 blocks '''
test_blocks = []
for i in xrange(98):
for i in range(98):
block = create_block(self.tip, create_coinbase(height), self.last_block_time + 1)
block.nVersion = 3
block.rehash()
Expand All @@ -86,7 +85,7 @@ def get_tests(self):

''' Mine 749 version 4 blocks '''
test_blocks = []
for i in xrange(749):
for i in range(749):
block = create_block(self.tip, create_coinbase(height), self.last_block_time + 1)
block.nVersion = 4
block.rehash()
Expand Down Expand Up @@ -138,7 +137,7 @@ def get_tests(self):

''' Mine 199 new version blocks on last valid tip '''
test_blocks = []
for i in xrange(199):
for i in range(199):
block = create_block(self.tip, create_coinbase(height), self.last_block_time + 1)
block.nVersion = 4
block.rehash()
Expand Down
Loading