diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-02-07 18:47:34 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-02-13 20:00:07 +0800 |
commit | fad5eb0a87abfc12812647344a26de8a43830182 (patch) | |
tree | a679f37933a85edade15ee69b385b6705cc94043 /cmd | |
parent | b3c0e9d3ccb0bb326646aea47dda391a9552b122 (diff) | |
download | dexon-fad5eb0a87abfc12812647344a26de8a43830182.tar dexon-fad5eb0a87abfc12812647344a26de8a43830182.tar.gz dexon-fad5eb0a87abfc12812647344a26de8a43830182.tar.bz2 dexon-fad5eb0a87abfc12812647344a26de8a43830182.tar.lz dexon-fad5eb0a87abfc12812647344a26de8a43830182.tar.xz dexon-fad5eb0a87abfc12812647344a26de8a43830182.tar.zst dexon-fad5eb0a87abfc12812647344a26de8a43830182.zip |
accounts, cmd, eth, internal, miner, node: wallets and HD APIs
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/geth/accountcmd.go | 17 | ||||
-rw-r--r-- | cmd/geth/main.go | 2 | ||||
-rw-r--r-- | cmd/gethrpctest/main.go | 2 | ||||
-rw-r--r-- | cmd/swarm/main.go | 2 | ||||
-rw-r--r-- | cmd/utils/flags.go | 2 |
5 files changed, 15 insertions, 10 deletions
diff --git a/cmd/geth/accountcmd.go b/cmd/geth/accountcmd.go index 3a0eb13e8..97a060e48 100644 --- a/cmd/geth/accountcmd.go +++ b/cmd/geth/accountcmd.go @@ -181,8 +181,13 @@ nodes. func accountList(ctx *cli.Context) error { stack := utils.MakeNode(ctx, clientIdentifier, gitCommit) - for i, acct := range stack.AccountManager().Accounts() { - fmt.Printf("Account #%d: {%x} %s\n", i, acct.Address, acct.URL) + + var index int + for _, wallet := range stack.AccountManager().Wallets() { + for _, account := range wallet.Accounts() { + fmt.Printf("Account #%d: {%x} %s\n", index, account.Address, account.URL) + index++ + } } return nil } @@ -276,7 +281,7 @@ func accountCreate(ctx *cli.Context) error { stack := utils.MakeNode(ctx, clientIdentifier, gitCommit) password := getPassPhrase("Your new account is locked with a password. Please give a password. Do not forget this password.", true, 0, utils.MakePasswordList(ctx)) - ks := stack.AccountManager().Backend(keystore.BackendType).(*keystore.KeyStore) + ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore) account, err := ks.NewAccount(password) if err != nil { utils.Fatalf("Failed to create account: %v", err) @@ -292,7 +297,7 @@ func accountUpdate(ctx *cli.Context) error { utils.Fatalf("No accounts specified to update") } stack := utils.MakeNode(ctx, clientIdentifier, gitCommit) - ks := stack.AccountManager().Backend(keystore.BackendType).(*keystore.KeyStore) + ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore) account, oldPassword := unlockAccount(ctx, ks, ctx.Args().First(), 0, nil) newPassword := getPassPhrase("Please give a new password. Do not forget this password.", true, 0, nil) @@ -315,7 +320,7 @@ func importWallet(ctx *cli.Context) error { stack := utils.MakeNode(ctx, clientIdentifier, gitCommit) passphrase := getPassPhrase("", false, 0, utils.MakePasswordList(ctx)) - ks := stack.AccountManager().Backend(keystore.BackendType).(*keystore.KeyStore) + ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore) acct, err := ks.ImportPreSaleKey(keyJson, passphrase) if err != nil { utils.Fatalf("%v", err) @@ -336,7 +341,7 @@ func accountImport(ctx *cli.Context) error { stack := utils.MakeNode(ctx, clientIdentifier, gitCommit) passphrase := getPassPhrase("Your new account is locked with a password. Please give a password. Do not forget this password.", true, 0, utils.MakePasswordList(ctx)) - ks := stack.AccountManager().Backend(keystore.BackendType).(*keystore.KeyStore) + ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore) acct, err := ks.ImportECDSA(key, passphrase) if err != nil { utils.Fatalf("Could not create the account: %v", err) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 2c4963cac..e324802b5 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -246,7 +246,7 @@ func startNode(ctx *cli.Context, stack *node.Node) { utils.StartNode(stack) // Unlock any account specifically requested - ks := stack.AccountManager().Backend(keystore.BackendType).(*keystore.KeyStore) + ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore) passwords := utils.MakePasswordList(ctx) accounts := strings.Split(ctx.GlobalString(utils.UnlockedAccountFlag.Name), ",") diff --git a/cmd/gethrpctest/main.go b/cmd/gethrpctest/main.go index 348eeebce..9e80ad05d 100644 --- a/cmd/gethrpctest/main.go +++ b/cmd/gethrpctest/main.go @@ -100,7 +100,7 @@ func MakeSystemNode(privkey string, test *tests.BlockTest) (*node.Node, error) { return nil, err } // Create the keystore and inject an unlocked account if requested - ks := stack.AccountManager().Backend(keystore.BackendType).(*keystore.KeyStore) + ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore) if len(privkey) > 0 { key, err := crypto.HexToECDSA(privkey) diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index 466b17f30..a7fc72d57 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -329,7 +329,7 @@ func getAccount(ctx *cli.Context, stack *node.Node) *ecdsa.PrivateKey { } // Otherwise try getting it from the keystore. am := stack.AccountManager() - ks := am.Backend(keystore.BackendType).(*keystore.KeyStore) + ks := am.Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore) return decryptStoreAccount(ks, keyid) } diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 1196a64b5..92eb05e32 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -726,7 +726,7 @@ func RegisterEthService(ctx *cli.Context, stack *node.Node, extra []byte) { if networks > 1 { Fatalf("The %v flags are mutually exclusive", netFlags) } - ks := stack.AccountManager().Backend(keystore.BackendType).(*keystore.KeyStore) + ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore) ethConf := ð.Config{ Etherbase: MakeEtherbase(ks, ctx), |