Skip to content

fix(invoice): safely handle XDR encoding in invoice ID generation - #163

Closed
Aycode01 wants to merge 5 commits into
TrusTrove:mainfrom
Aycode01:fix/safe-invoice-id-xdr
Closed

fix(invoice): safely handle XDR encoding in invoice ID generation#163
Aycode01 wants to merge 5 commits into
TrusTrove:mainfrom
Aycode01:fix/safe-invoice-id-xdr

Conversation

@Aycode01

@Aycode01 Aycode01 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates invoice ID generation to safely handle XDR-encoded addresses of varying lengths, removing unsafe indexing that could cause panics while preserving deterministic and unique invoice IDs.

Closes #131

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactor
  • Documentation

Changes Made

  • Replaced unsafe XDR byte indexing with safe handling
  • Removed panic paths caused by fixed-length assumptions
  • Preserved deterministic invoice ID generation
  • Added unit tests covering varying XDR lengths and uniqueness

Testing Done

  • Verified invoice IDs are generated safely for different XDR lengths
  • Confirmed unique IDs across different address formats
  • Ran cargo test successfully

@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@Aycode01 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Aycode01
Aycode01 force-pushed the fix/safe-invoice-id-xdr branch from ccfb464 to 1854606 Compare June 30, 2026 09:22
@Aycode01
Aycode01 force-pushed the fix/safe-invoice-id-xdr branch from 15b8df8 to 5b66119 Compare June 30, 2026 10:12
@Aycode01

Copy link
Copy Markdown
Contributor Author

review and merge

@Aycode01 Aycode01 changed the title fix(pool): reject zero funded amount in fund_invoice fix(invoice): safely handle XDR encoding in invoice ID generation Jun 30, 2026
@K1NGD4VID

Copy link
Copy Markdown
Contributor

resolve Merge Conflict @Aycode01

@K1NGD4VID

Copy link
Copy Markdown
Contributor

fix ci error @Aycode01

@K1NGD4VID

Copy link
Copy Markdown
Contributor

Still failing Ci Error @Aycode01

@Aycode01

Aycode01 commented Jul 8, 2026 via email

Copy link
Copy Markdown
Contributor Author

@Aycode01 Aycode01 closed this by deleting the head repository Jul 9, 2026
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.

bug(invoice): use safe XDR handling for invoice ID generation

2 participants