feat: deterministic timeout-based refund finalization (SC-W6-04) - #735
Conversation
|
@pharwasz 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! 🚀 |
sorry for the shortcomings, pls kindly approve workflow |
|
Sorry about the disturbance will get it done |
|
While working on this branch, I found 4 pre-existing test failures unrelated to the feature/logic changes here. These were issues in the test code itself, not the contract:
No contract/business logic was changed — all fixes are confined to |
Closes Pulsefy#565 Adds finalize_expired_escrow, a permissionless entrypoint that lets anyone finalize a refund once an escrow's timeout has passed -- previously only the owner could trigger a refund, so expired escrows had no path to resolution without manual action. Also adds is_refund_eligible for keepers/indexers to check eligibility before submitting a transaction. - Deterministic: pure now >= expires_at check, safe to call more than once - Boundary conditions covered by tests (just before/at/after expiry, disputed, already-spent, non-expiring, double-finalize) - Emits RefundFinalized event with expires_at so indexers can reconstruct availability
654c559 to
1a365f4
Compare
|
@Cedarich |
|
@Cedarich Can you confirm this is a known/tracked issue on main? If not I’m happy to open a separate PR bumping the count, just don’t want to bundle an unrelated fix into this one. Let me know how you’d like to proceed so I can get this merged. |
|
@pharwasz assert_eq!(EVENT_SCHEMAS.len(), 25);
assert_eq!(EVENT_SCHEMAS.len(), 26);It looks like the first assertion (expecting 25) was left behind when the new event was added. Please either remove the spurious |
Merging main introduced duplicate/stale assert_eq! lines for EVENT_SCHEMAS.len() (25 and 26), left over from a merge conflict. The actual schema count is 27 after main's oracle/emergency-mode/ fee-config event additions. Consolidated to a single correct assertion. All 353 tests pass, cargo fmt --all -- --check is clean.
Fixed, the duplicate/contradictory |
SC-W6-04: Refund Timeout Finalization
Closes #565
Adds
finalize_expired_escrow, a permissionless entrypoint that lets anyone finalize a refund once an escrow's timeout has passed — previously only the owner could trigger a refund, so expired escrows had no path to resolution without manual action. Also addsis_refund_eligiblefor keepers/indexers to check eligibility before submitting a transaction.now >= expires_atcheck, safe to call more than onceRefundFinalizedevent withexpires_atso indexers can reconstruct availabilitycargo test: 328 passing. 4 pre-existing failures unrelated to this change (dispute voting, privacy toggle, nonce ordering), same onmain, out of scope here.