diff --git a/cmd/geth/dbcmd.go b/cmd/geth/dbcmd.go index af73d08684c9..3d65f927d4cf 100644 --- a/cmd/geth/dbcmd.go +++ b/cmd/geth/dbcmd.go @@ -187,9 +187,6 @@ WARNING: This is a low-level operation which may cause database corruption!`, utils.DataDirFlag, utils.SyncModeFlag, utils.MainnetFlag, - utils.RopstenFlag, - utils.RinkebyFlag, - utils.GoerliFlag, }, Description: "The import command imports the specific chain data from an RLP encoded stream.", } @@ -202,9 +199,6 @@ WARNING: This is a low-level operation which may cause database corruption!`, utils.DataDirFlag, utils.SyncModeFlag, utils.MainnetFlag, - utils.RopstenFlag, - utils.RinkebyFlag, - utils.GoerliFlag, }, Description: "Exports the specified chain data to an RLP encoded stream, optionally gzip-compressed.", } diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 2b10183596ab..255572f8b04b 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -147,6 +147,10 @@ var ( Name: "testnet", Usage: "Testnet network: pre-configured proof-of-authority shortlived test network.", } + SepoliaFlag = cli.BoolFlag{ + Name: "sepolia", + Usage: "Sepolia network: pre-configured proof-of-work test network", + } DeveloperFlag = cli.BoolFlag{ Name: "dev", Usage: "Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled", @@ -782,6 +786,9 @@ func MakeDataDir(ctx *cli.Context) string { if ctx.GlobalBool(TestnetFlag.Name) { return filepath.Join(path, "testnet") } + if ctx.GlobalBool(SepoliaFlag.Name) { + return filepath.Join(path, "sepolia") + } return path } Fatalf("Cannot determine default data directory, please set manually (--datadir)") diff --git a/core/genesis_test.go b/core/genesis_test.go index 7dc024e75b8a..018ee281fe57 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -153,21 +153,22 @@ func TestSetupGenesis(t *testing.T) { } } -// TestGenesisHashes checks the congruity of default genesis data to corresponding hardcoded genesis hash values. +// TestGenesisHashes checks the congruity of default genesis data to +// corresponding hardcoded genesis hash values. func TestGenesisHashes(t *testing.T) { - cases := []struct { + for i, c := range []struct { genesis *Genesis - hash common.Hash + want common.Hash }{ - { - genesis: DefaultGenesisBlock(), - hash: params.MainnetGenesisHash, - }, - } - for i, c := range cases { - b := c.genesis.MustCommit(rawdb.NewMemoryDatabase()) - if got := b.Hash(); got != c.hash { - t.Errorf("case: %d, want: %s, got: %s", i, c.hash.Hex(), got.Hex()) + {DefaultGenesisBlock(), params.MainnetGenesisHash}, + } { + // Test via MustCommit + if have := c.genesis.MustCommit(rawdb.NewMemoryDatabase()).Hash(); have != c.want { + t.Errorf("case: %d a), want: %s, got: %s", i, c.want.Hex(), have.Hex()) + } + // Test via ToBlock + if have := c.genesis.ToBlock(nil).Hash(); have != c.want { + t.Errorf("case: %d a), want: %s, got: %s", i, c.want.Hex(), have.Hex()) } } }