diff --git a/qa/rpc-tests/test_framework/mininode.py b/qa/rpc-tests/test_framework/mininode.py index 280d18f596..3f4a3be9e6 100755 --- a/qa/rpc-tests/test_framework/mininode.py +++ b/qa/rpc-tests/test_framework/mininode.py @@ -28,7 +28,7 @@ import asyncore import time import sys import random -from .util import hex_str_to_bytes, bytes_to_hex_str +from .util import hex_str_to_bytes, bytes_to_hex_str, BITCOIN_ASSET_OUT from io import BytesIO from codecs import encode import hashlib @@ -445,10 +445,14 @@ class CTxOutNonce(object): def __repr__(self): return "CTxOutNonce(vchCommitment=%s)" % self.vchCommitment +# Asset type defaults to bitcoin class CTxOut(object): - def __init__(self, nValue=CTxOutValue(), scriptPubKey=b'', nAsset=CTxOutAsset(), nNonce=CTxOutNonce()): + def __init__(self, nValue=CTxOutValue(), scriptPubKey=b'', nAsset=CTxOutAsset(BITCOIN_ASSET_OUT), nNonce=CTxOutNonce()): self.nAsset = nAsset - self.nValue = nValue + if type(nValue) is int: + self.nValue = CTxOutValue(nValue) + else: + self.nValue = nValue self.nNonce = nNonce self.scriptPubKey = scriptPubKey diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py index 285f3e8cb4..d6cc550324 100644 --- a/qa/rpc-tests/test_framework/util.py +++ b/qa/rpc-tests/test_framework/util.py @@ -28,6 +28,10 @@ from .authproxy import AuthServiceProxy, JSONRPCException COVERAGE_DIR = None +BITCOIN_ASSET = bytearray.fromhex("b2e15d0d7a0c94e4e2ce0fe6e8691b9e451377f6e46e8045a86f7c4b5d4f0f23") +BITCOIN_ASSET.reverse() +BITCOIN_ASSET_OUT = b"\x01"+BITCOIN_ASSET + # The maximum number of nodes a single test can spawn MAX_NODES = 8 # Don't assign rpc or p2p ports lower than this