Skip to content

missing Index was added into MetadataModuleError struct (v14 only)#97

Closed
misnaged wants to merge 3 commits intosubscan-explorer:masterfrom
misnaged:feat/module_error_idx
Closed

missing Index was added into MetadataModuleError struct (v14 only)#97
misnaged wants to merge 3 commits intosubscan-explorer:masterfrom
misnaged:feat/module_error_idx

Conversation

@misnaged
Copy link

No description provided.

for _, v := range docs {
docsArr = append(docsArr, v.(string))
}
cm.Index = m.ProcessAndUpdateData("U8").(int)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will affect metadata parsing before v14

@misnaged misnaged requested a review from freehere107 August 23, 2025 02:09
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moduleErr.Index = variant.Index

@misnaged misnaged closed this Sep 1, 2025
@misnaged
Copy link
Author

misnaged commented Sep 1, 2025

closed, due to last updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants