iotex-core icon indicating copy to clipboard operation
iotex-core copied to clipboard

move config.Consensus to consensus package

Open millken opened this issue 2 years ago • 7 comments

Description

This PR contains changes for two issues

Fixes #3504 #3506

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)
  • [x] 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

  • [x] 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 avatar Jul 07 '22 02:07 millken

Config moved to a separate folder is to prevent circular imports

millken avatar Jul 07 '22 02:07 millken

Codecov Report

Merging #3507 (d6eaa2e) into master (a20e489) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3507   +/-   ##
=======================================
  Coverage   75.43%   75.43%           
=======================================
  Files         247      247           
  Lines       22845    22845           
=======================================
  Hits        17233    17233           
  Misses       4685     4685           
  Partials      927      927           
Impacted Files Coverage Δ
config/config.go 84.75% <ø> (ø)
consensus/consensusfsm/consensus_ttl.go 0.00% <ø> (ø)

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 a20e489...d6eaa2e. Read the comment docs.

codecov[bot] avatar Jul 07 '22 02:07 codecov[bot]

  1. move the default config of consensus to consensus pkg then, default value could be imported in config.go like https://github.com/iotexproject/iotex-core/blob/d6eaa2efddfc6691b0eebcb5a0d2a4c68f444597/config/config.go#L185

  2. config.go should be put under ./consensus folder.

Liuhaai avatar Jul 07 '22 04:07 Liuhaai

  1. move the default config of consensus to consensus pkg then, default value could be imported in config.go like https://github.com/iotexproject/iotex-core/blob/d6eaa2efddfc6691b0eebcb5a0d2a4c68f444597/config/config.go#L185
  2. config.go should be put under ./consensus folder.

I tried,but will get errors like import cycle not allowed

millken avatar Jul 07 '22 10:07 millken

put this on a brief hold, #3511 should solve the import cycle, try again after 3511 merges

dustinxie avatar Jul 07 '22 18:07 dustinxie

put this on a brief hold, #3511 should solve the import cycle, try again after 3511 merges

3511 has merged, pls try again

dustinxie avatar Jul 09 '22 00:07 dustinxie

put this on a brief hold, #3511 should solve the import cycle, try again after 3511 merges

3511 has merged, pls try again

@millken pls try again

raullenchai avatar Aug 20 '22 15:08 raullenchai