diff --git a/contrib/assets_tutorial/assets_tutorial.py b/contrib/assets_tutorial/assets_tutorial.py index 3ee3999fbe..9d1f1edeb9 100755 --- a/contrib/assets_tutorial/assets_tutorial.py +++ b/contrib/assets_tutorial/assets_tutorial.py @@ -6,7 +6,7 @@ import argparse import sys from decimal import Decimal -## 0. Boilerplate to make the tutorial executable as a script +# 0. Boilerplate to make the tutorial executable as a script # # Skip ahead to step 1 if you are reading # @@ -44,7 +44,7 @@ e2 = Daemon( not args.no_cleanup, ) -## 1. Start nodes +# 1. Start nodes print ("1. Start nodes") # # 1a. Confirm that we not start an elements node if validatepegin is set and there @@ -132,7 +132,7 @@ sync_all([e1, e2]) assert e1.getblockcount() == 10 assert e1.getbestblockhash() == e2.getbestblockhash() -## 2. Basic wallet usage +# 2. Basic wallet usage print ("") print ("2. Basic wallet usage") @@ -225,7 +225,7 @@ except JSONRPCException: else: raise Exception("Transaction 3 should not be in wallet 1") -## 3. Confidential assets and keys +# 3. Confidential assets and keys print ("") print ("3. Confidential Keys") current_e1_balance = e1.getbalance() @@ -264,7 +264,7 @@ e1.sendtoaddress(e2.getnewaddress(), e1.getbalance()['bitcoin'] / 2, "", "", Tru e1.generatetoaddress(1, e1.getnewaddress()) sync_all([e1, e2]) -## 4. 2-of-2 multisig +# 4. 2-of-2 multisig # # Let's build a blinded 2-of-2 multisig p2sh address print ("") @@ -303,7 +303,7 @@ e2.importblindingkey(blinded_addr, blindingkey) assert e1.gettransaction(txid, True)['details'] != [] assert e2.gettransaction(txid, True)['details'] != [] -## 5. Multi-asset support +# 5. Multi-asset support # # Many of the RPC calls have added asset type or label arguments, and reveal # alternative asset information. With no argument all are listed. For example, @@ -338,7 +338,6 @@ assert len(new_issuances) == 1 assert new_issuances[0]['assetamount'] == 1 assert new_issuances[0]['tokenamount'] == 1 -assert len(e2.listissuances()) == 1 ## ANDREW print ("5b. Reissue the asset using the reissuance token.") # If you gave `issueasset` a reissuance token argument greater than 0 # you can also reissue the base asset. This will appear as a second issuance @@ -449,7 +448,7 @@ sync_all([e1, e2]) e1.generatetoaddress(1, e1.getnewaddress()) sync_all([e1, e2]) -## 6. Blocksigning +# 6. Blocksigning # # Up to now, we have been generating blocks to the default OP_TRUE script. Let's # make this script more interesting. We'll use a 2-of-2 multisig made from keys @@ -561,7 +560,7 @@ sync_all([e1, e2]) assert e1.getblockcount() == 1 assert e2.getblockcount() == 1 -## The peg +# The peg # # Everything peg-related can be done inside the Elements daemon directly, # except for processing pegouts. This is because processing pegouts involves @@ -665,7 +664,7 @@ print ("7e. Request pegout") e1.sendtomainchain(bitcoin.getnewaddress(), 5) -## Exercise(s) +# Exercise(s) # # 1. Implement really dumb/unsafe watchmen to allow pegouts for learning purposes. # To custody the coins that users peg in, you need to extract the tweak from diff --git a/contrib/assets_tutorial/pset_swap_tutorial.py b/contrib/assets_tutorial/pset_swap_tutorial.py index f990648f33..208bec3dd4 100755 --- a/contrib/assets_tutorial/pset_swap_tutorial.py +++ b/contrib/assets_tutorial/pset_swap_tutorial.py @@ -3,10 +3,8 @@ from test_framework.authproxy import JSONRPCException from test_framework.daemon import Daemon, sync_all import argparse -import sys -from decimal import Decimal -## PSET Swap Tutorial +# PSET Swap Tutorial # # This script demonstrates how to implement an atomic swap, using a single # Elements transaction, between two parties, Alice and Carol. Alice has @@ -18,7 +16,7 @@ from decimal import Decimal # going on. # -## 0. Boilerplate to make the tutorial executable as a script +# 0. Boilerplate to make the tutorial executable as a script # # Skip ahead to step 1 if you are reading # @@ -47,7 +45,7 @@ carol = Daemon( not args.no_cleanup, ) -## 1. Start nodes +# 1. Start nodes print ("1. Start nodes and setup scenario") # 1a. Turn on both nodes. Disable -validatepegin as we will just swap the @@ -92,7 +90,7 @@ asset_BTC = alice.dumpassetlabels()["bitcoin"] assert len(alice.listunspent()) > 0 assert len(carol.listunspent()) > 0 -## 2. Construct a swap transaction in PSET format +# 2. Construct a swap transaction in PSET format # # At this point node `alice` has 10.5MM "bitcoin" and node `carol` has 1000 of # a new asset. We want to do an atomic swap: 2500 BTC for 1000 of @@ -119,7 +117,7 @@ carol_addr = carol.getnewaddress() print (" Alice: ", alice_addr) print (" Carol: ", carol_addr) -# Then they each create and fund (but don't sign!) partial transactions +# Then they each create and fund (but don't sign!) partial transactions # which simply send the assets to each other. print ("2b. Exchange partial transaction data") raw_tx_a = alice.createrawtransaction(outputs=[{carol_addr: 2500}]) @@ -148,12 +146,12 @@ for output in decoded_a["vout"]: assert feerate > 0.1 # should probably compare against your own feerate assert found_my_output -## -## Check that none of the inputs in the counterparty's transaction actually -## belong to us. This is the second-most important check (after making sure -## that your outputs are present :)) and by far the easiest to forget. Do -## not forget this!!! -## +# +# Check that none of the inputs in the counterparty's transaction actually +# belong to us. This is the second-most important check (after making sure +# that your outputs are present :)) and by far the easiest to forget. Do +# not forget this!!! +# # The way we do this check in Python is by making a set of each # output the wallet can spend... @@ -235,7 +233,7 @@ assert not any([x["has_utxo"] for x in analysis["inputs"]]) assert not any([x["is_final"] for x in analysis["inputs"]]) assert all([x["next"] == "updater" for x in analysis["inputs"]]) -## 3. Update the PSET +# 3. Update the PSET # # Before blinding can take place, both parties need to provide UTXO data # for their inputs. They can share this data by either updating the PSET @@ -258,7 +256,7 @@ assert all([x["has_utxo"] for x in analysis["inputs"]]) assert not any([x["is_final"] for x in analysis["inputs"]]) assert all([x["next"] == "signer" for x in analysis["inputs"]]) -## 4. Blind the PSET +# 4. Blind the PSET # # Both parties now blind the PSET. Importantly, the final person to blind must # have a combined PSET that has everyone else's blinding data included, so that @@ -314,7 +312,7 @@ assert all([x["has_utxo"] for x in analysis["inputs"]]) assert not any([x["is_final"] for x in analysis["inputs"]]) assert all([x["next"] == "signer" for x in analysis["inputs"]]) -## 5. Sign the PSET +# 5. Sign the PSET # # When signing, there are a couple options for workflows. Each party can sign # in turn, like we did when blinding, or they can each sign independently and diff --git a/contrib/assets_tutorial/test_framework/daemon.py b/contrib/assets_tutorial/test_framework/daemon.py index 18ccf9a3ff..4a2af67975 100644 --- a/contrib/assets_tutorial/test_framework/daemon.py +++ b/contrib/assets_tutorial/test_framework/daemon.py @@ -1,7 +1,6 @@ from test_framework.authproxy import AuthServiceProxy -import pathlib import tempfile import time import shutil @@ -41,7 +40,7 @@ class Daemon(): if self.proc is not None: print ("Shutting down %s" % self.name) self.proc.terminate() - ## FIXME determine why we need 30+ seconds to shut down with a tiny regtest chain + # FIXME determine why we need 30+ seconds to shut down with a tiny regtest chain self.proc.wait(120) self.proc = None @@ -92,8 +91,6 @@ class Daemon(): return self.config[key] def sync_all(nodes, timeout_sec = 10): - totalWait = timeout_sec - stop_time = time.time() + timeout_sec while time.time() <= stop_time: best_hash = [x.getbestblockhash() for x in nodes] diff --git a/test/functional/data/invalid_txs.py b/test/functional/data/invalid_txs.py index 7d0d64b156..960eb9452f 100644 --- a/test/functional/data/invalid_txs.py +++ b/test/functional/data/invalid_txs.py @@ -49,7 +49,7 @@ from test_framework.script import ( # OP_RIGHT, # OP_RSHIFT, # OP_SUBSTR, - OP_TRUE, +# OP_TRUE, # OP_XOR, ) from test_framework.script_util import ( diff --git a/test/functional/feature_fedpeg.py b/test/functional/feature_fedpeg.py index 0cfaebf5e4..e92be840aa 100755 --- a/test/functional/feature_fedpeg.py +++ b/test/functional/feature_fedpeg.py @@ -20,7 +20,6 @@ from test_framework.messages import ( COIN, CBlock, COutPoint, - CTransaction, CTxIn, CTxInWitness, CTxOut, diff --git a/test/functional/feature_issuance.py b/test/functional/feature_issuance.py index 03e0532986..24a9971010 100755 --- a/test/functional/feature_issuance.py +++ b/test/functional/feature_issuance.py @@ -482,7 +482,7 @@ class IssuanceTest(BitcoinTestFramework): self.nodes[0].generate(1) assert_equal(self.nodes[0].gettransaction(tx_id)["confirmations"], 1) - ## Regression for one form of https://github.com/bitcoin/bitcoin/issues/20347 + # Regression for one form of https://github.com/bitcoin/bitcoin/issues/20347 # 1. Leave node 1 with only a single small explicit output self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), self.nodes[1].getbalance()['bitcoin'], "", "", True) blind_addr = self.nodes[1].getnewaddress() @@ -497,8 +497,7 @@ class IssuanceTest(BitcoinTestFramework): # in the 3-output case. As the bug causes us to do coin selection for # the former while attempting to produce the latter, we will trigger # an "impossible" case and a confusing/generic error message. - txid = self.nodes[1].issueasset(0, 1, False)["txid"] - tx = self.nodes[1].getrawtransaction(txid, True) + self.nodes[1].issueasset(0, 1, False)["txid"] if __name__ == '__main__': IssuanceTest ().main () diff --git a/test/functional/feature_taphash_pegins_issuances.py b/test/functional/feature_taphash_pegins_issuances.py index 5c55cfa604..dbcba17c68 100755 --- a/test/functional/feature_taphash_pegins_issuances.py +++ b/test/functional/feature_taphash_pegins_issuances.py @@ -6,9 +6,9 @@ # # Test for taproot sighash algorithm with pegins and issuances -from test_framework.key import ECKey, ECPubKey, compute_xonly_pubkey, generate_privkey, sign_schnorr, tweak_add_privkey, tweak_add_pubkey, verify_schnorr -from test_framework.messages import COIN, COutPoint, CTransaction, CTxIn, CTxInWitness, CTxOut, CTxOutValue, CTxOutWitness, tx_from_hex, uint256_from_str -from test_framework.test_framework import BitcoinTestFramework, SkipTest +from test_framework.key import compute_xonly_pubkey, generate_privkey, sign_schnorr, tweak_add_privkey, tweak_add_pubkey, verify_schnorr +from test_framework.messages import COutPoint, CTxIn, CTxInWitness, CTxOut, CTxOutValue, CTxOutWitness, tx_from_hex, uint256_from_str +from test_framework.test_framework import BitcoinTestFramework from test_framework.script import TaprootSignatureHash, taproot_construct, taproot_pad_sighash_ty, SIGHASH_DEFAULT, SIGHASH_ALL, SIGHASH_NONE, SIGHASH_SINGLE, SIGHASH_ANYONECANPAY VALID_SIGHASHES_ECDSA = [ @@ -77,7 +77,7 @@ class TapHashPeginTest(BitcoinTestFramework): tx = self.nodes[0].blindrawtransaction(fund_tx.serialize().hex()) signed_raw_tx = self.nodes[0].signrawtransactionwithwallet(tx) - _txid = self.nodes[0].sendrawtransaction(signed_raw_tx['hex']) + self.nodes[0].sendrawtransaction(signed_raw_tx['hex']) tx = tx_from_hex(signed_raw_tx['hex']) tx.rehash() self.nodes[0].generate(1) diff --git a/test/functional/feature_tapscript_opcodes.py b/test/functional/feature_tapscript_opcodes.py index c9a51ce135..2096e08469 100755 --- a/test/functional/feature_tapscript_opcodes.py +++ b/test/functional/feature_tapscript_opcodes.py @@ -8,10 +8,10 @@ from random import randint from test_framework.util import BITCOIN_ASSET_BYTES, assert_raises_rpc_error, satoshi_round -from test_framework.key import ECKey, ECPubKey, compute_xonly_pubkey, generate_privkey, sign_schnorr, tweak_add_privkey, tweak_add_pubkey, verify_schnorr -from test_framework.messages import COIN, COutPoint, CTransaction, CTxIn, CTxInWitness, CTxOut, CTxOutNonce, CTxOutValue, CTxOutWitness, ser_uint256, sha256, tx_from_hex, uint256_from_str +from test_framework.key import ECKey, compute_xonly_pubkey, generate_privkey, sign_schnorr +from test_framework.messages import COIN, COutPoint, CTransaction, CTxIn, CTxInWitness, CTxOut, CTxOutNonce, CTxOutValue, ser_uint256, sha256, tx_from_hex from test_framework.test_framework import BitcoinTestFramework -from test_framework.script import CScript, CScriptNum, CScriptOp, OP_0, OP_1, OP_2, OP_3, OP_4, OP_5, OP_6, OP_7, OP_ADD64, OP_AND, OP_CAT, OP_CHECKSIGFROMSTACK, OP_DIV64, OP_DROP, OP_DUP, OP_ECMULSCALARVERIFY, OP_ELSE, OP_EQUAL, OP_EQUALVERIFY, OP_FALSE, OP_FROMALTSTACK, OP_GREATERTHAN64, OP_GREATERTHANOREQUAL64, OP_INSPECTINPUTASSET, OP_INSPECTINPUTISSUANCE, OP_INSPECTINPUTOUTPOINT, OP_INSPECTINPUTSCRIPTPUBKEY, OP_INSPECTINPUTSEQUENCE, OP_INSPECTINPUTVALUE, OP_INSPECTLOCKTIME, OP_INSPECTNUMINPUTS, OP_INSPECTNUMOUTPUTS, OP_INSPECTOUTPUTASSET, OP_INSPECTOUTPUTNONCE, OP_INSPECTOUTPUTSCRIPTPUBKEY, OP_INSPECTOUTPUTVALUE, OP_IF, OP_INSPECTVERSION, OP_LE32TOLE64, OP_LE64TOSCRIPTNUM, OP_LESSTHAN64, OP_LESSTHANOREQUAL64, OP_MUL64, OP_NEG64, OP_NOT, OP_INVERT, OP_NOTIF, OP_OR, OP_PUSHCURRENTINPUTINDEX, OP_SCRIPTNUMTOLE64, OP_SHA256FINALIZE, OP_SHA256INITIALIZE, OP_SHA256UPDATE, OP_SIZE, OP_SUB64, OP_SWAP, OP_TWEAKVERIFY, OP_TOALTSTACK, OP_TXWEIGHT, OP_VERIFY, OP_XOR, OP_XOR, TaprootSignatureHash, taproot_construct, SIGHASH_DEFAULT, SIGHASH_ALL, SIGHASH_NONE, SIGHASH_SINGLE, SIGHASH_ANYONECANPAY +from test_framework.script import CScript, CScriptNum, CScriptOp, OP_0, OP_1, OP_2, OP_ADD64, OP_AND, OP_CHECKSIGFROMSTACK, OP_DIV64, OP_DROP, OP_DUP, OP_ECMULSCALARVERIFY, OP_EQUAL, OP_EQUALVERIFY, OP_FALSE, OP_FROMALTSTACK, OP_GREATERTHAN64, OP_GREATERTHANOREQUAL64, OP_INSPECTINPUTASSET, OP_INSPECTINPUTISSUANCE, OP_INSPECTINPUTOUTPOINT, OP_INSPECTINPUTSCRIPTPUBKEY, OP_INSPECTINPUTSEQUENCE, OP_INSPECTINPUTVALUE, OP_INSPECTLOCKTIME, OP_INSPECTNUMINPUTS, OP_INSPECTNUMOUTPUTS, OP_INSPECTOUTPUTASSET, OP_INSPECTOUTPUTNONCE, OP_INSPECTOUTPUTSCRIPTPUBKEY, OP_INSPECTOUTPUTVALUE, OP_INSPECTVERSION, OP_LE32TOLE64, OP_LE64TOSCRIPTNUM, OP_LESSTHAN64, OP_LESSTHANOREQUAL64, OP_MUL64, OP_NEG64, OP_NOT, OP_INVERT, OP_OR, OP_PUSHCURRENTINPUTINDEX, OP_SCRIPTNUMTOLE64, OP_SHA256FINALIZE, OP_SHA256INITIALIZE, OP_SHA256UPDATE, OP_SIZE, OP_SUB64, OP_SWAP, OP_TWEAKVERIFY, OP_TOALTSTACK, OP_TXWEIGHT, OP_VERIFY, OP_XOR, taproot_construct, SIGHASH_DEFAULT, SIGHASH_ALL, SIGHASH_NONE, SIGHASH_SINGLE, SIGHASH_ANYONECANPAY import os @@ -93,7 +93,7 @@ class TapHashPeginTest(BitcoinTestFramework): tx = self.nodes[0].blindrawtransaction(fund_tx.serialize().hex()) signed_raw_tx = self.nodes[0].signrawtransactionwithwallet(tx) - _txid = self.nodes[0].sendrawtransaction(signed_raw_tx['hex']) + self.nodes[0].sendrawtransaction(signed_raw_tx['hex']) tx = tx_from_hex(signed_raw_tx['hex']) tx.rehash() self.nodes[0].generate(1) @@ -102,11 +102,13 @@ class TapHashPeginTest(BitcoinTestFramework): return tx, prev_vout, spk, sec, pub, tap - def tapscript_satisfy_test(self, script, inputs = [], add_issuance = False, - add_pegin = False, fail=None, add_prevout=False, add_asset=False, - add_value=False, add_spk = False, seq = 0, add_out_spk = None, - add_out_asset = None, add_out_value = None, add_out_nonce = None, - ver = 2, locktime = 0, add_num_outputs=False, add_weight=False, blind=False): + def tapscript_satisfy_test(self, script, inputs = None, add_issuance = False, + add_pegin = False, fail=None, add_prevout=False, add_asset=False, + add_value=False, add_spk = False, seq = 0, add_out_spk = None, + add_out_asset = None, add_out_value = None, add_out_nonce = None, + ver = 2, locktime = 0, add_num_outputs=False, add_weight=False, blind=False): + if inputs is None: + inputs = [] # Create a taproot utxo scripts = [("s0", script)] prev_tx, prev_vout, spk, sec, pub, tap = self.create_taproot_utxo(scripts) @@ -387,20 +389,28 @@ class TapHashPeginTest(BitcoinTestFramework): def check_add(a, b, c, fail=None): self.tapscript_satisfy_test(CScript([OP_ADD64, OP_VERIFY, le8(c), OP_EQUAL]), inputs = [le8(a), le8(b)], fail=fail) + def check_sub(a, b, c, fail=None): self.tapscript_satisfy_test(CScript([OP_SUB64, OP_VERIFY, le8(c), OP_EQUAL]), inputs = [le8(a), le8(b)], fail=fail) + def check_mul(a, b, c, fail=None): self.tapscript_satisfy_test(CScript([OP_MUL64, OP_VERIFY, le8(c), OP_EQUAL]), inputs = [le8(a), le8(b)], fail=fail) + def check_div(a, b, q, r, fail=None): self.tapscript_satisfy_test(CScript([OP_DIV64, OP_VERIFY, le8(q), OP_EQUALVERIFY, le8(r), OP_EQUAL]), inputs = [le8(a), le8(b)], fail=fail) + def check_le(a, b, res, fail=None): self.tapscript_satisfy_test(CScript([OP_LESSTHAN64, res, OP_EQUAL]), inputs = [le8(a), le8(b)], fail=fail) + def check_leq(a, b, res, fail=None): self.tapscript_satisfy_test(CScript([OP_LESSTHANOREQUAL64, res, OP_EQUAL]), inputs = [le8(a), le8(b)], fail=fail) + def check_ge(a, b, res, fail=None): self.tapscript_satisfy_test(CScript([OP_GREATERTHAN64, res, OP_EQUAL]), inputs = [le8(a), le8(b)], fail=fail) + def check_geq(a, b, res, fail=None): self.tapscript_satisfy_test(CScript([OP_GREATERTHANOREQUAL64, res, OP_EQUAL]), inputs = [le8(a), le8(b)], fail=fail) + def check_neg(a, res, fail=None): self.tapscript_satisfy_test(CScript([OP_NEG64, OP_VERIFY, le8(res), OP_EQUAL]), inputs = [le8(a)], fail=fail) # Arithematic opcodes diff --git a/test/functional/rpc_invalid_address_message.py b/test/functional/rpc_invalid_address_message.py index 0305ac5d3e..c2429d2c00 100755 --- a/test/functional/rpc_invalid_address_message.py +++ b/test/functional/rpc_invalid_address_message.py @@ -24,7 +24,7 @@ BASE58_INVALID_PREFIX = '17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhem' INVALID_ADDRESS = 'asfah14i8fajz0123f' -## ELEMENTS +# ELEMENTS BLECH32_VALID = 'el1qq0umk3pez693jrrlxz9ndlkuwne93gdu9g83mhhzuyf46e3mdzfpva0w48gqgzgrklncnm0k5zeyw8my2ypfsmxh4xcjh2rse' BLECH32_INVALID_BLECH32 = 'el1pq0umk3pez693jrrlxz9ndlkuwne93gdu9g83mhhzuyf46e3mdzfpva0w48gqgzgrklncnm0k5zeyw8my2ypfsxguu9nrdg2pc' BLECH32_INVALID_BLECH32M = 'el1qq0umk3pez693jrrlxz9ndlkuwne93gdu9g83mhhzuyf46e3mdzfpva0w48gqgzgrklncnm0k5zeyw8my2ypfsnnmzrstzt7de' @@ -84,7 +84,7 @@ class InvalidAddressErrorMessageTest(BitcoinTestFramework): assert not info['isvalid'] assert_equal(info['error'], 'Invalid address format') - ## ELEMENTS + # ELEMENTS info = node.validateaddress(BLECH32_INVALID_SIZE) assert not info['isvalid'] assert_equal(info['error'], 'Invalid Blech32 address data size') @@ -116,7 +116,7 @@ class InvalidAddressErrorMessageTest(BitcoinTestFramework): assert_raises_rpc_error(-5, "Invalid address format", node.getaddressinfo, INVALID_ADDRESS) - ## ELEMENTS + # ELEMENTS assert_raises_rpc_error(-5, "Invalid Blech32 address data size", node.getaddressinfo, BLECH32_INVALID_SIZE) assert_raises_rpc_error(-5, "Invalid prefix for Blech32 address", node.getaddressinfo, BLECH32_INVALID_PREFIX) diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py index c2bc1cf7d9..f25ee94454 100755 --- a/test/functional/rpc_psbt.py +++ b/test/functional/rpc_psbt.py @@ -561,7 +561,7 @@ class PSBTTest(BitcoinTestFramework): self.sync_mempools() assert_raises_rpc_error(-4, "Insufficient funds", wunsafe.walletcreatefundedpsbt, [], [{self.nodes[0].getnewaddress(): 1}]) wunsafe.walletcreatefundedpsbt([], [{self.nodes[0].getnewaddress(): 1}], 0, {"include_unsafe": True}) - + # BIP 174 tests are disabled because they don't work with CA yet. Comment the function so it doesn't flag lint as unused. """ @@ -649,7 +649,7 @@ class PSBTTest(BitcoinTestFramework): psbt = self.nodes[0].createpsbt([{"txid": txid_nonconf, "vout": 0}], [{unconf_addr_2: 49.999}, {"fee": 0.001}]) psbt = self.nodes[0].walletprocesspsbt(psbt)["psbt"] tx_hex = self.nodes[0].finalizepsbt(psbt)['hex'] - txid_nonconf_2 = self.nodes[0].sendrawtransaction(tx_hex) + self.nodes[0].sendrawtransaction(tx_hex) self.nodes[0].generate(1) self.sync_all() @@ -825,7 +825,7 @@ class PSBTTest(BitcoinTestFramework): BAD_ASSET_PROOF = "cHNldP8BAgQCAAAAAQMEAAAAAAEEAQEBBQECAfsEAgAAAAABAP1UAQIAAAAAASopobdl5W15RSedscp/8bxEXKuKIMOZw+JTqgD8qJEKBAAAAAD9////Awrye7Xu4kI5VnpTDeGaq8sYdXP3qdzYaHrLDRzaC8y51ggl1U8hJxSo+8GcTzHv926wsqTTkOrdBnJo8qcLwLQauQKktt71EJU7HTH5HsgG4kJV/tC32F992/WgieIPRkUkmxYAFPrs/iioimRS5hoJKl/hua83d7rwC1uuuLvfuQh38wHS+0Vg2ecXzypsUabYofOFaGSrICByCKvjgTF6TdHNp2el7Cwi+94dy4qMDrEh/25Aqnc+5qABAqWPEY9ZNCz7m64pANrr04bVgPxaWCr7LvvWGH5FLzvRFgAU96wAzcLFRah7B8gq17sVY9Uso18BIw9PXUt8b6hFgG7k9ncTRZ4baejmD87i5JQMeg1d4bIBAAAAAAAAKfQAAAAAAAABAXoK8nu17uJCOVZ6Uw3hmqvLGHVz96nc2Gh6yw0c2gvMudYIJdVPIScUqPvBnE8x7/dusLKk05Dq3QZyaPKnC8C0GrkCpLbe9RCVOx0x+R7IBuJCVf7Qt9hffdv1oIniD0ZFJJsWABT67P4oqIpkUuYaCSpf4bmvN3e68CIGA3pgD7iheh1WkyCWvviXQBa9KOJk6JBeYxEpPuxiRBOvEElHIxkAAACAAQAAgAMAAIABDiB25bQww62kp1L1uQVb7MxEVoem8kCzSmM5DW09I9V6DQEPBAAAAAABEAT/////B/wEcHNldA79CwFgAgAHY7+9IRzxAXWemL7C9M7CBAqQoSrXRoxI5/YnMLV6nV/GBMEhmvoDFJcNzRXI/LrIRMLZFvNrP5IupN8OZ+4q+++aJTnuYCZIDR1pssb0JHA0z2UXkEYdHv26qoW26RbLf2LNh29yVIOHG3jqqc7+L7F4UELZmjlEs6R1sulqQ0ePCUUgAsqURkdnNKtl0nORiyLN/9JfqG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zlXlMw4QVZNMBwXakH/ARwc2V0ByECK0ZVsb9tk1xXaJ+OKa6HTgU7BGXE2s0+9rrpTr9GIcUH/ARwc2V0CAQAAAAAAAEEAAEDCADh9QUAAAAAB/wEcHNldAIgIw9PXUt8b6hFgG7k9ncTRZ4baejmD87i5JQMeg1d4bIH/ARwc2V0CAQAAAAAAA==" - ## Check warnings for PSETs + # Check warnings for PSETs stats = [output.get("status") for output in self.nodes[0].decodepsbt(UNBLINDED)["outputs"]] assert_equal(stats, ["needs blinding", None]) stats = [output for output in self.nodes[0].analyzepsbt(UNBLINDED)["outputs"]] diff --git a/test/functional/rpc_rawtransaction.py b/test/functional/rpc_rawtransaction.py index c85c603db6..62bd939728 100755 --- a/test/functional/rpc_rawtransaction.py +++ b/test/functional/rpc_rawtransaction.py @@ -12,7 +12,6 @@ Test the following RPCs: - getrawtransaction """ -from collections import OrderedDict from decimal import Decimal from test_framework.blocktools import COINBASE_MATURITY diff --git a/test/functional/wallet_fallbackfee.py b/test/functional/wallet_fallbackfee.py index dd4d569104..ddd2697e3f 100755 --- a/test/functional/wallet_fallbackfee.py +++ b/test/functional/wallet_fallbackfee.py @@ -29,7 +29,7 @@ class WalletRBFTest(BitcoinTestFramework): assert_raises_rpc_error(-4, "Fee estimation failed", lambda: self.nodes[0].fundrawtransaction(self.nodes[0].createrawtransaction([], [{self.nodes[0].getnewaddress(): 1}]))) assert_raises_rpc_error(-6, "Fee estimation failed", lambda: self.nodes[0].sendmany("", {self.nodes[0].getnewaddress(): 1})) - ## ELEMENTS: test claimpegin with fallback fee set to zero + # ELEMENTS: test claimpegin with fallback fee set to zero # getpeginaddress does not work with descriptor wallets yet if not self.options.descriptors: extra_args = [