Other changes along the way:
1. In a couple of places we passed None as a dummy for for
`otherfields` where {} is just as good.
2. Turned bytes into hex for errors.
3. Remove nonsensical (unused) get_tlv_by_number() function from MessageNamespace
4. Renamed unrelated-but-overlapping `field_from_csv` and
`type_from_csv` static methods, since mypy thought they should have
the same type.
5. Unknown tlv fields are placed in dict as strings, not ints, for
type simplicity.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This is the first step to transition to a better organized python module
structure. Sadly we can't reuse the `pylightning` module as a namespace module
since having importable things in the top level of the namespace is not
allowed in any of the namespace variants [1], hence we just switch over to the
`pyln` namespace. The code the was under `lightning` will now be reachable
under `pyln.client` and we add the `pyln.proto` module for all the things that
are independent of talking to lightningd and can be used for protocol testing.
[1] https://packaging.python.org/guides/packaging-namespace-packages/
Signed-off-by: Christian Decker <decker.christian@gmail.com>
We now have an abstract rewriter that will perform some common extractions and
replacements (type replacement for example), that can then be customized in
derived classes.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
I wanted to add run-secret_eq_consttime and run-find_my_abspath to the
.gitignore file, but instead I replaced all the names of tests with a simple
regex.
This works because git doesn't ignore files that are already in git. So
source and header file are safe. It doesn't ignore *.c files that haven't been
added to git either.
Signed-off-by: Mark Beckwith <wythe@intrig.com>
You can use environment variables or the commandline to set defaults.
It looks very autoconf, but you don't need to learn m4.
Doesn't cover all the obscure flags, but it's easy to extend.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Also, we split the more sophisticated json_add helpers to avoid pulling in
everything into lightning-cli, and unify the routines to print struct
short_channel_id (it's ':', not '/' too).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This is a major change; instead of creating a mutual anchor (funding)
transaction, each side creates its own. We use escape transactions in
case anything goes wrong; these will be revoked later.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>