-
Notifications
You must be signed in to change notification settings - Fork 50
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
Update core contracts to latest stable cadence #382
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making all these changes! I really appreciate it. I just had a few comments and questions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! That was a lot of code to update, well done! 👏
Looks good in general 👍
Only really one suggestion throughout: Account.capabilities.borrow
can be used instead of get
+ borrow
06c9217
to
f6aaf58
Compare
f6aaf58
to
ebc1726
Compare
39bde78
to
cd2e762
Compare
cd2e762
to
fa9343b
Compare
25eca83
to
2daea3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 👏 So many files! 😮💨😰
Maybe run the parse
tool on all the transactions to at least check they're syntactically are OK: https://github.com/onflow/cadence/tree/master/runtime/cmd/parse.
Maybe also the check
tool can be run on the transactions?
transactions/idTableStaking/delegation/delegator_add_capability.cdc
Outdated
Show resolved
Hide resolved
transactions/lockedTokens/admin/custody_create_only_shared_account.cdc
Outdated
Show resolved
Hide resolved
transactions/lockedTokens/admin/custody_create_only_shared_account.cdc
Outdated
Show resolved
Hide resolved
I think the existing tests should already cover parsing/checking/interpreting all transactions/contracts. But unfortunately, not all tests are passing at the moment because not everything is migrated completely. (i.e. the base branch |
transactions/lockedTokens/admin/admin_create_shared_accounts.cdc
Outdated
Show resolved
Hide resolved
transactions/lockedTokens/admin/custody_create_account_with_lease_account.cdc
Outdated
Show resolved
Hide resolved
transactions/lockedTokens/admin/custody_create_only_lease_account.cdc
Outdated
Show resolved
Hide resolved
transactions/lockedTokens/admin/custody_create_only_shared_account.cdc
Outdated
Show resolved
Hide resolved
Co-authored-by: Bastian Müller <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to fix and improve some more things in 196c87a.
@SupunS Could you please have a look and check these manual/untested changes work and do not break anything?
There are a couple more things I noticed:
-
Some transactions still use restricted types:
- transactions/flowToken/scripts/get_balance.cdc
- transactions/flowToken/setup_account.cdc
-
TESTFlowStakingCollection
replacesaccess(self)
withpub
. Should beaccess(all)
now
In general, the use of the invalid import 0xFOO
syntax in Cadence programs prevents them from being parsed and checked by tools, and I also think not editable using IDEs / with the Language Server.
The imports should be changed to the supported, and standardized syntax (FLIP). Probably best in a separate, follow-up PR to not increase the scope of this PR.
67ea336
to
fdc1be6
Compare
@turbolent I re-generated the assets and tested with flow-go. Needed just one minor adjustment, and everything looks good: https://github.com/onflow/flow-go/actions/runs/6315719064/job/17148896286?pr=4762 |
I guess we can merge this PR at the current state, and do the remaining migrations in follow-up PRs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, looks good!
From what I can see in the test logs, only the state commitments are (expectedly) off
Yes, correct. |
No description provided.