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

[ioctl] Build block bucketlist command line into new ioctl #3469

Merged
merged 28 commits into from
Jul 6, 2022

Conversation

LuckyPigeon
Copy link
Contributor

@LuckyPigeon LuckyPigeon commented Jun 24, 2022

Description

Build bcbucketlist command in new ioctl, with the following note.

  • Use client interface to construct the Cobra command.
  • Output package is deprecated, replace it with errors package.
  • Replace fmt.Println with cmd.Println
  • Global variables (config.ReadConfig config.DefaultConfigFile etc.) have been wrapped into client interface. Please use client interface to access them if needed
  • Refactor unit test to cover the modification.
  • Check results in each unit test.

Fixes #3266

Type of change

Please delete options that are not relevant.

  • Code refactor or improvement

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
  • TestNewBCBucketListCmd

Test Configuration:

  • Firmware version: Ubuntu 21.04
  • 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

@codecov
Copy link

codecov bot commented Jun 24, 2022

Codecov Report

Merging #3469 (dd616dd) into master (e956ca6) will increase coverage by 0.09%.
The diff coverage is 95.87%.

@@            Coverage Diff             @@
##           master    #3469      +/-   ##
==========================================
+ Coverage   75.33%   75.43%   +0.09%     
==========================================
  Files         246      247       +1     
  Lines       22748    22845      +97     
==========================================
+ Hits        17138    17233      +95     
  Misses       4685     4685              
- Partials      925      927       +2     
Impacted Files Coverage Δ
ioctl/newcmd/bc/bc.go 37.03% <82.60%> (+18.07%) ⬆️
ioctl/newcmd/bc/bcbucketlist.go 100.00% <100.00%> (ø)
db/trie/mptrie/branchnode.go 98.61% <0.00%> (+1.38%) ⬆️

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 e956ca6...dd616dd. Read the comment docs.

@LuckyPigeon LuckyPigeon marked this pull request as ready for review June 24, 2022 04:40
@LuckyPigeon LuckyPigeon requested a review from a team as a code owner June 24, 2022 04:40
ioctl/newcmd/bc/bcbucketlist.go Outdated Show resolved Hide resolved
ioctl/newcmd/bc/bcbucketlist.go Show resolved Hide resolved
ioctl/newcmd/bc/bcbucketlist.go Outdated Show resolved Hide resolved
ioctl/newcmd/bc/bcbucketlist.go Outdated Show resolved Hide resolved
ioctl/newcmd/bc/bcbucketlist.go Outdated Show resolved Hide resolved
ioctl/newcmd/bc/bc.go Outdated Show resolved Hide resolved
ioctl/newcmd/bc/bc.go Outdated Show resolved Hide resolved
ioctl/newcmd/bc/bc.go Outdated Show resolved Hide resolved
ioctl/newcmd/bc/bc.go Outdated Show resolved Hide resolved
ioctl/newcmd/bc/bc.go Outdated Show resolved Hide resolved
ioctl/newcmd/bc/bcbucketlist.go Outdated Show resolved Hide resolved
ioctl/newcmd/bc/bcbucketlist.go Outdated Show resolved Hide resolved
ioctl/newcmd/bc/bcbucketlist.go Outdated Show resolved Hide resolved
ioctl/newcmd/bc/bcbucketlist.go Outdated Show resolved Hide resolved
@huof6829
Copy link
Contributor

add test for GetBucketList

ioctl/newcmd/bc/bc_test.go Outdated Show resolved Hide resolved
ioctl/newcmd/bc/bc_test.go Outdated Show resolved Hide resolved
ioctl/newcmd/bc/bc_test.go Outdated Show resolved Hide resolved
@LuckyPigeon
Copy link
Contributor Author

@huof6829 Thanks for the fix!

@huof6829
Copy link
Contributor

huof6829 commented Jul 2, 2022

@huof6829 Thanks for the fix!

I add more test datas to cover more codes.

@Liuhaai Liuhaai merged commit a20e489 into iotexproject:master Jul 6, 2022
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)
  ...
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.

[ioctl] build block bucketlist command line into new ioctl
3 participants