missing Index was added into MetadataModuleError struct (v14 only)#97
Closed
misnaged wants to merge 3 commits intosubscan-explorer:masterfrom
Closed
missing Index was added into MetadataModuleError struct (v14 only)#97misnaged wants to merge 3 commits intosubscan-explorer:masterfrom
misnaged wants to merge 3 commits intosubscan-explorer:masterfrom
Conversation
freehere107
requested changes
Aug 22, 2025
types/metadata.go
Outdated
| for _, v := range docs { | ||
| docsArr = append(docsArr, v.(string)) | ||
| } | ||
| cm.Index = m.ProcessAndUpdateData("U8").(int) |
Collaborator
There was a problem hiding this comment.
This will affect metadata parsing before v14
freehere107
requested changes
Aug 26, 2025
types/v14.go
Outdated
Comment on lines
+23
to
+35
| Errors []MetadataModuleErrorV14 `json:"errors"` | ||
| } | ||
| type MetadataModuleErrorV14 struct { | ||
| ScaleDecoder `json:"-"` | ||
| Index int `json:"index"` | ||
| } | ||
|
|
||
| func (m *MetadataModuleErrorV14) Init(data scaleBytes.ScaleBytes, option *ScaleDecoderOption) { | ||
| m.ScaleDecoder.Init(data, option) | ||
| } | ||
| func (m *MetadataModuleErrorV14) Process() { | ||
| cm := MetadataModuleErrorV14{} | ||
| cm.Index = m.ProcessAndUpdateData("U8").(int) |
Collaborator
There was a problem hiding this comment.
This method is not needed because the index is included in the metadata v14 Variants and does not need to be parsed again here.
types/v14.go
Outdated
| for _, variant := range variants.Variants { | ||
| moduleErr := MetadataModuleError{Name: variant.Name, Doc: variant.Docs} | ||
| moduleErrV14 := MetadataModuleErrorV14{Index: variant.Index} | ||
| moduleErr.Index = moduleErrV14.Index |
Collaborator
There was a problem hiding this comment.
moduleErr.Index = variant.Index
Author
|
closed, due to last updates |
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.
No description provided.