mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +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:
parent
0db05f6e9c
commit
45143cc731
@ -64,7 +64,7 @@ def test_tu_fields():
|
||||
|
||||
|
||||
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'))
|
||||
|
||||
|
||||
@ -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.
|
||||
"""
|
||||
path = os.path.dirname(__file__)
|
||||
root = os.path.join(path, '..', '..', '..')
|
||||
root = os.path.join(path, '..')
|
||||
filename = os.path.join(root, filename)
|
||||
v = json.load(open(filename, 'r'))
|
||||
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:])
|
||||
|
||||
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'))
|
||||
|
Loading…
Reference in New Issue
Block a user