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

Allow native composite types to be passed as script arguments #973

Merged
merged 5 commits into from
Jun 8, 2021

Conversation

SupunS
Copy link
Member

@SupunS SupunS commented Jun 3, 2021

Work towards #717

Description

  • Introduces an IsImportable method to check the importability as script arguments.
  • Add a pre-determined importable flag for native composite types
    • Some native composite types need to be constructed in a special manner, because their methods are coming from the host-enviornment.
    • It requires some additional work to allow them to be constructed via script arguments (not included in this PR)

  • 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

@SupunS SupunS self-assigned this Jun 3, 2021
@SupunS SupunS changed the title Supun/importable Allow native composite types to be passed as program arguments Jun 3, 2021
@SupunS SupunS force-pushed the supun/importable branch 5 times, most recently from bc4aa80 to 1be733b Compare June 4, 2021 04:43
@codecov-commenter
Copy link

codecov-commenter commented Jun 4, 2021

Codecov Report

Merging #973 (ccc652a) into master (7797f9f) will increase coverage by 0.06%.
The diff coverage is 76.92%.

❗ Current head ccc652a differs from pull request most recent head ae24da0. Consider uploading reports for the commit ae24da0 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #973      +/-   ##
==========================================
+ Coverage   75.46%   75.53%   +0.06%     
==========================================
  Files         268      268              
  Lines       32870    32918      +48     
==========================================
+ Hits        24805    24864      +59     
+ Misses       6929     6917      -12     
- Partials     1136     1137       +1     
Flag Coverage Δ
unittests 75.53% <76.92%> (+0.06%) ⬆️

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

Impacted Files Coverage Δ
runtime/errors.go 52.25% <0.00%> (-5.70%) ⬇️
runtime/interpreter/value.go 77.43% <0.00%> (-0.01%) ⬇️
runtime/sema/block.go 100.00% <ø> (ø)
runtime/sema/deployed_contract.go 73.33% <ø> (ø)
runtime/sema/meta_type.go 100.00% <ø> (ø)
runtime/sema/path_type.go 100.00% <ø> (ø)
runtime/sema/storable_type.go 100.00% <ø> (ø)
runtime/sema/string_type.go 100.00% <ø> (ø)
runtime/sema/type.go 88.03% <81.57%> (-0.11%) ⬇️
runtime/runtime.go 87.22% <100.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7797f9f...ae24da0. Read the comment docs.

@SupunS SupunS marked this pull request as ready for review June 4, 2021 05:45
@SupunS SupunS requested a review from turbolent as a code owner June 4, 2021 05:45
@SupunS SupunS force-pushed the supun/importable branch 2 times, most recently from 51f5ad9 to 7863d2e Compare June 4, 2021 08:47
runtime/interpreter/value.go Show resolved Hide resolved
runtime/sema/type.go Outdated Show resolved Hide resolved
runtime/sema/type.go Outdated Show resolved Hide resolved
runtime/sema/anyresource_type.go Outdated Show resolved Hide resolved
@SupunS SupunS force-pushed the supun/importable branch 2 times, most recently from 9381434 to 5ee6d34 Compare June 7, 2021 07:15
@SupunS SupunS changed the title Allow native composite types to be passed as program arguments Allow native composite types to be passed as script arguments Jun 7, 2021
runtime/sema/type.go Outdated Show resolved Hide resolved
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 work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants