test: python E721 updates

This commit is contained in:
Jon Atack 2023-07-31 12:09:33 -06:00
parent 44b05bf3fe
commit 38c3fd846b
2 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,7 @@ class InvalidLocatorTest(BitcoinTestFramework):
within_max_peer = node.add_p2p_connection(P2PInterface()) within_max_peer = node.add_p2p_connection(P2PInterface())
msg.locator.vHave = [int(node.getblockhash(i - 1), 16) for i in range(block_count, block_count - (MAX_LOCATOR_SZ), -1)] msg.locator.vHave = [int(node.getblockhash(i - 1), 16) for i in range(block_count, block_count - (MAX_LOCATOR_SZ), -1)]
within_max_peer.send_message(msg) within_max_peer.send_message(msg)
if type(msg) == msg_getheaders: if type(msg) is msg_getheaders:
within_max_peer.wait_for_header(node.getbestblockhash()) within_max_peer.wait_for_header(node.getbestblockhash())
else: else:
within_max_peer.wait_for_block(int(node.getbestblockhash(), 16)) within_max_peer.wait_for_block(int(node.getbestblockhash(), 16))

View File

@ -31,7 +31,7 @@ def siphash_round(v0, v1, v2, v3):
def siphash(k0, k1, data): def siphash(k0, k1, data):
assert type(data) == bytes assert type(data) is bytes
v0 = 0x736f6d6570736575 ^ k0 v0 = 0x736f6d6570736575 ^ k0
v1 = 0x646f72616e646f6d ^ k1 v1 = 0x646f72616e646f6d ^ k1
v2 = 0x6c7967656e657261 ^ k0 v2 = 0x6c7967656e657261 ^ k0
@ -61,5 +61,5 @@ def siphash(k0, k1, data):
def siphash256(k0, k1, num): def siphash256(k0, k1, num):
assert type(num) == int assert type(num) is int
return siphash(k0, k1, num.to_bytes(32, 'little')) return siphash(k0, k1, num.to_bytes(32, 'little'))