Skip to content

feat: add escalationResponsePeriod option to update-dispute-resolver script - #1044

Merged
levalleux-ludo merged 1 commit into
mainfrom
feat/dr-script-escalation-response-period
Oct 13, 2026
Merged

levalleux-ludo merged 1 commit into
mainfrom
feat/dr-script-escalation-response-period

Conversation

@levalleux-ludo

@levalleux-ludo levalleux-ludo commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Adds -p, --escalationResponsePeriod <SECONDS> to scripts/update-dispute-resolver.ts.
  • When set, calls coreSDK.updateDisputeResolver(id, { escalationResponsePeriodInMS }) (seconds converted to ms); the value must be a positive integer.
  • Logs the current escalation response period alongside the other current values.
  • Behaviour is unchanged when the option is not provided.

Test plan

  • Run without the new option: same behaviour as before
  • Run with -p 86400 against a testing-env dispute resolver and confirm the tx and updated value

🤖 Generated with Claude Code

…script

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 08:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 --escalationResponsePeriod commander 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's msToSec (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 stores escalationResponsePeriod directly from the contract in seconds.
  • The validation (Number.isInteger + > 0) is robust against non-numeric and fractional inputs, and is actually stricter than the sibling create-dispute-resolver.ts script.
  • The -p short 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.

@levalleux-ludo
levalleux-ludo merged commit 53e5618 into main Oct 13, 2026
2 checks passed
@levalleux-ludo
levalleux-ludo deleted the feat/dr-script-escalation-response-period branch October 13, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants