feat(contracts): add multi-signer support for P-256 keys - #30
Closed
Andreschuks101 wants to merge 1 commit into
Closed
feat(contracts): add multi-signer support for P-256 keys#30Andreschuks101 wants to merge 1 commit into
Andreschuks101 wants to merge 1 commit into
Conversation
- Replace single-signer storage with Map<u32, BytesN<65>> under DataKey::Signers - Initial signer from init() stored at index 0 - add_signer() stores new key at next index, returns index (requires auth) - remove_signer() removes by index, rejects if last signer (CannotRemoveLastSigner) - __check_auth iterates all registered signers, short-circuits on first match - Add WalletError::CannotRemoveLastSigner and WalletError::SignerNotFound variants - Add unit tests: add signer, remove signer, reject last-signer removal, multi-key auth Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@Andreschuks101 is attempting to deploy a commit to the miracle656's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Andreschuks101 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Map<u32, BytesN<65>>underDataKey::Signersinit()is stored at index0add_signer(new_public_key: BytesN<65>) -> u32: stores new key at next available index, returns the index (requires contract auth)remove_signer(index: u32): removes signer by index, rejects withCannotRemoveLastSignerif it would leave zero signers__check_authto iterate all registered signer keys — short-circuits on first matchWalletError::CannotRemoveLastSigner(10) andWalletError::SignerNotFound(11) variantsMigration note
Existing wallets deployed before this change store signers under individual
DataKey::Signer(key)entries. A migration step would need to read those entries and populate the newDataKey::Signersmap. This is documented here for awareness.Test plan
cargo buildsucceedsCannotRemoveLastSigner)SignerNotFound)Closes #22