diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-06-10 16:23:00 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-06-10 16:23:00 +0800 |
commit | 90e07b19abaa950eaaff2eecc4918b1d16ebbcaf (patch) | |
tree | c742c17da28dc67f41d9779eec0bc3427432e044 /cmd/geth/chaincmd.go | |
parent | 63d1d145e2b2c8db4106d87767842019492e0aea (diff) | |
download | dexon-90e07b19abaa950eaaff2eecc4918b1d16ebbcaf.tar.gz dexon-90e07b19abaa950eaaff2eecc4918b1d16ebbcaf.tar.zst dexon-90e07b19abaa950eaaff2eecc4918b1d16ebbcaf.zip |
cmd: fix CLI package deprecation warnings
Diffstat (limited to 'cmd/geth/chaincmd.go')
-rw-r--r-- | cmd/geth/chaincmd.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 3355b7a6a..076852ff2 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -72,7 +72,7 @@ Use "ethereum dump 0" to dump the genesis block. } ) -func importChain(ctx *cli.Context) { +func importChain(ctx *cli.Context) error { if len(ctx.Args()) != 1 { utils.Fatalf("This command requires an argument.") } @@ -84,9 +84,10 @@ func importChain(ctx *cli.Context) { utils.Fatalf("Import error: %v", err) } fmt.Printf("Import done in %v", time.Since(start)) + return nil } -func exportChain(ctx *cli.Context) { +func exportChain(ctx *cli.Context) error { if len(ctx.Args()) < 1 { utils.Fatalf("This command requires an argument.") } @@ -114,9 +115,10 @@ func exportChain(ctx *cli.Context) { utils.Fatalf("Export error: %v\n", err) } fmt.Printf("Export done in %v", time.Since(start)) + return nil } -func removeDB(ctx *cli.Context) { +func removeDB(ctx *cli.Context) error { confirm, err := console.Stdin.PromptConfirm("Remove local database?") if err != nil { utils.Fatalf("%v", err) @@ -132,9 +134,10 @@ func removeDB(ctx *cli.Context) { } else { fmt.Println("Operation aborted") } + return nil } -func upgradeDB(ctx *cli.Context) { +func upgradeDB(ctx *cli.Context) error { glog.Infoln("Upgrading blockchain database") chain, chainDb := utils.MakeChain(ctx) @@ -163,9 +166,10 @@ func upgradeDB(ctx *cli.Context) { os.Remove(exportFile) glog.Infoln("Import finished") } + return nil } -func dump(ctx *cli.Context) { +func dump(ctx *cli.Context) error { chain, chainDb := utils.MakeChain(ctx) for _, arg := range ctx.Args() { var block *types.Block @@ -182,12 +186,12 @@ func dump(ctx *cli.Context) { state, err := state.New(block.Root(), chainDb) if err != nil { utils.Fatalf("could not create new state: %v", err) - return } fmt.Printf("%s\n", state.Dump()) } } chainDb.Close() + return nil } // hashish returns true for strings that look like hashes. |