Skip to content

test(invoice-token): add integration test for burn-on-settlement callback - #313

Open
Democodes-flash wants to merge 1 commit into
StellarState:devfrom
Democodes-flash:test/integration-burn-on-settlement-158
Open

test(invoice-token): add integration test for burn-on-settlement callback#313
Democodes-flash wants to merge 1 commit into
StellarState:devfrom
Democodes-flash:test/integration-burn-on-settlement-158

Conversation

@Democodes-flash

@Democodes-flash Democodes-flash commented Aug 1, 2026

Copy link
Copy Markdown

Overview

Adds a cross-contract integration test suite for the invoice-token burn-on-settlement callback, verifying the escrow -> token settlement flow end to end.

Problem

The invoice-token burn / burn_from paths invoked from the settlement escrow were only covered by unit tests in isolation. There was no integration-level coverage proving the cross-contract callback wiring, event emission, and state transitions behave correctly when a settlement escrow triggers the burn.

Proposed Solution

  • Introduce a MockSettlementEscrow contract plus a shared Ctx/setup() harness in integration_test.rs
  • Cover the happy-path burn_on_settlement and burn_from_on_settlement flows
  • Cover failure paths: insufficient balance, invalid amounts, insufficient allowance, expired allowance, paused, and uninitialized contracts
  • Verify post-settlement transfer unlock and state persistence across partial and full burns
  • Assert emitted events, balances, and allowance state

Acceptance Criteria

  • burn_on_settlement happy path burns the correct amount and emits the event
  • burn_from_on_settlement burns on behalf of the escrow with a valid allowance
  • Insufficient balance and invalid amounts are rejected with the correct errors
  • Insufficient and expired allowances are rejected with the correct errors
  • Paused and uninitialized contracts reject the burn
  • After full settlement, transfers are unlocked and token can move
  • State persists correctly across partial and full burn scenarios
  • All 108 invoice-token tests pass (97 pre-existing + 11 new); cargo fmt and cargo clippy --all-targets -- -D warnings clean

Closes #158

@drips-wave

drips-wave Bot commented Aug 1, 2026

Copy link
Copy Markdown

@Democodes-flash 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

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.

[TESTING] Add Integration Test for Invoice Token Burn-on-Settlement Callback

1 participant