Skip to content

Commit 663b3c7

Browse files
kwvgPastaPastaPasta
authored andcommitted
partial bitcoin#20292: Fix intermittent feature_taproot issue
includes: - 50eb0c2 (only changes to test/ functional/test_framework/key.py)
1 parent 94bd52d commit 663b3c7

File tree

1 file changed

+3
-2
lines changed
  • test/functional/test_framework

1 file changed

+3
-2
lines changed

test/functional/test_framework/key.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import hmac
1212
import os
1313
import random
14-
import sys
1514
import unittest
1615

1716
def TaggedHash(tag, data):
@@ -21,6 +20,7 @@ def TaggedHash(tag, data):
2120
return hashlib.sha256(ss).digest()
2221

2322
def xor_bytes(b0, b1):
23+
assert len(b0) == len(b1)
2424
return bytes(x ^ y for (x, y) in zip(b0, b1))
2525

2626
def jacobi_symbol(n, k):
@@ -535,7 +535,8 @@ def test_schnorr(self):
535535
def test_schnorr_testvectors(self):
536536
"""Implement the BIP340 test vectors (read from bip340_test_vectors.csv)."""
537537
num_tests = 0
538-
with open(os.path.join(sys.path[0], 'test_framework', 'bip340_test_vectors.csv'), newline='', encoding='utf8') as csvfile:
538+
vectors_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'bip340_test_vectors.csv')
539+
with open(vectors_file, newline='', encoding='utf8') as csvfile:
539540
reader = csv.reader(csvfile)
540541
next(reader)
541542
for row in reader:

0 commit comments

Comments
 (0)