Skip to content

Commit

Permalink
runner: allow supports_ options for things not reflected in features.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Jun 24, 2021
1 parent ccee478 commit e91b3a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Here's a short outline of the current expected methods for a Runner.
- `get_keyset`: returns the node's KeySet (`revocation_base_secret`, `payment_base_secret`, `htlc_base_secret`, and `shachain_seed`)
- `get_node_privkey`: Private key of the node. Used to generate the node id and establish a communication channel with the node under test.
- `get_node_bitcoinkey`: Private key of the node under test's funding pubkey
- `has_option`: Returns `None` if node does not support provided option, otherwise 'even' or 'odd' (required or supported). Example input: `option_data_loss_protect` or `option_anchor_outputs`
- `has_option`: checks for features (e.g. `option_anchor_outputs`) in which cast it returns `None`, or "even" or "odd" (required or supported). Also checks for non-feature-bit features, such as `supports_open_accept_channel_types` which returns `None` or "true".
- `add_startup_flag`: Add flag to runner's startup.
- `start`: Starts up / initializes the node under test.
- `stop`: Stops the node under test and closes the connection.
Expand Down
7 changes: 5 additions & 2 deletions lnprototest/clightning/clightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ def __init__(self, config: Any):
stdout=subprocess.PIPE, check=True).stdout.decode('utf-8').splitlines()
self.options: Dict[str, str] = {}
for o in opts:
k, v = o.split('/')
self.options[k] = v
if o.startswith("supports_"):
self.options[o] = "true"
else:
k, v = o.split('/')
self.options[k] = v

def get_keyset(self) -> KeySet:
return KeySet(revocation_base_secret='0000000000000000000000000000000000000000000000000000000000000011',
Expand Down

0 comments on commit e91b3a8

Please sign in to comment.