Skip to content

Conversation

AngelCastilloB
Copy link
Member

@AngelCastilloB AngelCastilloB commented Jul 30, 2025

Context

The Conway-era CDDL specification mandates that optional maps and arrays must be either non-empty or omitted entirely.

However, this rule does not apply to required fields. The transaction outputs array is a required field and must always be present, even if it contains no outputs. The SDK was incorrectly omitting this array when it was empty, leading to invalid transactions. This fix ensures the outputs array is always serialized to maintain compliance.

Additionally, an incorrect falsy check on the TTL value was preventing ttl: 0 from being serialized into core types. Because 0 is a valid TTL, the check has been corrected to properly handle this value.

Copy link
Member

@mkazlauskas mkazlauskas left a comment

Choose a reason for hiding this comment

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

Nice work! 🕵️

@AngelCastilloB AngelCastilloB merged commit f7e6704 into master Jul 30, 2025
10 of 11 checks passed
@AngelCastilloB AngelCastilloB deleted the fix/fix-canonical-serialzation-of-empty-outputs branch July 30, 2025 12:11
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.

3 participants