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

Add Cadence V0.42->V1.0 Update Checker to staging #1469

Merged
merged 22 commits into from
Mar 29, 2024

Conversation

jribbink
Copy link
Contributor

@jribbink jribbink commented Mar 21, 2024

Closes #1453

Description

Validates your proposed contract update against other staged contracts on chain.

Screen Shot 2024-03-27 at 4 48 17 PM

For contributor use:

  • 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-commenter
Copy link

codecov-commenter commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 51.41509% with 103 lines in your changes are missing coverage. Please review.

Project coverage is 42.32%. Comparing base (20252b7) to head (1a952cc).
Report is 5 commits behind head on feature/stable-cadence.

Files Patch % Lines
internal/migrate/staging_validator.go 57.45% 63 Missing and 14 partials ⚠️
internal/migrate/stage_contract.go 7.14% 25 Missing and 1 partial ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##           feature/stable-cadence    #1469      +/-   ##
==========================================================
+ Coverage                   41.40%   42.32%   +0.92%     
==========================================================
  Files                          59       59              
  Lines                        3157     3324     +167     
==========================================================
+ Hits                         1307     1407     +100     
- Misses                       1664     1716      +52     
- Partials                      186      201      +15     
Flag Coverage Δ
unittests 42.32% <51.41%> (+0.92%) ⬆️

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.

@jribbink jribbink marked this pull request as ready for review March 28, 2024 19:24
@jribbink jribbink changed the title [WIP] Add Cadence V0.42->V1.0 Update Checker to staging Add Cadence V0.42->V1.0 Update Checker to staging Mar 28, 2024
@jribbink jribbink added the Improvement Technical work without new features, refactoring, improving tests label Mar 28, 2024

var _ error = &missingDependenciesError{}

var chainIdMap = map[string]flow.ChainID{
Copy link
Member

Choose a reason for hiding this comment

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

I've had to do this several times as well. I wonder if there is a way we could break this out to be reusable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, just a flowkit helper for converting flowkit chain id to flow-go chainid would be good enough here

}
}

func (v *stagingValidator) ValidateContractUpdate(
Copy link
Member

Choose a reason for hiding this comment

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

This is quite long. Thoughts on breaking this up for readability?

@jribbink jribbink merged commit e1ee767 into feature/stable-cadence Mar 29, 2024
5 checks passed
@jribbink jribbink deleted the jribbink/update-checker branch March 29, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Technical work without new features, refactoring, improving tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants