Skip to content

Commit 4ed0bb3

Browse files
committed
Fix dead-code linter issues
1 parent dc900eb commit 4ed0bb3

10 files changed

+30
-34
lines changed

test/functional/feature_confidential_transactions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def setup_network(self, split=False):
4242
connect_nodes_bi(self.nodes, 0, 1)
4343
connect_nodes_bi(self.nodes, 1, 2)
4444
connect_nodes_bi(self.nodes, 0, 2)
45-
self.is_network_split = False
4645
self.sync_all()
4746

4847
def skip_test_if_missing_module(self):

test/functional/feature_default_asset_name.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def set_test_params(self):
2626
def setup_network(self, split=False):
2727
self.setup_nodes()
2828
connect_nodes_bi(self.nodes, 0, 1)
29-
self.is_network_split = False
3029
self.sync_all()
3130

3231
def skip_test_if_missing_module(self):

test/functional/feature_initial_reissuance_token.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ def skip_test_if_missing_module(self):
2929
def setup_network(self, split=False):
3030
self.setup_nodes()
3131
connect_nodes_bi(self.nodes, 0, 1)
32-
self.is_network_split = False
3332
self.sync_all()
3433

3534
def run_test(self):

test/functional/feature_issuance.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def setup_network(self, split=False):
101101
self.setup_nodes()
102102
connect_nodes_bi(self.nodes, 0, 1)
103103
connect_nodes_bi(self.nodes, 1, 2)
104-
self.is_network_split = False
105104
self.sync_all()
106105

107106
def run_test(self):

test/functional/feature_mandatory_coinbase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
mandatory_privkey = "cQ2nfMkghhdEgRQwcfJmTb6XSenfLRmngpLmWuEBAJnepnKMfznH"
1616
mandatory_address = "XP3bwB9jSxt58frSa3cJismgGL3F57ukUy"
17-
mandatory_pubkey = "024f0c5cdb8f31d7395bcc83f6adc46f292f6555eca2d24dfa581c3b0845778b2b"
17+
#mandatory_pubkey = "024f0c5cdb8f31d7395bcc83f6adc46f292f6555eca2d24dfa581c3b0845778b2b"
1818
mandatory_script = "a914804b9fd9d6939c2e960b7aa31124a5d532f4e59c87"
1919

2020
def b2x(b):

test/functional/feature_pak.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def run_test(self):
6565
# This function tests the result of the getpakinfo RPC.
6666
# *_pak is either False (undefined paklist), "reject" or a list of
6767
# (online, offline) tuples
68-
def test_pak(node, config_pak, block_pak, validate):
68+
def test_pak(node, config_pak, block_pak):
6969
getpakinfo = node.getpakinfo()
7070

7171
def compare(actual, expected):
@@ -85,11 +85,11 @@ def compare(actual, expected):
8585
compare(getpakinfo['block_paklist'], block_pak)
8686

8787
# In the beginning the blockchain paklist is "reject"
88-
test_pak(self.nodes[i_novalidate], pak1, "reject", False)
89-
test_pak(self.nodes[i_undefined], False, "reject", True)
90-
test_pak(self.nodes[i_pak1], pak1, "reject", True)
91-
test_pak(self.nodes[i_pak2], pak2, "reject", True)
92-
test_pak(self.nodes[i_reject], "reject", "reject", True)
88+
test_pak(self.nodes[i_novalidate], pak1, "reject")
89+
test_pak(self.nodes[i_undefined], False, "reject")
90+
test_pak(self.nodes[i_pak1], pak1, "reject")
91+
test_pak(self.nodes[i_pak2], pak2, "reject")
92+
test_pak(self.nodes[i_reject], "reject", "reject")
9393

9494
# i_novalidate creates block without a commitment
9595
block_proposal = self.nodes[i_novalidate].getnewblockhex()
@@ -121,11 +121,11 @@ def compare(actual, expected):
121121
# Submit block with commitment to pak1 and check each node's state.
122122
self.nodes[i_undefined].submitblock(block_proposal)
123123
self.sync_all()
124-
test_pak(self.nodes[i_novalidate], pak1, pak1, False)
125-
test_pak(self.nodes[i_undefined], False, pak1, True)
126-
test_pak(self.nodes[i_pak1], pak1, pak1, True)
127-
test_pak(self.nodes[i_pak2], pak2, pak1, True)
128-
test_pak(self.nodes[i_reject], "reject", pak1, True)
124+
test_pak(self.nodes[i_novalidate], pak1, pak1)
125+
test_pak(self.nodes[i_undefined], False, pak1)
126+
test_pak(self.nodes[i_pak1], pak1, pak1)
127+
test_pak(self.nodes[i_pak2], pak2, pak1)
128+
test_pak(self.nodes[i_reject], "reject", pak1)
129129
# Check that another block by i_pak1 (without a commitment) is valid to
130130
# i_pak1 but invalid to i_pak2 and i_reject
131131
block_proposal = self.nodes[i_undefined].getnewblockhex()
@@ -150,11 +150,11 @@ def compare(actual, expected):
150150
# Submit "reject" block and check state.
151151
self.nodes[i_undefined].submitblock(block_proposal)
152152
self.sync_all()
153-
test_pak(self.nodes[i_novalidate], pak1, "reject", False)
154-
test_pak(self.nodes[i_undefined], False, "reject", True)
155-
test_pak(self.nodes[i_pak1], pak1, "reject", True)
156-
test_pak(self.nodes[i_pak2], pak2, "reject", True)
157-
test_pak(self.nodes[i_reject], "reject", "reject", True)
153+
test_pak(self.nodes[i_novalidate], pak1, "reject")
154+
test_pak(self.nodes[i_undefined], False, "reject")
155+
test_pak(self.nodes[i_pak1], pak1, "reject")
156+
test_pak(self.nodes[i_pak2], pak2, "reject")
157+
test_pak(self.nodes[i_reject], "reject", "reject")
158158
# Check that another block by i_reject (without a commitment) is valid to i_reject.
159159
block_proposal = self.nodes[i_reject].getnewblockhex()
160160
assert_equal(self.nodes[i_reject].testproposedblock(block_proposal), None)
@@ -182,7 +182,7 @@ def compare(actual, expected):
182182
connect_nodes_bi(self.nodes,3,4)
183183

