refactor(contract): comprehensive milestone and event improvements - #347
Merged
ALLEN-AYODEJI merged 2 commits intoAug 28, 2026
Conversation
Closes Trellis-Ecosystem#224: Remove dead-weight Milestone.id field - Removed unused id field from Milestone struct that was never validated or read - Updated frontend type definition in soroban.ts - Updated all test data to remove id field constructions - Removed assertion checking milestone.id since field no longer exists Closes Trellis-Ecosystem#225: Add comprehensive authorization tests - Added test_payer_only_functions_reject_payee: verify payee cannot call payer-only functions - Added test_payee_only_functions_reject_payer: verify payer cannot call payee-only functions - Added test_resolver_only_functions_reject_others: verify non-resolvers cannot resolve disputes - Added test_get_agreement_callable_by_anyone: verify read-only access has no auth requirement Closes Trellis-Ecosystem#226: Emit on-chain event for extend_agreement_ttl - Added new ttl_extended event variant with caller address for keeper audit trail - Updated events.rs with new "trlls_ttle" topic symbol (9 chars, symbol_short!) - Modified extend_agreement_ttl to accept caller parameter and emit event - Added test_extend_agreement_ttl_emits_event to verify event emission Closes Trellis-Ecosystem#227: Add comprehensive dispute resolution test coverage for payee-award path - Added test_dispute_and_release_to_payee to test the refund_to_payer=false path - Verifies token transfer to payee (not payer) when resolver awards to payee - Verifies milestone status transitions to Completed (not Refunded) - Validates balances of both payer and payee after resolution All tests verify the complete state transitions and token movements for each scenario.
|
@psamist001 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements four interconnected improvements to the Trellis contract and tests:
#224: Remove Dead-Weight Milestone.id Field
The
Milestone.idfield was stored but never validated or read, wasting storage. Removed it entirely and updated both contract and frontend types.#225: Add Missing Authorization Tests
Implemented comprehensive authorization testing to verify that:
#226: Emit On-Chain Event for extend_agreement_ttl
Added keeper audit trail by emitting
ttl_extendedevents when agreements are extended. This allows off-chain monitoring to track which services are keeping agreements alive.#227: Add Dispute Payee-Award Path Coverage
Previously only the refund path was tested. Now tests verify the complete payee-award path (refund_to_payer=false) including:
Testing
All changes include comprehensive tests verifying state transitions, token movements, and event emissions.
Closes #224
Closes #225
Closes #226
Closes #227