Skip to content

Conversation

@astral-bitlight
Copy link

Description

This PR addresses a (seems like?) bug in the parsing logic for RgbInvoice strings where the optional assignment_name field was not correctly handled during deserialization, leading to data loss during round-trip serialization/deserialization.

Updates

The impl FromStr for RgbInvoice has been updated to correctly handle both possible path structures:

  1. contract/schema/assignment_data (where assignment_name is None)
  2. contract/schema/assignment_name/assignment_data (where assignment_name is Some(...))

Testing

  • A new test case, parse_with_assignment_name, has been added to specifically test the round-trip serialization and deserialization of an RgbInvoice containing an assignment_name. (This test now passes, confirming the fix. )
  • All existing tests continue to pass.

@astral-bitlight astral-bitlight changed the title fix(invoice): Correctly parse assignment_name in RgbInvoice::from_str fix(invoice): correctly parse assignment_name in RgbInvoice::from_str Apr 24, 2025
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.

1 participant