smite: Implement update_fail_malformed_htlc codec#38
smite: Implement update_fail_malformed_htlc codec#38Chand-ra wants to merge 1 commit intomorehouse:masterfrom
update_fail_malformed_htlc codec#38Conversation
| /// Encodes to wire format (without message type prefix). | ||
| #[must_use] | ||
| pub fn encode(&self) -> Vec<u8> { | ||
| let mut out = Vec::new(); |
There was a problem hiding this comment.
Since we know the message size at compile time, maybe it's better to go with Vec::with_capacity() here instead? The other codecs use Vec::new() so I decided to preserve uniformity, but maybe the former is better?
There was a problem hiding this comment.
For consistency, let's keep it the same. Later, if we determine this optimization is worthwhile, we can do it for all codecs in one PR.
|
hey @Chand-ra some nit pick comments from my side otherwise your PR LGTM |
|
Thanks @Vineet1101, but I cannot see your comments. |
| /// Encodes to wire format (without message type prefix). | ||
| #[must_use] | ||
| pub fn encode(&self) -> Vec<u8> { | ||
| let mut out = Vec::new(); |
There was a problem hiding this comment.
For consistency, let's keep it the same. Later, if we determine this optimization is worthwhile, we can do it for all codecs in one PR.
|
Also please make sure CI passes before requesting the next review. You should be able to run all the necessary commands locally. |
PRs #27 and #33 cover adding, fulfilling, and failing HTLCs during commitment transaction updates, but the specific "malformed" case is missing. Add the codec for it.