cmd: fix CLI package deprecation warnings
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user