Skip to content

fix: address counterparty requirements review#860

Closed
Matobi98 wants to merge 1 commit into
lnp2pBot:add-counterparty-requirementsfrom
Matobi98:fix/counterparty-review
Closed

fix: address counterparty requirements review#860
Matobi98 wants to merge 1 commit into
lnp2pBot:add-counterparty-requirementsfrom
Matobi98:fix/counterparty-review

Conversation

@Matobi98

@Matobi98 Matobi98 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Fixes for the review on the add-counterparty-requirements feature (this PR targets that branch, not main).

Findings addressed

  • [HIGH] Test coverage — new spec tests/bot/modules/orders/takeOrder.spec.ts for meetsCounterpartyRequirements: requirement met/unmet, legacy makers without requirements, boundary values (age == min, orders == min), and the NaN case.
  • [MED] Validation precedence — the requirements check now runs after validateTakeBuyOrder / validateTakeSellOrder, so a taker gets the real error ("order not available") instead of the requirements message.
  • [MED] Denial messagenot_meeting_requirements now interpolates the thresholds (min_days_using_bot, min_completed_orders) so the taker knows what they're missing. Updated across all 10 locales.
  • [LOW] Strict parsing — user input uses strict integer validation (rejects 5abc / 5.9), consistent with readNonNegativeInt.
  • [LOW] Deduplicationcounterpartyage and counterpartyorders are built from a single makeRequirementCommand factory; the default object and the magic caps (30/10) were extracted into named constants.
  • [LOW] Legacy users without created_at — explicit guard for the NaN case of getUserAge, documented as a deliberate decision.

Verification

  • tsc clean · eslint clean · 151 passing

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1383b720-448e-4e6c-9ecc-6c73d906dc34

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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