Skip to content

Make MessageGenerator infallible#521

Merged
rustaceanrob merged 3 commits into2140-dev:masterfrom
rustaceanrob:11-20-network-cleanup
Nov 22, 2025
Merged

Make MessageGenerator infallible#521
rustaceanrob merged 3 commits into2140-dev:masterfrom
rustaceanrob:11-20-network-cleanup

Conversation

@rustaceanrob
Copy link
Copy Markdown
Collaborator

@rustaceanrob rustaceanrob commented Nov 20, 2025

The in-memory buffer cannot fail when serializing a message, and the encryption cannot fail when memory is know as well.

@nyonson can I get a sanity check on the new expect conditions in the first commit? If I remember correctly the serde implementation should be infallible because we are only working with vectors, and the OutboundCipher::encrypt_to_vec is also infallible now in bip324

Copy link
Copy Markdown
Collaborator

@nyonson nyonson left a comment

Choose a reason for hiding this comment

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

The two expect's in the first patch make sense to me.

The in-memory buffer cannot fail when serializing a message, and the
encryption cannot fail when memory is know as well.
Use `serialize` to remove some of the code bloat in `outbound_messages`.
Because the modules are in the `network` subspace using
`inbound/outbound` implies what is going back and forth (network
messages).
@rustaceanrob rustaceanrob merged commit 93f1874 into 2140-dev:master Nov 22, 2025
10 checks passed
@rustaceanrob rustaceanrob deleted the 11-20-network-cleanup branch November 22, 2025 09:06
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