Closed leonardocustodio closed 3 weeks ago
Here are some key observations to aid the review process:
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪ |
🧪 No relevant tests |
🔒 No security concerns identified |
⚡ Recommended focus areas for review Code Clarity The comment on line 35 suggests a TODO that might be overlooked. Ensure that the reference to the external PR is either resolved or updated to reflect the current state of the code. |
Explore these optional code suggestions:
Category | Suggestion | Score |
Possible issue |
Ensure specialized codec instances are used for new codec types to handle specific encoding/decoding behaviors___ **Ensure that theProxyCodec instance is suitable for the new codec types added ('MinInflation', 'MaxInflation', 'Falloff', 'IdealStake', 'UseAuctionSlots'). If these types require specific encoding/decoding behaviors, consider implementing or using specialized codec instances for each.** [packages/substrate_metadata/lib/parsers/v14_parser.dart [32-40]](https://github.com/leonardocustodio/polkadart/pull/491/files#diff-55e21072d43e7d28703f4ae0fdf6b71eab55611036168bd13fb558d060d9eb77R32-R40) ```diff { final proxyCodec = ProxyCodec(); + final minInflationCodec = MinInflationCodec(); + final maxInflationCodec = MaxInflationCodec(); + final falloffCodec = FalloffCodec(); + final idealStakeCodec = IdealStakeCodec(); + final useAuctionSlotsCodec = UseAuctionSlotsCodec(); _resultingRegistry.addCodec('Call', proxyCodec); _resultingRegistry.addCodec('RuntimeCall', proxyCodec); - _resultingRegistry.addCodec('MinInflation', proxyCodec); - _resultingRegistry.addCodec('MaxInflation', proxyCodec); - _resultingRegistry.addCodec('Falloff', proxyCodec); - _resultingRegistry.addCodec('IdealStake', proxyCodec); - _resultingRegistry.addCodec('UseAuctionSlots', proxyCodec); + _resultingRegistry.addCodec('MinInflation', minInflationCodec); + _resultingRegistry.addCodec('MaxInflation', maxInflationCodec); + _resultingRegistry.addCodec('Falloff', falloffCodec); + _resultingRegistry.addCodec('IdealStake', idealStakeCodec); + _resultingRegistry.addCodec('UseAuctionSlots', useAuctionSlotsCodec); } ``` Suggestion importance[1-10]: 7Why: The suggestion addresses a potential issue where the same `ProxyCodec` instance is used for multiple codec types, which may not be suitable if these types require specific encoding/decoding behaviors. Implementing specialized codec instances for each type could enhance the functionality and correctness of the code. | 7 |
This PR fixes #490 while #487 is not finished and merged.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 48.48%. Comparing base (
ce390f2
) to head (da86640
). Report is 1 commits behind head on main.
PR Type
enhancement, configuration changes
Description
V14Parser
by adding new codecs to the_resultingRegistry
, includingMinInflation
,MaxInflation
,Falloff
,IdealStake
, andUseAuctionSlots
.pubspec.yaml
file to increment the package version to 1.2.3 and changed the homepage and repository URLs to a new GitHub location.PRDescriptionHeader.CHANGES_WALKTHROUGH
v14_parser.dart
Add new codecs to the V14Parser registry
packages/substrate_metadata/lib/parsers/v14_parser.dart
_resultingRegistry
.MinInflation
,MaxInflation
,Falloff
,IdealStake
,and
UseAuctionSlots
.pubspec.yaml
Update package version and repository information
packages/substrate_metadata/pubspec.yaml