Repository navigation
feat: comprehensive error handling, storage optimization, event enhancement, and deployment scripts - #28
Merged
Conversation
Add 12 new error variants for comprehensive error handling: - UnauthorizedAction, MilestoneAmountMismatch, MilestoneCountMismatch - MilestoneAlreadyReleased, CannotReleaseUnapprovedMilestone - CannotSubmitAlreadySubmittedMilestone, ZeroMilestones - EscrowAlreadyReleased, EscrowAlreadyRefunded - InvalidDeadlineTransition, TreasuryNotConfigured, CannotSetFeeExceedingMax Issue #14: Comprehensive error handling and validation
…ions - Use specific error variants (UnauthorizedAction, EscrowAlreadyReleased, etc.) - Add milestone-specific error checks (ZeroMilestones, MilestoneCountMismatch) - Update all events to include actor address and timestamp - Add set_escrow_ttl, get_escrow_ttl, cleanup_expired_escrows functions - Add fee_updated event for set_fee operation Issues #14, #15, #16: Error handling, storage optimization, events
- Add actor address, timestamp, and amounts to all events - New events: ESCROW_DEADLINE_SET, ESCROW_TIMEOUT, FEE_UPDATED - Include from_state/to_state info in dispute resolution events - Add released_amount and refunded_amount to resolve_dispute events Issue #16: Events for all state transitions
- Add get_escrow_ttl/set_escrow_ttl for configurable TTL (MIN/MAX bounds) - Add cleanup_expired_escrows function for terminal escrow cleanup - Replace hardcoded ESCROW_TTL with dynamic configuration - Add EscrowTTL to DataKey enum Issue #15: Optimize storage usage and TTL management
- Add EscrowTTL variant for configurable storage TTL management Issue #15: Optimize storage usage and TTL management
- Fix duplicate 'pub mod contract' line - Expose errors, events, storage, types, and testutils as public modules - Enable comprehensive API access for downstream consumers Issue #14: Comprehensive error handling and validation
- Use env.register_contract and client pattern for test utilities - Add deadline parameter to create_funded_escrow helper - Fix compilation error in test utilities Issue #14: Comprehensive error handling and validation
- Update all create_escrow calls to include &None deadline parameter - Ensure tests align with updated contract API Issue #14: Comprehensive error handling and validation
…L config - Add pre-flight checks for soroban and cargo CLI - Add contract verification step after deployment - Support configurable TTL, default fee, and treasury setup - Add comprehensive deployment status output Issue #17: Create deployment scripts and testnet configuration
- Add TTL configuration verification step - Add multi-step verification process - Improve output formatting for verification results Issue #17: Create deployment scripts and testnet configuration
- Update lock file to reflect dependency resolution - Ensures reproducible builds across environments
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 addresses issues #14, #15, #16, and #17 with comprehensive improvements to the StellFlow escrow smart contract.
closes #14 : Comprehensive Error Handling and Validation
closes Optimize storage usage and TTL management #15 : Optimize Storage Usage and TTL Management
closes Add events for all state transitions #16 : Events for All State Transitions
closes Create deployment scripts and testnet configuration #17 : Deployment Scripts and Testnet Configuration
Test Results
All 95 tests pass across 8 test files:
Files Changed
File Description
1 escrow/contracts/escrow/src/errors.rs Expanded error enum with 12 new variants
2 escrow/contracts/escrow/src/contract.rs Enhanced validation and admin functions
3 escrow/contracts/escrow/src/events.rs Detailed state transition events
4 escrow/contracts/escrow/src/storage.rs Configurable TTL and cleanup
5 escrow/contracts/escrow/src/types.rs Added EscrowTTL DataKey
6 escrow/contracts/escrow/src/lib.rs Fixed duplicate module declaration
7 escrow/contracts/escrow/src/testutils.rs Fixed test utilities
8 escrow/contracts/escrow/tests/create_escrow_tests.rs Updated test calls
9 scripts/deploy.sh Enhanced deployment script
10 scripts/verify.sh Enhanced verification script
11 escrow/Cargo.lock Updated dependencies