Skip to content
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

Merged
merged 5 commits into from
May 15, 2021

Conversation

cdecker
Copy link
Member

@cdecker cdecker commented Apr 29, 2021

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

@cdecker cdecker marked this pull request as draft April 29, 2021 15:44
Copy link
Contributor

@rustyrussell rustyrussell left a 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;
Copy link
Contributor

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...

Copy link
Member Author

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.

@rustyrussell
Copy link
Contributor

Needs a changelog entry I think!

@cdecker
Copy link
Member Author

cdecker commented May 3, 2021

I closed my eyes through the SWIG part, but I think I was supposed to.

Yep, should have mentioned that, it's generated code, which is also why we need to ignore it for cppcheck and exclude the libhsmd.py file from linting.

@cdecker
Copy link
Member Author

cdecker commented May 3, 2021

Needs a changelog entry I think!

Changelog added to both PRs 👍

@cdecker cdecker marked this pull request as ready for review May 12, 2021 07:06
Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack bfa52af

@rustyrussell rustyrussell merged commit 0f2009c into ElementsProject:master May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants