-
Notifications
You must be signed in to change notification settings - Fork 51
Update keeperBotShutter.ts: Allow - characters in justification field when decoding messages #2200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Fix decode to allow '-' characters in justification otherwise justification with '-' will spit an error
👷 Deploy request for kleros-v2-testnet pending review.Visit the deploys page to approve it
|
👷 Deploy request for kleros-v2-testnet-devtools pending review.Visit the deploys page to approve it
|
👷 Deploy request for kleros-v2-neo pending review.Visit the deploys page to approve it
|
WalkthroughThe decode function in the keeper bot shutter script is modified to handle messages with more than three separated parts. The validation changes from requiring exactly three parts to accepting three or more parts, with any additional segments after the second separator joined back into the justification field. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (1)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Previously, the implementation assumed that the decrypted message would always split into exactly three parts:
choice-salt-justification
This caused decoding to fail with Malformed decrypted message when the justification itself contained -, since message.split("-") produced more than three segments.
The new logic:
This preserves the existing format while making the decoder robust to justifications that include the separator which can be used in texts.
PR-Codex overview
This PR modifies the way the
messageis parsed in thekeeperBotShutter.tsfile. It changes the condition for validating the number of parts and adjusts how thejustificationis extracted from thepartsarray.Detailed summary
partsto capture all remaining elements intorest.justificationby joining therestarray with theSEPARATOR.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.