wip fix functional tests

This commit is contained in:
Steven Roose 2019-08-21 15:28:46 +01:00
parent 6e4c233426
commit 0d33dcd4d5
No known key found for this signature in database
GPG key ID: 2F2A88D7F8D68E87
3 changed files with 8 additions and 8 deletions

View file

@ -23,7 +23,7 @@ def make_signblockscript(num_nodes, required_signers, keys):
for i in range(num_nodes):
k = keys[i]
script += "41"
script += codecs.encode(k.get_pubkey(), 'hex_codec').decode("utf-8")
script += k.get_pubkey().get_bytes().hex()
script += "{}".format(50 + num_nodes) # num keys
script += "ae" # OP_CHECKMULTISIG
print('signblockscript', script)
@ -55,13 +55,13 @@ class BlockSignTest(BitcoinTestFramework):
self.keys = []
self.wifs = []
for i in range(num_keys):
k = key.CECKey()
k = key.ECKey()
pk_bytes = hashlib.sha256(str(random.getrandbits(256)).encode('utf-8')).digest()
k.set_secretbytes(pk_bytes)
#k.set_secretbytes(pk_bytes)
k.set(pk_bytes, True)
w = wif(pk_bytes)
print("generated key {}: \n pub: {}\n wif: {}".format(i+1,
codecs.encode(k.get_pubkey(), 'hex_codec').decode("utf-8"),
w))
print("generated key {}: \n pub: {}\n wif: {}".format(
i+1, k.get_pubkey().get_bytes().hex(), w))
self.keys.append(k)
self.wifs.append(wif(pk_bytes))

View file

@ -28,7 +28,7 @@ class P2PBlocksOnly(BitcoinTestFramework):
}],
outputs=[{
self.nodes[0].get_deterministic_priv_key().address: 50 - 0.00125
}],
}, {"fee": 0.00125}],
)
sigtx = self.nodes[0].signrawtransactionwithkey(
hexstring=rawtx,

View file

@ -10,7 +10,7 @@ import struct
import time
from test_framework.blocktools import create_block, create_coinbase, add_witness_commitment, WITNESS_COMMITMENT_HEADER
from test_framework.key import ECKey, CPubKey
from test_framework.key import ECKey, ECPubKey
from test_framework.messages import (
COIN,
BIP125_SEQUENCE_NUMBER,