partial bitcoin#20292: Fix intermittent feature_taproot issue

includes:
- 50eb0c2512842b96a0128a7d592a357665f6e006 (only changes to test/
  functional/test_framework/key.py)
This commit is contained in:
Kittywhiskers Van Gogh 2020-10-21 13:06:34 -07:00 committed by pasta
parent 94bd52d5e0
commit 663b3c7450
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -11,7 +11,6 @@ import hashlib
import hmac
import os
import random
import sys
import unittest
def TaggedHash(tag, data):
@ -21,6 +20,7 @@ def TaggedHash(tag, data):
return hashlib.sha256(ss).digest()
def xor_bytes(b0, b1):
assert len(b0) == len(b1)
return bytes(x ^ y for (x, y) in zip(b0, b1))
def jacobi_symbol(n, k):
@ -535,7 +535,8 @@ class TestFrameworkKey(unittest.TestCase):
def test_schnorr_testvectors(self):
"""Implement the BIP340 test vectors (read from bip340_test_vectors.csv)."""
num_tests = 0
with open(os.path.join(sys.path[0], 'test_framework', 'bip340_test_vectors.csv'), newline='', encoding='utf8') as csvfile:
vectors_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'bip340_test_vectors.csv')
with open(vectors_file, newline='', encoding='utf8') as csvfile:
reader = csv.reader(csvfile)
next(reader)
for row in reader: