Skip to content

feat: implement view functions and event updates for issues #595-#598 - #650

Open
kaivegascod-a11y wants to merge 5 commits into
Stellar-split:mainfrom
kaivegascod-a11y:feature/issues-595-596-597-598
Open

feat: implement view functions and event updates for issues #595-#598#650
kaivegascod-a11y wants to merge 5 commits into
Stellar-split:mainfrom
kaivegascod-a11y:feature/issues-595-596-597-598

Conversation

@kaivegascod-a11y

Copy link
Copy Markdown

Summary

This PR implements solutions for four related GitHub issues:

Issue #598: Add invoice_id to invoice_refunded event data

  • Modified the invoice_refunded event to include invoice_id in the event data tuple
  • Makes it easier for indexers that decode only event data (not topics) to correlate refund events with invoices

Issue #597: Add get_invoice_amounts view function

  • New public function to query invoice recipient amounts without retrieving the entire invoice structure
  • Enables recipients and payers to easily determine individual entitlements without loading full invoice data
  • Improves query efficiency and user experience

Issue #596: Add get_contract_paused view function

  • New public function that allows off-chain clients and integrations to query contract pause state
  • Enables trustless discovery of the pause state
  • No authentication required

Issue #595: Add comprehensive tests for get_platform_fee_bps

  • The function already exists in the codebase
  • This PR adds comprehensive unit tests verifying the function returns correct platform fee basis points

Test Coverage

All implementations include comprehensive unit tests verifying:

  • Correct return values for various inputs
  • Edge cases (single recipient, multiple recipients, invalid IDs)
  • Initial default states
  • State changes after operations (pause/unpause)

Closes #598
Closes #597
Closes #596
Closes #595

Closes Stellar-split#598

Modifies the invoice_refunded event to include the invoice_id in the event data tuple, making it easier for indexers that decode only event data (not topics) to correlate refund events with invoices. The event data now contains (invoice_id, event_seq) instead of just (event_seq).
Closes Stellar-split#598

Adds comprehensive tests to verify that the invoice_refunded event now includes invoice_id in the event data, making it easier for indexers to correlate refund events with invoices without needing to decode event topics.
Closes Stellar-split#597

Adds a new public function to query invoice recipient amounts without retrieving the entire invoice structure. This enables recipients and payers to easily determine individual entitlements without loading full invoice data. Includes comprehensive unit tests verifying returned values match creation inputs.
Closes Stellar-split#596

Adds a new public view function that allows off-chain clients and integrations to query whether the smart contract is currently paused. This enables trustless discovery of the pause state without requiring clients to maintain off-chain configuration. Includes comprehensive unit tests verifying the function returns false initially and true after an admin pause operation.
Closes Stellar-split#595

Adds comprehensive unit tests verifying that the get_platform_fee_bps function returns the correct platform fee basis points. Tests verify both the default zero value and the ability to retrieve custom-set fee values.
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@kaivegascod-a11y 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

1 participant