-
Notifications
You must be signed in to change notification settings - Fork 138
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
Allow injection of functions into composite values, refactor PublicKey based on it #2878
Conversation
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:master commit c00aedc Collapsed results for better readability
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2878 +/- ##
=======================================
Coverage 79.42% 79.42%
=======================================
Files 334 334
Lines 79027 79049 +22
=======================================
+ Hits 62768 62788 +20
- Misses 13950 13952 +2
Partials 2309 2309
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Closes #2874
Description
The host might want composite values of certain types to have native functions. Add a function
SetCompositeValueFunctionsHandler
to the environment which allows that.Extend the
CompositeValue.GetMember
implementation, from only linking in interpreted functions, to also querying a handler set in the interpreter configuration.As the built-in
PublicKey
type has native functions (e.g.verify
) and is already implemented as aCompositeValue
, refactor its existing implementation from injecting the native functions at construction time, to using the new injection mechanism added in this PR.This essentially allows making the
PublicKey
type storable (in a follow-up PR), because the native functions get linked in even after a public key value got loaded from storage.PublicKey
values are not yet storable exactly because of this missing function injection feature.master
branchFiles changed
in the Github PR explorer