diff --git a/test/functional/feature_blocksign.py b/test/functional/feature_blocksign.py index e678f020c3..b3603bb5c5 100755 --- a/test/functional/feature_blocksign.py +++ b/test/functional/feature_blocksign.py @@ -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)) diff --git a/test/functional/p2p_blocksonly.py b/test/functional/p2p_blocksonly.py index 12cb06a407..ec35750dc8 100755 --- a/test/functional/p2p_blocksonly.py +++ b/test/functional/p2p_blocksonly.py @@ -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, diff --git a/test/functional/p2p_segwit.py b/test/functional/p2p_segwit.py index deb2f04a68..edb1e9aeb6 100755 --- a/test/functional/p2p_segwit.py +++ b/test/functional/p2p_segwit.py @@ -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,