Skip to content

fix: make claimVouchedHat idempotent for batch compatibility#116

Open
hudsonhrh wants to merge 1 commit intomainfrom
hudsonhrh/surat-v2
Open

fix: make claimVouchedHat idempotent for batch compatibility#116
hudsonhrh wants to merge 1 commit intomainfrom
hudsonhrh/surat-v2

Conversation

@hudsonhrh
Copy link
Member

Summary

Fixed batch UserOp compatibility issue where registerAndQuickJoinWithPasskey + claimVouchedHat for the same hat would revert on the second call.

Changed behavior: claimVouchedHat now returns early (no-op) if the user already wears the hat instead of reverting with "Already wearing hat".

Tests: Added two integration tests that verify the fix works end-to-end: testClaimVouchedHat_Idempotent and testQuickJoinThenClaimVouchedHat_NoConflict.

🤖 Generated with Claude Code

When registerAndQuickJoinWithPasskey and claimVouchedHat target the same hat in an executeBatch, the first call mints it and the second should be a no-op instead of reverting. Changed claimVouchedHat to return early if the user already wears the hat. Added two integration tests to verify the fix works end-to-end.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

Coverage Report

Metric Coverage
Lines 100.00% (0/0)
Statements 100.00% (0/0)
Branches 100.00% (0/0)
Functions 100.00% (0/0)
Coverage by file
File Lines Statements Branches Functions

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