diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2019-08-25 21:49:49 +0000 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2019-08-26 10:45:25 +0000 |
commit | 25dd86715039586d92176eee16e9c6644d2547f0 (patch) | |
tree | 933ff753d30eee49f9364df1b0daea9f8bff4a2e | |
parent | e00ecb3d7aaee463643e486ca03c318e192b8058 (diff) | |
download | bitcoin-25dd86715039586d92176eee16e9c6644d2547f0.tar.xz |
Avoid using mutable default parameter values
-rwxr-xr-x | test/functional/test_framework/messages.py | 4 | ||||
-rwxr-xr-x | test/functional/wallet_importmulti.py | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py index 89a5a65e64..917efaa833 100755 --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -803,7 +803,9 @@ class HeaderAndShortIDs: return [ key0, key1 ] # Version 2 compact blocks use wtxid in shortids (rather than txid) - def initialize_from_block(self, block, nonce=0, prefill_list = [0], use_witness = False): + def initialize_from_block(self, block, nonce=0, prefill_list=None, use_witness=False): + if prefill_list is None: + prefill_list = [0] self.header = CBlockHeader(block) self.nonce = nonce self.prefilled_txn = [ PrefilledTransaction(i, block.vtx[i]) for i in prefill_list ] diff --git a/test/functional/wallet_importmulti.py b/test/functional/wallet_importmulti.py index e4a4ab1f35..23748e5dd7 100755 --- a/test/functional/wallet_importmulti.py +++ b/test/functional/wallet_importmulti.py @@ -44,8 +44,10 @@ class ImportMultiTest(BitcoinTestFramework): def setup_network(self): self.setup_nodes() - def test_importmulti(self, req, success, error_code=None, error_message=None, warnings=[]): + def test_importmulti(self, req, success, error_code=None, error_message=None, warnings=None): """Run importmulti and assert success""" + if warnings is None: + warnings = [] result = self.nodes[1].importmulti([req]) observed_warnings = [] if 'warnings' in result[0]: |