Skip to content

Conversation

@millken
Copy link
Contributor

@millken millken commented Jul 7, 2022

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)
  • 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 7, 2022 02:18
@millken
Copy link
Contributor Author

millken commented Jul 7, 2022

Config moved to a separate folder is to prevent circular imports

@codecov
Copy link

codecov bot commented Jul 7, 2022

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.

@Liuhaai
Copy link
Member

Liuhaai commented Jul 7, 2022

  1. move the default config of consensus to consensus pkg
    then, default value could be imported in config.go like

    Genesis: genesis.Default,

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

"time"

"github.com/iotexproject/iotex-core/blockchain/genesis"
"github.com/iotexproject/iotex-core/config"
Copy link
Contributor

@dustinxie dustinxie Jul 7, 2022

Choose a reason for hiding this comment

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

remove this dependency, by breaking inputs to NewConsensusConfig at L42
then we can put the new config.go directly under ./consensus, no need to create an extra folder

@millken
Copy link
Contributor Author

millken commented Jul 7, 2022

  1. move the default config of consensus to consensus pkg
    then, default value could be imported in config.go like
    Genesis: genesis.Default,
  2. config.go should be put under ./consensus folder.

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

@dustinxie
Copy link
Contributor

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

@dustinxie
Copy link
Contributor

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

3511 has merged, pls try again

@raullenchai
Copy link
Member

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

@millken millken closed this Dec 27, 2022
@millken millken deleted the issue3504 branch December 27, 2022 06:01
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.

move config.Consensus to consensus package

4 participants