184184
# Check current state of i_pak1
185-
test_pak(self.nodes[i_pak1], pak2, "reject", True)
185+
test_pak(self.nodes[i_pak1], pak2, "reject")
186186
# Create a new block with i_pak1 which should have a commitment to pak2
187187
# and check that it's correctly rejected or accepted.
188188
block_proposal = self.nodes[i_pak1].getnewblockhex()
@@ -196,11 +196,11 @@ def compare(actual, expected):
196196
# Submit block with commitment to pak2 and check state.
197197
self.nodes[i_pak1].submitblock(block_proposal)
198198
self.sync_all()
199-
test_pak(self.nodes[i_novalidate], "reject", pak2, False)
200-
test_pak(self.nodes[i_undefined], False, pak2, True)
201-
test_pak(self.nodes[i_pak1], pak2, pak2, True)
202-
test_pak(self.nodes[i_pak2], pak2, pak2, True)
203-
test_pak(self.nodes[i_reject], "reject", pak2, True)
199+
test_pak(self.nodes[i_novalidate], "reject", pak2)
200+
test_pak(self.nodes[i_undefined], False, pak2)
201+
test_pak(self.nodes[i_pak1], pak2, pak2)
202+
test_pak(self.nodes[i_pak2], pak2, pak2)
203+
test_pak(self.nodes[i_reject], "reject", pak2)
204204

205205
# Reset PAK conf arguments to start to test mempool acceptance and wallet
206206

test/functional/feature_progress.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def skip_test_if_missing_module(self):
2828

2929
def setup_network(self):
3030
self.setup_nodes()
31-
self.is_network_split = True
3231
self.starttime = int(time.time())
3332

3433
def setmocktime(self, ntime):

test/functional/rpc_calcfastmerkleroot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def set_test_params(self):
1111

1212
def run_test(self):
1313
util.node_fastmerkle = self.nodes[0]
14+
print(util.node_fastmerkle) # to avoid the dead code linter in all tests that use this
1415

1516
test_leaves = ["b66b041650db0f297b53f8d93c0e8706925bf3323f8c59c14a6fac37bfdcd06f", "99cb2fa68b2294ae133550a9f765fc755d71baa7b24389fed67d1ef3e5cb0255", "257e1b2fa49dd15724c67bac4df7911d44f6689860aa9f65a881ae0a2f40a303", "b67b0b9f093fa83d5e44b707ab962502b7ac58630e556951136196e65483bb80"]
1617
test_roots = ["0000000000000000000000000000000000000000000000000000000000000000", "b66b041650db0f297b53f8d93c0e8706925bf3323f8c59c14a6fac37bfdcd06f", "f752938da0cb71c051aabdd5a86658e8d0b7ac00e1c2074202d8d2a79d8a6cf6", "245d364a28e9ad20d522c4a25ffc6a7369ab182f884e1c7dcd01aa3d32896bd3", "317d6498574b6ca75ee0368ec3faec75e096e245bdd5f36e8726fa693f775dfc"]

test/functional/test_framework/liquid_addr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def blech32_polymod(values):
1313
chk = 1
1414
for value in values:
1515
top = chk >> 55 # 25->55
16-
chk = ((chk & 0x7fffffffffffff) << 5) ^^ value # 0x1ffffff->0x7fffffffffffff
16+
chk = ((chk & 0x7fffffffffffff) << 5) ^ value # 0x1ffffff->0x7fffffffffffff
1717
for i in range(5):
1818
chk ^= generator[i] if ((top >> i) & 1) else 0
1919
return chk
@@ -32,7 +32,7 @@ def blech32_verify_checksum(hrp, data):
3232
def blech32_create_checksum(hrp, data):
3333
"""Compute the checksum values given HRP and data."""
3434
values = blech32_hrp_expand(hrp) + data
35-
polymod = blech32_polymod(values + [0]*12) ^^ 1 # 6->12
35+
polymod = blech32_polymod(values + [0]*12) ^ 1 # 6->12
3636
return [(polymod >> 5 * (11 - i)) & 31 for i in range(12)]
3737
# ^ 5 ^ 6
3838

test/functional/test_framework/messages.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,10 @@ def serialize(self):
414414
r += self.vchCommitment
415415
return r
416416

417-
def setToAsset(self, val):
418-
if len(val) != 32:
419-
raise 'invalid asset hash (expected 32 bytes got %d)' % len(val)
420-
self.vchCommitment = b'\x01' + val
417+
#def setToAsset(self, val):
418+
# if len(val) != 32:
419+
# raise 'invalid asset hash (expected 32 bytes got %d)' % len(val)
420+
# self.vchCommitment = b'\x01' + val
421421

422422
def __repr__(self):
423423
return "CTxOutAsset(vchCommitment=%s)" % self.vchCommitment

0 commit comments

Comments
 (0)