mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: Remove onion test vectors containing legacy onions.
I thought about fixing them up, but really these should be in lnprototest anyway. Turns out they're from the spec, so we should actually fix them up there. I moved the vector files into contrib/pyln-proto, since that still needs them. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -64,7 +64,7 @@ def test_tu_fields():
|
|||||||
|
|
||||||
|
|
||||||
dirname = os.path.dirname(__file__)
|
dirname = os.path.dirname(__file__)
|
||||||
vector_base = os.path.join(dirname, '..', '..', '..', 'tests', 'vectors')
|
vector_base = os.path.join(dirname, '..', 'vectors')
|
||||||
have_vectors = os.path.exists(os.path.join(vector_base, 'onion-test-v0.json'))
|
have_vectors = os.path.exists(os.path.join(vector_base, 'onion-test-v0.json'))
|
||||||
|
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ def sphinx_path_from_test_vector(filename: str) -> Tuple[onion.SphinxPath, dict]
|
|||||||
"""Loads a sphinx test vector from the repo root.
|
"""Loads a sphinx test vector from the repo root.
|
||||||
"""
|
"""
|
||||||
path = os.path.dirname(__file__)
|
path = os.path.dirname(__file__)
|
||||||
root = os.path.join(path, '..', '..', '..')
|
root = os.path.join(path, '..')
|
||||||
filename = os.path.join(root, filename)
|
filename = os.path.join(root, filename)
|
||||||
v = json.load(open(filename, 'r'))
|
v = json.load(open(filename, 'r'))
|
||||||
session_key = onion.Secret(bytes.fromhex(v['generate']['session_key']))
|
session_key = onion.Secret(bytes.fromhex(v['generate']['session_key']))
|
||||||
|
|||||||
@@ -83,13 +83,3 @@ def test_rendezvous_onion(directory, oniontool):
|
|||||||
store_onion(out[-1][5:])
|
store_onion(out[-1][5:])
|
||||||
|
|
||||||
assert(out == ['payload=000000000000000000000000000000000400000004000000000000000000000000'])
|
assert(out == ['payload=000000000000000000000000000000000400000004000000000000000000000000'])
|
||||||
|
|
||||||
|
|
||||||
def test_onion_vectors(oniontool):
|
|
||||||
tests = [
|
|
||||||
'onion-test-multi-frame.json',
|
|
||||||
'onion-test-v0.json']
|
|
||||||
|
|
||||||
for t in tests:
|
|
||||||
p = os.path.join(os.path.dirname(__file__), 'vectors', t)
|
|
||||||
print(subprocess.check_output([oniontool, 'runtest', p]).decode('ASCII'))
|
|
||||||
|
|||||||
Reference in New Issue
Block a user