-
Notifications
You must be signed in to change notification settings - Fork 901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libhsmd: Python bindings for libhsmd
#4498
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack 3ffe97b
I closed my eyes through the SWIG part, but I think I was supposed to. My complaint about externs is only a few dev flags by the end, so that's fine.
hsmd/hsmd.c
Outdated
/* Version codes for BIP32 extended keys in libwally-core. | ||
* It's not suitable to add this struct into client struct, | ||
* so set it static.*/ | ||
static struct bip32_key_version bip32_key_version; | ||
extern struct bip32_key_version bip32_key_version; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extern in a C file is an anti-pattern; we usually want it in a header so both the user and implementer are definitely using the same type...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was hoping I could just move everything across and then remove the extern
from hsmd.c
but since we still do some operations in hsmd.c
like overriding the privkey we need to keep a way to reference it. I could move it to the libhsmd.h
file, but that breaks the encapsulation. Maybe we find a good way to move it into libhsmd.
Needs a changelog entry I think! |
Yep, should have mentioned that, it's generated code, which is also why we need to ignore it for |
Changelog added to both PRs 👍 |
Changelog-Added: libhsmd: Added python bindings for `libhsmd`
With swig we now have C files that are generated with tools that are not under our control, so provide an escape hatch for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack bfa52af
The title pretty much sums it up. Not sure if there is a better way to
compile than to list all the C files that are involved, but it works
:-)
Depends #4497