You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains 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
Ensure BitArray has a toJson method to prevent runtime errors
Ensure that the BitArray class has a toJson method implemented. If BitArray does not have a toJson method, this line will cause a runtime error when it is called. If the method is not implemented, consider adding a toJson method in the BitArray class or handling the serialization differently here.
} else if (value is BitArray) {
- return value.toJson();+ return value.toJson(); // Ensure `BitArray` has this method
Suggestion importance[1-10]: 9
Why: The suggestion correctly identifies a potential runtime error if the BitArray class does not implement a toJson method. Ensuring this method exists is crucial for the code to function correctly, making this a high-priority suggestion.
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.
User description
Fixes issue with toJson method.
PR Type
Bug fix
Description
BitArray
type in the_encodeJson
function.BitArray
objects are correctly converted to JSON using theirtoJson
method.Changes walkthrough 📝
to_json.dart
Add BitArray handling in JSON encoding function
packages/substrate_metadata/lib/utils/to_json.dart
BitArray
type in_encodeJson
function.BitArray
to JSON usingtoJson
method.