-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix issue with overlapping inlined basic embedded enums #228
Conversation
Caused when the inlining would made cddl-codegen think that the types were not overlapping since it was looking at the stored type not the actual starting cbor type (e.g. when it was a fixed value). This would cause a problem as the type matching introduced in #199 but only in very specific cases with basic groups starting with fixed values.
This one isn't related to the plutus datum tool but it's been open for a while. One of the issues fixes an issue with CML re-generation for the Nonce type which was that block that wasn't parsing last month. |
src/generation.rs
Outdated
} | ||
_ => RustStructCBORLen::Fixed(1), | ||
}; | ||
// this will never be 1 line to don't bother with the below cases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure I understand what this comment means. Maybe to
was meant to be so
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Fixed.
src/intermediate.rs
Outdated
@@ -1310,6 +1310,7 @@ impl RustType { | |||
}], | |||
ConceptualRustType::Primitive(p) => p.cbor_types(), | |||
ConceptualRustType::Rust(ident) => { | |||
eprintln!("{ident:?}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to leave in these two eprintln
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
Caused when the inlining would made cddl-codegen think that the types were not overlapping since it was looking at the stored type not the actual starting cbor type (e.g. when it was a fixed value).
This would cause a problem as the type matching introduced in #199 but only in very specific cases with basic groups starting with fixed values.
Various other fixes + more test cases:
Fixes #229
Fixes #230
Fixes #231
Fixes #232