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 migration to add a key to all service accounts #6096

Conversation

janezpodhostnik
Copy link
Contributor

Caution

Do Not Merge

This is an extra migration that adds a public key to all service accounts. The intended usage is for testing the migration of mainnet. This allows us to run transactions on the test migrated mainnet network to setup networking addresses and epoch related state.

@codecov-commenter
Copy link

codecov-commenter commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.71%. Comparing base (e3b8f92) to head (710bd3d).

Additional details and impacted files
@@                           Coverage Diff                           @@
##           feature/atree-inlining-cadence-v1.0    #6096      +/-   ##
=======================================================================
+ Coverage                                41.64%   43.71%   +2.06%     
=======================================================================
  Files                                     1974     1771     -203     
  Lines                                   139562   121059   -18503     
=======================================================================
- Hits                                     58125    52924    -5201     
+ Misses                                   75411    62688   -12723     
+ Partials                                  6026     5447     -579     
Flag Coverage Δ
unittests 43.71% <ø> (+2.06%) ⬆️

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.

@janezpodhostnik janezpodhostnik changed the base branch from master to feature/atree-inlining-cadence-v1.0 June 20, 2024 18:20
Copy link
Member

@fxamacker fxamacker left a comment

Choose a reason for hiding this comment

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

Nice! I left a couple of comments.

Comment on lines 564 to 567
migrators.NewAddKeyMigration(
opts.ChainID,
key,
),
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to move new migration AddKeyMigration before AccountUsageMigration since it adds public key to accounts?

cmd/util/ledger/migrations/add_key_migration.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.

Looks good! Maybe generate a report

chainID := flow.Emulator
sc := systemcontracts.SystemContractsForChain(chainID)

serviceRegisters := registersByAccount.AccountRegisters(string(sc.FlowServiceAccount.Address.Bytes()))
Copy link
Member

Choose a reason for hiding this comment

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

Maybe factor the repeated sc.FlowServiceAccount.Address into a variable

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