Repository navigation
feat: add escalationResponsePeriod option to update-dispute-resolver script - #1044
Conversation
…script Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, additive, well-validated, and the unit conversions and log labels were verified correct against the SDK and subgraph.
0 open findings
What changed in this PR
This PR adds a new optional -p, --escalationResponsePeriod <SECONDS> flag to the scripts/update-dispute-resolver.ts maintenance script, allowing an operator to update a dispute resolver's escalation response period via the CLI. The script converts the provided seconds to milliseconds and calls coreSDK.updateDisputeResolver(id, { escalationResponsePeriodInMS }), which internally converts back to seconds (msToSec) before encoding the on-chain transaction. The change is additive and preserves the existing behaviour when the flag is omitted.
Changes:
- Adds the
--escalationResponsePeriodcommander option (documented as seconds) with positive-integer validation. - Logs the dispute resolver's current escalation response period (in seconds, matching the subgraph/contract unit).
- Adds
updateEscalationResponsePeriodFn, invoked only when the option is provided, following the existing per-action helper pattern (addFeesFn,rmSellersFn, etc.).
| File | Description |
|---|---|
| scripts/update-dispute-resolver.ts | Adds the new CLI option, input validation, a current-value log line, and a helper that calls updateDisputeResolver with the seconds→ms converted value. |
Notes from verification:
- The seconds→ms (
× 1000) conversion round-trips exactly through the SDK'smsToSec(Math.floor(ms / 1000)), since the value is always a whole-second multiple of 1000, so no precision is lost. - The
(s)unit label on the current-value log is correct: the subgraph storesescalationResponsePerioddirectly from the contract in seconds. - The validation (
Number.isInteger+> 0) is robust against non-numeric and fractional inputs, and is actually stricter than the siblingcreate-dispute-resolver.tsscript. - The
-pshort flag does not collide with any existing option in this script. - Scripts under
scripts/have no unit-test framework, so no test coverage is expected here.
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
-p, --escalationResponsePeriod <SECONDS>toscripts/update-dispute-resolver.ts.coreSDK.updateDisputeResolver(id, { escalationResponsePeriodInMS })(seconds converted to ms); the value must be a positive integer.Test plan
-p 86400against a testing-env dispute resolver and confirm the tx and updated value🤖 Generated with Claude Code