mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
sphinx: Introduce a runtest command to the onion tool
The `runtest` command takes a JSON onion spec, creates the onion and decodes it with the provided private keys. It is fully configurable and can be used for the test-vectors in the spec. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
b83d15ea4a
commit
660921a9dd
@@ -21,6 +21,12 @@
|
||||
#define ROUTING_INFO_SIZE (FRAME_SIZE * NUM_MAX_FRAMES)
|
||||
#define TOTAL_PACKET_SIZE (VERSION_SIZE + PUBKEY_SIZE + HMAC_SIZE + ROUTING_INFO_SIZE)
|
||||
|
||||
#if EXPERIMENTAL_FEATURES
|
||||
#define MAX_FRAMES_PER_HOP (1 << 4)
|
||||
#else
|
||||
#define MAX_FRAMES_PER_HOP 1
|
||||
#endif
|
||||
|
||||
struct onionpacket {
|
||||
/* Cleartext information */
|
||||
u8 version;
|
||||
@@ -87,6 +93,7 @@ struct hop_data {
|
||||
|
||||
enum sphinx_payload_type {
|
||||
SPHINX_V0_PAYLOAD = 0,
|
||||
SPHINX_INVALID_PAYLOAD = 254,
|
||||
SPHINX_RAW_PAYLOAD = 255,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user