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

Use correct EVM address in tests and transient networks #5255

Merged
merged 4 commits into from
Jan 22, 2024

Conversation

janezpodhostnik
Copy link
Contributor

@janezpodhostnik janezpodhostnik commented Jan 19, 2024

ref: #4964, #4959

What was done in this PR

  • A new system account (not a contract in this case) was introduced for EVM state storage.
  • The tests that use the EVM contract use the EVM account address from systemcontracts
  • only skip the storage check on the EVM storage account if EVM is actually enabled.

The EVM contract account will be the service account on all networks.
The EVM state storage account will be the fifth account on all transient networks. On non-transient networks an Account still has to be picked to serve that purpose.

@codecov-commenter
Copy link

codecov-commenter commented Jan 19, 2024

Codecov Report

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

Comparison is base (2b49cb0) 55.61% compared to head (ff27357) 55.66%.
Report is 4 commits behind head on master.

Files Patch % Lines
fvm/systemcontracts/system_contracts.go 88.23% 3 Missing and 1 partial ⚠️
fvm/evm/evm.go 76.92% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5255      +/-   ##
==========================================
+ Coverage   55.61%   55.66%   +0.04%     
==========================================
  Files         995      995              
  Lines       95485    95510      +25     
==========================================
+ Hits        53107    53161      +54     
+ Misses      38403    38378      -25     
+ Partials     3975     3971       -4     
Flag Coverage Δ
unittests 55.66% <87.93%> (+0.04%) ⬆️

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! LGTM

fvm/evm/evm.go Outdated
@@ -12,39 +12,48 @@ import (
"github.com/onflow/flow-go/model/flow"
)

func RootAccountAddress(chainID flow.ChainID) (flow.Address, error) {
func ContractAccountAddress(chainID flow.ChainID) (flow.Address, error) {
sc := systemcontracts.SystemContractsForChain(chainID)
return sc.EVM.Address, nil
Copy link
Member

Choose a reason for hiding this comment

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

Maybe also rename EVM to EVMContract, just like the EVM storage account is called EVMStorage

@janezpodhostnik janezpodhostnik added this pull request to the merge queue Jan 22, 2024
Merged via the queue into master with commit f496a55 Jan 22, 2024
51 checks passed
@janezpodhostnik janezpodhostnik deleted the janez/switch-evm-account branch January 22, 2024 15:34
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.

5 participants