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

[config] remove unused EvmNetworkID(),SetEVMNetworkID() #3503

Merged
merged 7 commits into from
Jul 6, 2022
Merged

[config] remove unused EvmNetworkID(),SetEVMNetworkID() #3503

merged 7 commits into from
Jul 6, 2022

Conversation

millken
Copy link
Contributor

@millken millken commented Jul 6, 2022

Description

remove unsed config funcs EvmNetworkID() SetEVMNetworkID()
Fixes #3502

Type of change

Please delete options that are not relevant.

  • [] Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • Code refactor or improvement
  • [] Breaking change (fix or feature that would cause a new or changed behavior of existing functionality)
  • [] This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • make test
  • [] fullsync
  • [] Other test (please specify)

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • [] My code follows the style guidelines of this project
  • [] I have performed a self-review of my code
  • [] I have commented my code, particularly in hard-to-understand areas
  • [] I have made corresponding changes to the documentation
  • [] My changes generate no new warnings
  • [] I have added tests that prove my fix is effective or that my feature works
  • [] New and existing unit tests pass locally with my changes
  • [] Any dependent changes have been merged and published in downstream modules

@millken millken requested a review from a team as a code owner July 6, 2022 05:12
@codecov
Copy link

codecov bot commented Jul 6, 2022

Codecov Report

Merging #3503 (6d9ad91) into master (9347fed) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3503      +/-   ##
==========================================
- Coverage   75.35%   75.34%   -0.01%     
==========================================
  Files         246      246              
  Lines       22754    22748       -6     
==========================================
- Hits        17146    17140       -6     
  Misses       4683     4683              
  Partials      925      925              
Impacted Files Coverage Δ
config/config.go 84.75% <ø> (-0.54%) ⬇️

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 9347fed...6d9ad91. Read the comment docs.

config/config.go Outdated
@@ -35,8 +34,7 @@ import (
// the default value in Default var.

var (
_evmNetworkID uint32
_loadChainID sync.Once
_loadChainID sync.Once
Copy link
Member

Choose a reason for hiding this comment

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

could it be removed as well?

@@ -108,18 +108,12 @@ func main() {
}
defer recovery.Recover()

// populdate chain ID
config.SetEVMNetworkID(cfg.Chain.EVMNetworkID)
if config.EVMNetworkID() == 0 {
Copy link
Member

@dustinxie dustinxie Jul 6, 2022

Choose a reason for hiding this comment

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

keep this check

if cfg.Chain.EVMNetworkID == 0

cfg.Genesis = genesisCfg
cfgToLog := cfg
cfgToLog.Chain.ProducerPrivKey = ""
cfgToLog.Network.MasterKey = ""
log.S().Infof("Config in use: %+v", cfgToLog)
log.S().Infof("EVM Network ID: %d, Chain ID: %d", config.EVMNetworkID(), cfg.Chain.ID)
Copy link
Member

Choose a reason for hiding this comment

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

keep this printout, the value is cfg.Chain.EVMNetworkID

@dustinxie dustinxie merged commit e956ca6 into iotexproject:master Jul 6, 2022
@millken millken deleted the issue3502 branch July 7, 2022 01:35
pocockn added a commit to pocockn/iotex-core that referenced this pull request Jul 19, 2022
* upstream/master: (28 commits)
  [ioctl] Incorrect conversion between integer types (iotexproject#3522)
  [action] fix incorrect conversion between integer types (iotexproject#3545)
  [test] fix TestLoadBlockchainfromDB (iotexproject#3521)
  [ioctl] correct Chinese usage message (iotexproject#3510)
  fix err not hanled (iotexproject#3509)
  add ReadHeaderTimeout (iotexproject#3539)
  [iotcl] Reset config cmd (iotexproject#3496)
  Update gosec.yaml
  Update ci.yaml
  Update analysis.yaml
  Delete gosec.yaml.bak
  Create gosec.yaml
  [config] move config.ActPool to actpool package refactor (iotexproject#3514)
  Update ci.yaml
  Update analysis.yaml
  Update analysis.yaml
  [config] move config.Chain to blockchain package (iotexproject#3511)
  remove circleci (iotexproject#3498)
  [ioctl] Build block bucketlist command line into new ioctl (iotexproject#3469)
  [config] remove  EVMNetworkID() and SetEVMNetworkID() (iotexproject#3503)
  ...
dustinxie added a commit that referenced this pull request Oct 5, 2022
Co-authored-by: dustinxie <dahuaxie@gmail.com>
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.

[config] remove global EvmNetworkID
3 participants