chore: add AccountCode::interface and use StorageMapKey in Account::get_map_item#3080
Merged
Conversation
Hoist the `AccountCodeInterface` construction onto `AccountCode` so `Account::code_interface` and `PartialAccount::code_interface` no longer duplicate the procedure-set collection and `expect` invariant. Addresses PR #2924 review comment r3392175548.
Strengthen the signature of `AccountStorage::get_map_item` from a raw `Word` to `StorageMapKey` so callers cannot accidentally pass an arbitrary word, and adjust call sites to use the existing `StorageMapKey` constructors (`from_index`, `from_raw`, `empty`).
Rename the `pub_key_hash: Word` field on `TransactionEvent::AuthRequest` to `pub_key_commitment: PublicKeyCommitment` so the event surfaces the domain newtype directly and the executor no longer has to wrap the raw word at the call site to the authenticator.
2481b18 to
ab93eae
Compare
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.
Implements a few small quality of life improvements:
AccountCode::interface(AccountId)so Account / PartialAccount code_interface() no longer duplicate construction (addresses feat: IntroduceAccountCodeInterface#2924 (comment)).AccountStorage::get_map_item's key asStorageMapKey. This was an oversight in an earlier refactor.TransactionEvent::AuthRequestfield topub_key_commitment: PublicKeyCommitment.