Skip to content

fix(api): validate trait inputs in postCollectionOffer#1950

Merged
ryanio merged 1 commit intomainfrom
fix/validate-trait-inputs-postCollectionOffer
Mar 20, 2026
Merged

fix(api): validate trait inputs in postCollectionOffer#1950
ryanio merged 1 commit intomainfrom
fix/validate-trait-inputs-postCollectionOffer

Conversation

@ryanio
Copy link
Collaborator

@ryanio ryanio commented Mar 20, 2026

Summary

  • Closes the validation gap where postCollectionOffer accepted invalid/ambiguous trait inputs that buildOffer already rejected
  • Extracts a shared validateTraitParams() helper to eliminate code duplication (was ~44 lines copy-pasted in fix(api): validate trait inputs in postCollectionOffer #1947)
  • Adds regression tests for all validation cases on postCollectionOffer

Based on the work in #1947 by @lavidaloca26. The key improvement over the original PR is extracting the validation into a shared function rather than duplicating it.

Test plan

  • All 649 existing tests pass
  • New tests verify: mixed trait params rejected, incomplete single-trait params rejected, malformed trait objects rejected, numeric trait min/max bounds validated

🤖 Generated with Claude Code

Extract shared validateTraitParams helper used by both buildOffer and
postCollectionOffer, closing the validation gap where postCollectionOffer
accepted invalid/ambiguous trait inputs that buildOffer already rejected.

Co-Authored-By: Johnny Guitar <103390490+lavidaloca26@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ryanio ryanio merged commit 459e717 into main Mar 20, 2026
8 checks passed
@ryanio ryanio deleted the fix/validate-trait-inputs-postCollectionOffer branch March 20, 2026 21:24
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.

1 participant