Skip to content

Commit 5c0210e

Browse files
committed
bugfix: fix bech32_encode calls in gen_key_io_test_vectors.py
1 parent 8ec881d commit 5c0210e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

contrib/testgen/gen_key_io_test_vectors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def gen_valid_bech32_vector(template):
149149
witprog = bytearray(os.urandom(template[2]))
150150
encoding = template[4]
151151
dst_prefix = bytearray(template[5])
152-
rv = bech32_encode(hrp, [witver] + convertbits(witprog, 8, 5), encoding)
152+
rv = bech32_encode(encoding, hrp, [witver] + convertbits(witprog, 8, 5))
153153
return rv, dst_prefix + witprog
154154

155155
def gen_valid_vectors():
@@ -210,15 +210,15 @@ def gen_invalid_bech32_vector(template):
210210
encoding = template[3]
211211

212212
if no_data:
213-
rv = bech32_encode(hrp, [], encoding)
213+
rv = bech32_encode(encoding, hrp, [])
214214
else:
215215
data = [witver] + convertbits(witprog, 8, 5)
216216
if template[4] and not no_data:
217217
if template[2] % 5 in {2, 4}:
218218
data[-1] |= 1
219219
else:
220220
data.append(0)
221-
rv = bech32_encode(hrp, data, encoding)
221+
rv = bech32_encode(encoding, hrp, data)
222222

223223
if template[5]:
224224
i = len(rv) - random.randrange(1, 7)

0 commit comments

Comments
 (0)