Skip to content
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

Implement check functionality in AuthAccount #2492

Merged
merged 7 commits into from
May 29, 2023

Conversation

darkdrag00nv2
Copy link
Contributor

@darkdrag00nv2 darkdrag00nv2 commented May 7, 2023

Closes #564
Work towards onflow/developer-grants#179

Description

Adds AuthAccount.check(storagePath) function to check if the type parameters can be used to create a reference for the object stored in the storage path.

TODO:

  • Tests
  • Documentation

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@codecov
Copy link

codecov bot commented May 7, 2023

Codecov Report

Merging #2492 (2757868) into master (326312c) will increase coverage by 0.00%.
The diff coverage is 91.11%.

@@           Coverage Diff           @@
##           master    #2492   +/-   ##
=======================================
  Coverage   78.45%   78.46%           
=======================================
  Files         336      336           
  Lines       76561    76606   +45     
=======================================
+ Hits        60068    60109   +41     
- Misses      14262    14264    +2     
- Partials     2231     2233    +2     
Flag Coverage Δ
unittests 78.46% <91.11%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
runtime/interpreter/interpreter.go 89.76% <87.50%> (-0.03%) ⬇️
runtime/interpreter/value_account.go 92.13% <100.00%> (+0.15%) ⬆️
runtime/sema/authaccount.gen.go 100.00% <100.00%> (ø)

@darkdrag00nv2 darkdrag00nv2 force-pushed the check_authaccount_564 branch from a6b7c4f to 235e9db Compare May 8, 2023 16:02
@darkdrag00nv2 darkdrag00nv2 marked this pull request as ready for review May 8, 2023 16:03
@darkdrag00nv2
Copy link
Contributor Author

This is ready for review now!

@darkdrag00nv2 darkdrag00nv2 requested a review from SupunS May 16, 2023 17:35
Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

We still might want to adjust the API (naming/type), but implementation looks good.

@darkdrag00nv2
Copy link
Contributor Author

@turbolent @dsainati1 @SupunS Ready for review now. Have updated the signature as per discussion.

Copy link
Member

@SupunS SupunS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

runtime/interpreter/interpreter.go Show resolved Hide resolved
@darkdrag00nv2 darkdrag00nv2 requested a review from SupunS May 24, 2023 17:07
@darkdrag00nv2 darkdrag00nv2 force-pushed the check_authaccount_564 branch from 53f9118 to 017b4bb Compare May 26, 2023 18:58
@darkdrag00nv2
Copy link
Contributor Author

Force push after resolving merge conflicts.

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@turbolent
Copy link
Member

@SupunS Could you please have a last look?

@turbolent turbolent merged commit b24a708 into onflow:master May 29, 2023
@darkdrag00nv2 darkdrag00nv2 deleted the check_authaccount_564 branch May 30, 2023 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add check functionality to AuthAccount
5 participants