Use MaxEncodedLen for output buffer size#2128
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2128 +/- ##
==========================================
+ Coverage 53.62% 53.65% +0.02%
==========================================
Files 224 224
Lines 7053 7053
Branches 3117 3117
==========================================
+ Hits 3782 3784 +2
+ Misses 3271 3269 -2 ☔ View full report in Codecov by Sentry. |
🦑 📈 ink! Example Contracts ‒ Changes Report 📉 🦑These are the results when building the
Link to the run | Last update: Tue Feb 27 15:46:29 CET 2024 |
SkymanOne
approved these changes
Feb 27, 2024
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.
Suggestion by @pgherveou.
Use
MaxEncodedLen::max_encoded_len()instead of hardcoded sizes for allocating part of the buffer for the data of the return value of a host fn.This allows the types for
AccountIdandHashto be properly configurable, currently they are restricted to a max size of those hardcoded values.