-
Notifications
You must be signed in to change notification settings - Fork 137
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
Conversion to entitled type #2693
Conversation
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:feature/stable-cadence commit 07f5125 Collapsed results for better readability
|
…to sainati/entitlement-sets
Codecov Report
@@ Coverage Diff @@
## feature/stable-cadence #2693 +/- ##
==========================================================
+ Coverage 79.39% 79.40% +0.01%
==========================================================
Files 336 336
Lines 80145 80176 +31
==========================================================
+ Hits 63628 63663 +35
+ Misses 14215 14211 -4
Partials 2302 2302
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Obseleted by #2951 |
Part of the proposed migration in onflow/flips#95
Part of #2709
This implements and tests a function that converts types to entitled versions of themselves according to the rules described in the linked migration proposal. In particular:
ConvertToEntitledType
converts its input to an entitled type according to the following rules:ConvertToEntitledType(&T) ---> auth(Entitlements(T)) &T
ConvertToEntitledType(Capability<T>) ---> Capability<ConvertToEntitledType(T)>
ConvertToEntitledType(T?) ---> ConvertToEntitledType(T)?
ConvertToEntitledType(T) ---> T
where
Entitlements(T)
is defined as the result ofT.SupportedEntitlements()
Note that these are the only types converted by this function; an existing composite type will not have its fields or function types migrated. This is because in the migration, composite values are not going to be migrated; they will simply possess the required entitlements already by virtue of being owned. This does mean, however, that existing composite values with capability-typed fields will break. This is unfortunately unavoidable, as capability-typed fields cannot have their types changed anyways according to the contract updatability rules.
master
branchFiles changed
in the Github PR explorer