-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use MaxEncodedLen
for output buffer size
#2128
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 |
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
AccountId
andHash
to be properly configurable, currently they are restricted to a max size of those hardcoded values.