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

Introduce toConstantSized to VariableSizedArray type #3028

Merged
merged 5 commits into from
Jan 19, 2024

Conversation

darkdrag00nv2
Copy link
Contributor

@darkdrag00nv2 darkdrag00nv2 commented Jan 17, 2024

Closes #2530

Description

Introduce toConstantSized function to VariableSizedArray type. This function will return a constant-sized array whose contents are copies of the original variable-sized array.

Since copy of values are involved, this is not available if the inner type of the variable-sized array is a resource.


  • 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

@darkdrag00nv2 darkdrag00nv2 changed the title Introduce toConstantSized to VariableSizedArray type Introduce toConstantSized to VariableSizedArray type Jan 17, 2024
Copy link

codecov bot commented Jan 17, 2024

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (23a0f59) 80.37% compared to head (a38010d) 80.38%.

Files Patch % Lines
runtime/interpreter/value.go 84.61% 6 Missing and 4 partials ⚠️
runtime/sema/type.go 95.71% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3028      +/-   ##
==========================================
+ Coverage   80.37%   80.38%   +0.01%     
==========================================
  Files         364      364              
  Lines       85173    85308     +135     
==========================================
+ Hits        68456    68578     +122     
- Misses      14275    14283       +8     
- Partials     2442     2447       +5     
Flag Coverage Δ
unittests 80.38% <90.37%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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!

runtime/sema/type.go Outdated Show resolved Hide resolved
runtime/sema/type.go Outdated Show resolved Hide resolved
@turbolent turbolent self-assigned this Jan 17, 2024
@turbolent
Copy link
Member

@onflow/cadence could you please have a look? it would be great to get this into the next release, it will make using the EVM API much easier

runtime/sema/type.go Outdated Show resolved Hide resolved
runtime/tests/interpreter/interpreter_test.go Show resolved Hide resolved
@darkdrag00nv2
Copy link
Contributor Author

Had to force push after resolving merge conflicts.

@turbolent turbolent merged commit b1869bb into onflow:master Jan 19, 2024
11 of 14 checks passed
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.

Allow conversion between constant-size and variable-size arrays
4 participants