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

Small Cleanups Discovered during Bindings for 0.0.111 #1714

Conversation

TheBlueMatt
Copy link
Collaborator

Really only the first is a practical change for Rust users, the others are just here because otherwise they'd be on the 0.0.111-bindings branch by themselves.

@TheBlueMatt TheBlueMatt added this to the 0.0.111 milestone Sep 11, 2022
@TheBlueMatt TheBlueMatt mentioned this pull request Sep 11, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2022

Codecov Report

Merging #1714 (b78359a) into main (15a5966) will decrease coverage by 0.04%.
The diff coverage is 91.66%.

@@            Coverage Diff             @@
##             main    #1714      +/-   ##
==========================================
- Coverage   90.84%   90.80%   -0.05%     
==========================================
  Files          86       86              
  Lines       46448    46451       +3     
  Branches    46448    46451       +3     
==========================================
- Hits        42198    42180      -18     
- Misses       4250     4271      +21     
Impacted Files Coverage Δ
lightning/src/ln/peer_handler.rs 56.73% <ø> (-0.15%) ⬇️
lightning/src/onion_message/messenger.rs 89.50% <ø> (ø)
lightning/src/routing/scoring.rs 96.14% <ø> (ø)
lightning/src/util/persist.rs 94.73% <ø> (ø)
lightning-invoice/src/lib.rs 87.39% <75.00%> (ø)
lightning/src/onion_message/blinded_route.rs 97.05% <100.00%> (ø)
lightning/src/onion_message/functional_tests.rs 96.33% <100.00%> (ø)
lightning/src/chain/onchaintx.rs 94.02% <0.00%> (-0.92%) ⬇️
lightning-net-tokio/src/lib.rs 76.73% <0.00%> (-0.31%) ⬇️
lightning/src/ln/payment_tests.rs 98.55% <0.00%> (-0.27%) ⬇️
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@TheBlueMatt TheBlueMatt force-pushed the 2022-09-111-bindings-discovered-cleanups branch from 89275cd to 7f9df8d Compare September 11, 2022 21:24
@TheBlueMatt TheBlueMatt force-pushed the 2022-09-111-bindings-discovered-cleanups branch from 7f9df8d to 53aeeeb Compare September 12, 2022 15:25
@dunxen
Copy link
Contributor

dunxen commented Sep 12, 2022

ACK 53aeeeb

Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

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

LGTM, feel free to squash fixups.

Now that `{Signed,}RawInvoice` implement the std `Hash` trait,
having a method called `hash` is ambiguous.

Instead, we rename the `hash` methods `signed_hash` to make it
clear that the hash is the one used for the purpose of signing the
invoice.
The C bindings generator isn't capable of figuring out if a blanket
impl applies in a given context, and instead opts to always write
out any relevant impl's for a trait. Thus, blanket impls should be
disabled when building with `#[cfg(c_bindings)]`.
The bindings generator is pretty naive in its generic resolution
and doesn't like `where` clauses for bounds that are simple traits.
This should eventually change, but for now its simplest to just
inline the relevant generic bounds.
The "helpful" type aliases don't make sense for C bindings as all
generics are concretized anyway.
I'm not sure why rustc didn't complain about the unused parameter
or why we're allowed to get away without explicitly bounding the
`Sign` in the `KeysInterface`, but the current code requires all
`BlindedPath` construction to explicitly turbofish an unused type.
@TheBlueMatt TheBlueMatt force-pushed the 2022-09-111-bindings-discovered-cleanups branch from 53aeeeb to be7107f Compare September 12, 2022 16:27
@TheBlueMatt
Copy link
Collaborator Author

Tweaked one more doc comment as suggested and squashed fixups.

dunxen
dunxen previously approved these changes Sep 12, 2022
@valentinewallace
Copy link
Contributor

valentinewallace commented Sep 12, 2022

When updating the sample, I found out that the SimpleArcPeerManager didn't get updated to use the SimpleArcOnionMessenger (on me, probably). I worked around it but it seems like it could potentially fit into this PR

@TheBlueMatt
Copy link
Collaborator Author

Done.

tnull
tnull previously approved these changes Sep 12, 2022
@TheBlueMatt
Copy link
Collaborator Author

Ugh, sorry, was missing an Arc in the new alias definition.

@TheBlueMatt TheBlueMatt force-pushed the 2022-09-111-bindings-discovered-cleanups branch from 105809e to 0c6040d Compare September 12, 2022 18:33
Note that `SimpleArcPeerHandler` is also updated to not wrap
`IgnoringMessageHandler` in an `Arc`, as `IgnoringMessageHandler`
is already zero-sized.
@TheBlueMatt TheBlueMatt force-pushed the 2022-09-111-bindings-discovered-cleanups branch from 0c6040d to b78359a Compare September 12, 2022 18:34
Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

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

'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, SD, M, T, F, C, L 👀

@TheBlueMatt TheBlueMatt merged commit 990e346 into lightningdevkit:main Sep 12, 2022
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.

5 participants