Skip to content

fix: prevent duplicate agent passport registration - #192

Open
brentthomas248 wants to merge 2 commits into
Bitcoindefi:mainfrom
brentthomas248:codex/grantfox-passport-12
Open

fix: prevent duplicate agent passport registration#192
brentthomas248 wants to merge 2 commits into
Bitcoindefi:mainfrom
brentthomas248:codex/grantfox-passport-12

Conversation

@brentthomas248

Copy link
Copy Markdown

Closes #12

Summary:

  • Add an AlreadyRegistered contract error for duplicate agent passport registration.
  • Reject an existing DataKey::Passport(agent_id) before proof verification can overwrite the stored attestation.
  • Preserve the existing passport when a second registration attempts to reuse the same agentId.
  • Add focused regression coverage for the duplicate-agent guard and keep the mixed batch InvalidProof case distinct from duplicate registration.

Tests:

  • cd contracts/agent-passport-validator && cargo test

@brentthomas248

Copy link
Copy Markdown
Author

Update after assignment: I pushed a format-only follow-up and re-ran verification on the current PR head.

Checks run locally from contracts/agent-passport-validator:

  • cargo fmt --check
  • cargo test (18 passed)
  • cargo clippy --all-targets (completed; warnings are the existing repo-wide Soroban event/test-style warnings)

This remains scoped to #12 and the PR body references Closes #12.

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.

Contract: verify_and_register silently overwrites an existing passport for the same agentId

1 participant