mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-24 20:47:16 +00:00
bdb0155856
This reverts commit 4ebade3583
.
36 lines
880 B
Go
36 lines
880 B
Go
package commands
|
|
|
|
import (
|
|
"github.com/ledgerwatch/turbo-geth/cmd/utils"
|
|
"github.com/ledgerwatch/turbo-geth/ethdb"
|
|
"github.com/ledgerwatch/turbo-geth/internal/debug"
|
|
"github.com/ledgerwatch/turbo-geth/migrations"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var rootCmd = &cobra.Command{
|
|
Use: "integration",
|
|
Short: "long and heavy integration tests for turbo-geth",
|
|
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
|
if err := utils.SetupCobra(cmd); err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
if len(chaindata) > 0 {
|
|
db := ethdb.MustOpen(chaindata)
|
|
defer db.Close()
|
|
if err := migrations.NewMigrator().Apply(db, ""); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
},
|
|
PersistentPostRun: func(cmd *cobra.Command, args []string) {
|
|
defer utils.StopDebug()
|
|
},
|
|
}
|
|
|
|
func RootCommand() *cobra.Command {
|
|
utils.CobraFlags(rootCmd, append(debug.Flags, utils.MetricFlags...))
|
|
return rootCmd
|
|
}
|