Skip to content

Commit 25dd867

Browse files
Avoid using mutable default parameter values
1 parent e00ecb3 commit 25dd867

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

test/functional/test_framework/messages.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,9 @@ def get_siphash_keys(self):
803803
return [ key0, key1 ]
804804

805805
# Version 2 compact blocks use wtxid in shortids (rather than txid)
806-
def initialize_from_block(self, block, nonce=0, prefill_list = [0], use_witness = False):
806+
def initialize_from_block(self, block, nonce=0, prefill_list=None, use_witness=False):
807+
if prefill_list is None:
808+
prefill_list = [0]
807809
self.header = CBlockHeader(block)
808810
self.nonce = nonce
809811
self.prefilled_txn = [ PrefilledTransaction(i, block.vtx[i]) for i in prefill_list ]

test/functional/wallet_importmulti.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ def skip_test_if_missing_module(self):
4444
def setup_network(self):
4545
self.setup_nodes()
4646

47-
def test_importmulti(self, req, success, error_code=None, error_message=None, warnings=[]):
47+
def test_importmulti(self, req, success, error_code=None, error_message=None, warnings=None):
4848
"""Run importmulti and assert success"""
49+
if warnings is None:
50+
warnings = []
4951
result = self.nodes[1].importmulti([req])
5052
observed_warnings = []
5153
if 'warnings' in result[0]:

0 commit comments

Comments
 (0)