Skip to content

Fix: retire emits CreditRetired event before writing retirement record #162

@legend-esc

Description

@legend-esc

Labels: bug

Description

In retire, the CreditRetired event is emitted before the retirement record is persisted to storage. If the storage write fails after the event is emitted, off-chain indexers will record a retirement that does not exist on-chain.

Expected Behavior

Emit the event only after all storage writes succeed.

Tasks

  • Reorder operations: write retirement record first, then emit event
  • Add test asserting event is only present when record exists
  • Document event ordering guarantee in rustdoc

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions