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 hdwallet derive command line into new ioctl #3418

Merged
merged 22 commits into from
Jun 30, 2022

Conversation

LuckyPigeon
Copy link
Contributor

Description

Refactor hdwalletderive command in new ioctl, with the following note.

  • Output package is deprecated, replace it with errors package.
  • Replace fmt.Println with cmd.Println
  • Refactor unit test to cover the modification.

Fixes #3282

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

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

@LuckyPigeon
Copy link
Contributor Author

This PR will continue after #3283 merged.

ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/client.go Outdated Show resolved Hide resolved
ioctl/client.go Outdated Show resolved Hide resolved
ioctl/client.go Outdated Show resolved Hide resolved
ioctl/client.go Outdated Show resolved Hide resolved
ioctl/client.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 23, 2022

Codecov Report

Merging #3418 (71a0a44) into master (38fb852) will increase coverage by 0.13%.
The diff coverage is 94.28%.

@@            Coverage Diff             @@
##           master    #3418      +/-   ##
==========================================
+ Coverage   75.08%   75.21%   +0.13%     
==========================================
  Files         244      244              
  Lines       22546    22556      +10     
==========================================
+ Hits        16928    16965      +37     
+ Misses       4694     4666      -28     
- Partials      924      925       +1     
Impacted Files Coverage Δ
ioctl/newcmd/account/account.go 89.17% <87.50%> (ø)
ioctl/newcmd/hdwallet/hdwalletderive.go 94.87% <96.29%> (+94.87%) ⬆️

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 38fb852...71a0a44. Read the comment docs.

@LuckyPigeon LuckyPigeon marked this pull request as ready for review June 23, 2022 05:35
@LuckyPigeon LuckyPigeon requested a review from a team as a code owner June 23, 2022 05:35
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive_test.go Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
ioctl/newcmd/hdwallet/hdwalletderive.go Outdated Show resolved Hide resolved
@@ -160,7 +160,7 @@ func PrivateKeyFromSigner(client ioctl.Client, cmd *cobra.Command, signer, passw
if err != nil {
return nil, errors.Wrap(err, "invalid HDWallet key format")
}
Copy link
Member

Choose a reason for hiding this comment

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

why is it changed to client?

Copy link
Contributor Author

@LuckyPigeon LuckyPigeon Jun 29, 2022

Choose a reason for hiding this comment

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

I guess you're talking about HdwalletMnemonic.
The main reason is that we don't want to expose hdwalletConfigFile, so we add it in client struct, which makes all the related function also needs to be inside the client interface.

@CoderZhi CoderZhi merged commit a4b1098 into iotexproject:master Jun 30, 2022
pocockn added a commit to pocockn/iotex-core that referenced this pull request Jul 4, 2022
* upstream/master: (24 commits)
  account type with zero init nonce (iotexproject#3387)
  [api] Separate Server and Server Handler (iotexproject#3485)
  [ioctl] Build hdwallet derive command line into new ioctl (iotexproject#3418)
  [ioctl] Build hdwallet create command line into new ioctl (iotexproject#3470)
  [makefile] add go mod tidy (iotexproject#3471)
  [api] update chain metrics (iotexproject#3484)
  remove config.EVMNetworkID() (iotexproject#3460)
  [filedao] remove checkMasterChainDBFile() (iotexproject#3463)
  [api] add crashlog (iotexproject#3456)
  [api] Move generateBlockMeta to grpcserver.go (iotexproject#3303)
  [ioctl] Build action hash command line into new ioctl (iotexproject#3425)
  [ioctl] Build hdwallet export command line into new ioctl (iotexproject#3423)
  [ioctl] Refactor nodereward command in new ioctl (iotexproject#3416)
  [ioctl] Cleanup TestNewNodeDelegateCmd (iotexproject#3421)
  [blockchain] Remove BoltDBDaoOption (iotexproject#3465)
  remove InMemDaoOption (iotexproject#3464)
  [action] add evm london test (iotexproject#3402)
  [ioctl] create main for ioctl/newcmd (iotexproject#3296)
  [ioctl] Build block bucket command line into new ioctl (iotexproject#3386)
  [ioctl] Build hdwallet import command line into new ioctl (iotexproject#3419)
  ...
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 hdwallet derive command line into new ioctl
4 participants