Fix getViews/resolveView mismatch and EVMBytesMetadata force-unwrap in ExampleNFT#264
Merged
joshuahannan merged 4 commits intomasterfrom Mar 11, 2026
Merged
Fix getViews/resolveView mismatch and EVMBytesMetadata force-unwrap in ExampleNFT#264joshuahannan merged 4 commits intomasterfrom
joshuahannan merged 4 commits intomasterfrom
Conversation
1. Add CrossVMMetadataViews.EVMPointer and EVMBytesMetadata to NFT.getViews() so callers can discover these views via the standard protocol instead of needing to query them directly. 2. Add CrossVMMetadataViews.EVMPointer to getContractViews() for the same reason. 3. Replace the double force-operation (as! followed by !) in the EVMBytesMetadata resolveView case with a safe as? cast and a descriptive panic, preventing a silent runtime crash if EVMBridgedMetadata is not resolvable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
turbolent
approved these changes
Mar 11, 2026
jribbink
approved these changes
Mar 11, 2026
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
CLAUDE.mdandAGENTS.mdwith more general guidanceNFT.getViews()was missingCrossVMMetadataViews.EVMPointerandCrossVMMetadataViews.EVMBytesMetadata, even thoughresolveViewhandled both. Callers following the standard protocol (callgetViews()first, thenresolveView) would never discover or request the cross-VM views, breaking EVM bridge metadata discoverability for collections following this pattern.getContractViews()was similarly missingCrossVMMetadataViews.EVMPointer.EVMBytesMetadatacase inresolveViewused a double force-operation (as!followed by!) that would silently panic at runtime ifEVMBridgedMetadatareturned nil. Replaced with a safeas?cast and a descriptive panic message.Test plan
testGetViewsnow asserts the two new cross-VM view types are present ingetViews()testGetExampleNFTViewsnow assertsEVMPointeris included ingetContractViews()make test)🤖 Generated with Claude Code