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 import command line into new ioctl #3419

Merged
merged 19 commits into from
Jun 20, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
replace hdWalletConfigFile with client interface
LuckyPigeon committed Jun 2, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b328361e5664e51615cd5e91488497ec30588a02
2 changes: 1 addition & 1 deletion ioctl/newcmd/hdwallet/hdwalletimport.go
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ func NewHdwalletImportCmd(client ioctl.Client) *cobra.Command {
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
_hdWalletConfigFile = config.ReadConfig.Wallet + "/hdwallet"
_hdWalletConfigFile = client.Config().Wallet + "/hdwallet"
if fileutil.FileExists(_hdWalletConfigFile) {
cmd.Println("Please run 'ioctl hdwallet delete' before import")
return nil
7 changes: 3 additions & 4 deletions ioctl/newcmd/hdwallet/hdwalletimport_test.go
Original file line number Diff line number Diff line change
@@ -18,10 +18,6 @@ import (
"github.com/iotexproject/iotex-core/test/mock/mock_ioctlclient"
)

const (
_testPath = "testNewAccount"
)

func TestNewNodeDelegateCmd(t *testing.T) {
require := require.New(t)
ctrl := gomock.NewController(t)
@@ -31,6 +27,9 @@ func TestNewNodeDelegateCmd(t *testing.T) {
password := "123"

client.EXPECT().SelectTranslation(gomock.Any()).Return("mockTranslationString", config.English).Times(4)
client.EXPECT().Config().Return(config.Config{
Wallet: config.ReadConfig.Wallet,
}).Times(2)

t.Run("import hdwallet", func(t *testing.T) {
client.EXPECT().ReadSecret().Return(mnemonic, nil)