diff options
author | Felix Lange <fjl@twurst.com> | 2016-03-03 08:09:16 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-04-12 21:58:01 +0800 |
commit | 46e8940b19fee9bc21767a1341c382fd9c9d572a (patch) | |
tree | 384b700810910857cd40e099aba0d5a525eec066 /cmd/geth/accountcmd.go | |
parent | 2dc20963e789c85bcc9170e15c0483e51ca42bfc (diff) | |
download | go-tangerine-46e8940b19fee9bc21767a1341c382fd9c9d572a.tar.gz go-tangerine-46e8940b19fee9bc21767a1341c382fd9c9d572a.tar.zst go-tangerine-46e8940b19fee9bc21767a1341c382fd9c9d572a.zip |
accounts: streamline API
- Manager.Accounts no longer returns an error.
- Manager methods take Account instead of common.Address.
- All uses of Account with unkeyed fields are converted.
Diffstat (limited to 'cmd/geth/accountcmd.go')
-rw-r--r-- | cmd/geth/accountcmd.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/cmd/geth/accountcmd.go b/cmd/geth/accountcmd.go index ec6de886f..b4c37cb86 100644 --- a/cmd/geth/accountcmd.go +++ b/cmd/geth/accountcmd.go @@ -23,7 +23,6 @@ import ( "github.com/codegangsta/cli" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" ) var ( @@ -166,17 +165,13 @@ nodes. func accountList(ctx *cli.Context) { accman := utils.MakeAccountManager(ctx) - accts, err := accman.Accounts() - if err != nil { - utils.Fatalf("Could not list accounts: %v", err) - } - for i, acct := range accts { + for i, acct := range accman.Accounts() { fmt.Printf("Account #%d: %x\n", i, acct) } } // tries unlocking the specified account a few times. -func unlockAccount(ctx *cli.Context, accman *accounts.Manager, address string, i int, passwords []string) (common.Address, string) { +func unlockAccount(ctx *cli.Context, accman *accounts.Manager, address string, i int, passwords []string) (accounts.Account, string) { account, err := utils.MakeAddress(accman, address) if err != nil { utils.Fatalf("Could not list accounts: %v", err) @@ -190,7 +185,7 @@ func unlockAccount(ctx *cli.Context, accman *accounts.Manager, address string, i } // All trials expended to unlock account, bail out utils.Fatalf("Failed to unlock account: %s", address) - return common.Address{}, "" + return accounts.Account{}, "" } // getPassPhrase retrieves the passwor associated with an account, either fetched |