Skip to content

Commit

Permalink
codegen: fix the amount sat type
Browse files Browse the repository at this point in the history
The amount sat is a u64 not a u16, this was
resulting in a wrong decoding of the type and
a wrong decoding of the messages as conseguences.

Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Apr 1, 2024
1 parent f364246 commit aff3f20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lncodegen-csvlang/src/parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl Parser {
// search for u64 alias
if ["amount_sat"].contains(&token.val.to_string().as_str()) {
let tok = self.lookup_last(tokens).unwrap();
LNMsData::Uint16(tok.val.to_owned())
LNMsData::Uint64(tok.val.to_owned())
} else if ["u8", "witness"].contains(&token.val.as_str()) {
let tok = self.lookup_last(tokens).unwrap();
let size = if !self.peek_and_check_if_type_declaration(tokens) {
Expand Down

0 comments on commit aff3f20

Please sign in to comment.