Repository navigation
Conversation
UnmarshalAssetType rejects values outside the defined asset types. MintAsset and UnmarshalGenesisInfo unmarshal the RPC asset type field through UnmarshalAssetType instead of a raw type conversion. unmarshalUniSyncStatsSort maps the RPC asset query sort field to its universe.SyncStatsSort counterpart and rejects unrecognized values. QueryAssetStats unmarshals its sort field through unmarshalUniSyncStatsSort instead of a raw type conversion.
GeorgeTsagk
reviewed
Nov 30, 2026
| case unirpc.AssetQuerySort_SORT_BY_ASSET_NAME: | ||
| return universe.SortByAssetName, nil | ||
|
|
||
| case unirpc.AssetQuerySort_SORT_BY_ASSET_ID: |
Member
There was a problem hiding this comment.
Use rows whose ID and type orders differ to test both sort modes through QueryAssetStats. Also assert that an unknown sort fails before querying the store.
| limit = universe.RequestPageSize | ||
| } | ||
|
|
||
| sortBy, err := unmarshalUniSyncStatsSort(req.SortBy) |
Member
There was a problem hiding this comment.
An unknown AssetTypeFilter silently turns this into an unfiltered query. Handle FILTER_ASSET_NONE explicitly and reject unknown values.
| "and group internal key descriptor") | ||
| } | ||
|
|
||
| assetType, err := rpcutils.UnmarshalAssetType(req.Asset.AssetType) |
Member
There was a problem hiding this comment.
Exercise the caller paths too. Assert that MintAsset rejects an unknown type before queueing and that group key request decoding rejects an unknown anchor asset type.
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.
Resolves #565.
I just happened to opportunistically pick this up while dredging through old issues; it improves some invalid-value handling and fixes an RPC/internal enum mismatch on universe.SyncStatsSort.