-
Notifications
You must be signed in to change notification settings - Fork 131
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
Improve cadence.Path #2427
Improve cadence.Path #2427
Conversation
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:master commit 79bba60 Collapsed results for better readability
|
Codecov Report
@@ Coverage Diff @@
## master #2427 +/- ##
==========================================
- Coverage 78.60% 78.60% -0.01%
==========================================
Files 316 316
Lines 68848 68854 +6
==========================================
+ Hits 54118 54120 +2
- Misses 12928 12931 +3
- Partials 1802 1803 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Description
Triggered by https://dapperlabs.slack.com/archives/C0447MS42KX/p1680724003020649
Improve type of
cadence.Path.domain
: Instead of stringly-typing, use the enum. That prevents representing invalid path valuesIn the
cadence.Path
constructor function, ensure the domain is known. This fixes a bug where a path with an invalid domain was not validated. e.g. see https://testnet.flowscan.org/transaction/c3eb670d0ac98d8a5ffda6e4be4f5b1d343d7829dab1eb5b610f93c016f6640b/scriptInstead of always returning the supertype
Path
for allcadence.Path
values, return an appropriate subtype, depending on the domain.The CLI uses the return value when preparing a deployment transaction.
When a user would pass e.g. a storage path as an argument to a contract initializer which expects a
StoragePath
, the CLI would prepare a transaction where the transaction parameter is justPath
.See e.g https://testnet.flowscan.org/transaction/e7419fd3c7b5ad429cedd23af2ec410ed4f0df63a84069034c6958b1efbf3321
master
branchFiles changed
in the Github PR explorer