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 config option to allow upgrading legacy contracts #553

Merged
merged 7 commits into from
Jan 26, 2024

Conversation

dsainati1
Copy link
Contributor

Part of onflow/cadence#2947

This adds a server config option to the emulator that allows it to parse old Cadence contracts when set, for the purposes of allowing users to test contract updates to Cadence 1.0


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

@dsainati1 dsainati1 self-assigned this Jan 24, 2024
@dsainati1 dsainati1 requested a review from SupunS January 24, 2024 20:18
@dsainati1
Copy link
Contributor Author

I am at a loss for how to do a good end to end test for this; I don't have a good way to generate old state to use as input for the test.

@dsainati1 dsainati1 changed the base branch from master to supun/update-deps January 24, 2024 21:37
@dsainati1 dsainati1 marked this pull request as ready for review January 25, 2024 16:11
@SupunS SupunS force-pushed the supun/update-deps branch from 5115cdb to f1971b5 Compare January 25, 2024 16:25
@sideninja
Copy link
Contributor

Please also add this flag to the readme

@@ -73,6 +73,8 @@ and if you plan to run the emulator with Docker you must use the environment var
| `--start-block-height` | `FLOW_STARTBLOCKHEIGHT` | `0` | Start block height to use when starting the network using 'testnet' or 'mainnet' as the chain-id |
| `--evm-enabled` | `FLOW_EVMENABLED` | `false` | Enable evm support |

| `--legacy-upgrade` | `FLOW_LEGACYUPGRADE` | `false` | Enable upgrading of legacy contracts |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do I need to do anything to get the docker flag here to work?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, not quite sure what you mean here, how is this related to Docker?

@dsainati1 dsainati1 mentioned this pull request Jan 26, 2024
6 tasks
go.mod Outdated Show resolved Hide resolved
Base automatically changed from supun/update-deps to master January 26, 2024 19:18
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!

@dsainati1 dsainati1 merged commit ce8332d into master Jan 26, 2024
3 checks passed
@dsainati1 dsainati1 deleted the sainati/legacy-deploy branch January 26, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants