test: Fix various pyflakes warnings

This commit is contained in:
Jack Grigg 2020-10-16 16:00:02 +01:00
parent 03e68a3ed8
commit ee079a683b
2 changed files with 5 additions and 5 deletions

View File

@ -108,9 +108,9 @@ def hash_xi(digest, xi):
def count_zeroes(h):
# Convert to binary string
if type(h) == bytearray:
h = ''.join('{0:08b}'.format(x, 'b') for x in h)
h = ''.join('{0:08b}'.format(x) for x in h)
else:
h = ''.join('{0:08b}'.format(ord(x), 'b') for x in h)
h = ''.join('{0:08b}'.format(ord(x)) for x in h)
# Count leading zeroes
return (h+'1').index('1')
@ -283,9 +283,9 @@ def zcash_person(n, k):
def print_hash(h):
if type(h) == bytearray:
return ''.join('{0:02x}'.format(x, 'x') for x in h)
return ''.join('{0:02x}'.format(x) for x in h)
else:
return ''.join('{0:02x}'.format(ord(x), 'x') for x in h)
return ''.join('{0:02x}'.format(ord(x)) for x in h)
def validate_params(n, k):
if (k >= n):

View File

@ -575,7 +575,7 @@ class JSDescription(object):
return r
def __repr__(self):
return "JSDescription(vpub_old=%i.%08i vpub_new=%i.%08i anchor=%064x onetimePubKey=%064x randomSeed=%064x proof=%r)" \
return "JSDescription(vpub_old=%i vpub_new=%i anchor=%064x onetimePubKey=%064x randomSeed=%064x proof=%r)" \
% (self.vpub_old, self.vpub_new, self.anchor,
self.onetimePubKey, self.randomSeed, self.proof)