Skip to content

Commit a89f609

Browse files
q9fenriquefynn
authored andcommitted
cmd: deprecate --testnet, use named networks instead (ethereum#20852)
* cmd/utils: make goerli the default testnet * cmd/geth: explicitly rename testnet to ropsten * core: explicitly rename testnet to ropsten * params: explicitly rename testnet to ropsten * cmd: explicitly rename testnet to ropsten * miner: explicitly rename testnet to ropsten * mobile: allow for returning the goerli spec * tests: explicitly rename testnet to ropsten * docs: update readme to reflect changes to the default testnet * mobile: allow for configuring goerli and rinkeby nodes * cmd/geth: revert --testnet back to ropsten and mark as legacy * cmd/util: mark --testnet flag as deprecated * docs: update readme to properly reflect the 3 testnets * cmd/utils: add an explicit deprecation warning on startup * cmd/utils: swap goerli and ropsten in usage * cmd/geth: swap goerli and ropsten in usage * cmd/geth: if running a known preset, log it for convenience * docs: improve readme on usage of ropsten's testnet datadir * cmd/utils: check if legacy `testnet` datadir exists for ropsten * cmd/geth: check for legacy testnet path in console command * cmd/geth: use switch statement for complex conditions in main * cmd/geth: move known preset log statement to the very top * cmd/utils: create new ropsten configurations in the ropsten datadir * cmd/utils: makedatadir should check for existing testnet dir * cmd/geth: add legacy testnet flag to the copy db command * cmd/geth: add legacy testnet flag to the inspect command
1 parent 55e6adc commit a89f609

File tree

17 files changed

+173
-83
lines changed

17 files changed

+173
-83
lines changed

README.md

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ This command will:
7272
This tool is optional and if you leave it out you can always attach to an already running
7373
`geth` instance with `geth attach`.
7474

75-
### A Full node on the Ethereum test network
75+
### A Full node on the Görli test network
7676

7777
Transitioning towards developers, if you'd like to play around with creating Ethereum
7878
contracts, you almost certainly would like to do that without any real money involved until
@@ -81,23 +81,24 @@ network, you want to join the **test** network with your node, which is fully eq
8181
the main network, but with play-Ether only.
8282

8383
```shell
84-
$ geth --testnet console
84+
$ geth --goerli console
8585
```
8686

8787
The `console` subcommand has the exact same meaning as above and they are equally
88-
useful on the testnet too. Please see above for their explanations if you've skipped here.
88+
useful on the testnet too. Please, see above for their explanations if you've skipped here.
8989

90-
Specifying the `--testnet` flag, however, will reconfigure your `geth` instance a bit:
90+
Specifying the `--goerli` flag, however, will reconfigure your `geth` instance a bit:
9191

92+
* Instead of connecting the main Ethereum network, the client will connect to the Görli
93+
test network, which uses different P2P bootnodes, different network IDs and genesis
94+
states.
9295
* Instead of using the default data directory (`~/.ethereum` on Linux for example), `geth`
93-
will nest itself one level deeper into a `testnet` subfolder (`~/.ethereum/testnet` on
96+
will nest itself one level deeper into a `goerli` subfolder (`~/.ethereum/goerli` on
9497
Linux). Note, on OSX and Linux this also means that attaching to a running testnet node
9598
requires the use of a custom endpoint since `geth attach` will try to attach to a
96-
production node endpoint by default. E.g.
97-
`geth attach <datadir>/testnet/geth.ipc`. Windows users are not affected by
99+
production node endpoint by default, e.g.,
100+
`geth attach <datadir>/goerli/geth.ipc`. Windows users are not affected by
98101
this.
99-
* Instead of connecting the main Ethereum network, the client will connect to the test
100-
network, which uses different P2P bootnodes, different network IDs and genesis states.
101102

102103
*Note: Although there are some internal protective measures to prevent transactions from
103104
crossing over between the main network and test network, you should make sure to always
@@ -107,17 +108,26 @@ accounts available between them.*
107108

108109
### Full node on the Rinkeby test network
109110

110-
The above test network is a cross-client one based on the ethash proof-of-work consensus
111-
algorithm. As such, it has certain extra overhead and is more susceptible to reorganization
112-
attacks due to the network's low difficulty/security. Go Ethereum also supports connecting
113-
to a proof-of-authority based test network called [*Rinkeby*](https://www.rinkeby.io)
114-
(operated by members of the community). This network is lighter, more secure, but is only
115-
supported by go-ethereum.
111+
Go Ethereum also supports connecting to the older proof-of-authority based test network
112+
called [*Rinkeby*](https://www.rinkeby.io) which is operated by members of the community.
116113

117114
```shell
118115
$ geth --rinkeby console
119116
```
120117

118+
### Full node on the Ropsten test network
119+
120+
In addition to Görli and Rinkeby, Geth also supports the ancient Ropsten testnet. The
121+
Ropsten test network is based on the Ethash proof-of-work consensus algorithm. As such,
122+
it has certain extra overhead and is more susceptible to reorganization attacks due to the
123+
network's low difficulty/security.
124+
125+
```shell
126+
$ geth --ropsten console
127+
```
128+
129+
*Note: Older Geth configurations store the Ropsten database in the `testnet` subdirectory.*
130+
121131
### Configuration
122132

123133
As an alternative to passing the numerous flags to the `geth` binary, you can also pass a

cmd/devp2p/nodesetcmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func ethFilter(args []string) (nodeFilter, error) {
164164
case "goerli":
165165
filter = forkid.NewStaticFilter(params.GoerliChainConfig, params.GoerliGenesisHash)
166166
case "ropsten":
167-
filter = forkid.NewStaticFilter(params.TestnetChainConfig, params.TestnetGenesisHash)
167+
filter = forkid.NewStaticFilter(params.RopstenChainConfig, params.RopstenGenesisHash)
168168
default:
169169
return nil, fmt.Errorf("unknown network %q", args[0])
170170
}

cmd/geth/chaincmd.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,10 @@ The export-preimages command export hash preimages to an RLP encoded stream`,
156156
utils.CacheFlag,
157157
utils.SyncModeFlag,
158158
utils.FakePoWFlag,
159-
utils.TestnetFlag,
159+
utils.RopstenFlag,
160160
utils.RinkebyFlag,
161+
utils.GoerliFlag,
162+
utils.LegacyTestnetFlag,
161163
},
162164
Category: "BLOCKCHAIN COMMANDS",
163165
Description: `
@@ -203,9 +205,10 @@ Use "ethereum dump 0" to dump the genesis block.`,
203205
utils.DataDirFlag,
204206
utils.AncientFlag,
205207
utils.CacheFlag,
206-
utils.TestnetFlag,
208+
utils.RopstenFlag,
207209
utils.RinkebyFlag,
208210
utils.GoerliFlag,
211+
utils.LegacyTestnetFlag,
209212
utils.SyncModeFlag,
210213
},
211214
Category: "BLOCKCHAIN COMMANDS",

cmd/geth/consolecmd.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,19 @@ func remoteConsole(ctx *cli.Context) error {
123123
path = ctx.GlobalString(utils.DataDirFlag.Name)
124124
}
125125
if path != "" {
126-
if ctx.GlobalBool(utils.TestnetFlag.Name) {
127-
path = filepath.Join(path, "testnet")
126+
if ctx.GlobalBool(utils.LegacyTestnetFlag.Name) || ctx.GlobalBool(utils.RopstenFlag.Name) {
127+
// Maintain compatibility with older Geth configurations storing the
128+
// Ropsten database in `testnet` instead of `ropsten`.
129+
legacyPath := filepath.Join(path, "testnet")
130+
if _, err := os.Stat(legacyPath); !os.IsNotExist(err) {
131+
path = legacyPath
132+
} else {
133+
path = filepath.Join(path, "ropsten")
134+
}
128135
} else if ctx.GlobalBool(utils.RinkebyFlag.Name) {
129136
path = filepath.Join(path, "rinkeby")
137+
} else if ctx.GlobalBool(utils.GoerliFlag.Name) {
138+
path = filepath.Join(path, "goerli")
130139
}
131140
}
132141
endpoint = fmt.Sprintf("%s/geth.ipc", path)

cmd/geth/main.go

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ var (
138138
utils.DNSDiscoveryFlag,
139139
utils.DeveloperFlag,
140140
utils.DeveloperPeriodFlag,
141-
utils.TestnetFlag,
141+
utils.LegacyTestnetFlag,
142+
utils.RopstenFlag,
142143
utils.RinkebyFlag,
143144
utils.GoerliFlag,
144145
utils.VMEnableDebugFlag,
@@ -258,10 +259,32 @@ func main() {
258259
// prepare manipulates memory cache allowance and setups metric system.
259260
// This function should be called before launching devp2p stack.
260261
func prepare(ctx *cli.Context) {
262+
// If we're running a known preset, log it for convenience.
263+
switch {
264+
case ctx.GlobalIsSet(utils.LegacyTestnetFlag.Name):
265+
log.Info("Starting Geth on Ropsten testnet...")
266+
log.Warn("The --testnet flag is ambiguous! Please specify one of --goerli, --rinkeby, or --ropsten.")
267+
log.Warn("The generic --testnet flag is deprecated and will be removed in the future!")
268+
269+
case ctx.GlobalIsSet(utils.RopstenFlag.Name):
270+
log.Info("Starting Geth on Ropsten testnet...")
271+
272+
case ctx.GlobalIsSet(utils.RinkebyFlag.Name):
273+
log.Info("Starting Geth on Rinkeby testnet...")
274+
275+
case ctx.GlobalIsSet(utils.GoerliFlag.Name):
276+
log.Info("Starting Geth on Görli testnet...")
277+
278+
case ctx.GlobalIsSet(utils.DeveloperFlag.Name):
279+
log.Info("Starting Geth in ephemeral dev mode...")
280+
281+
case !ctx.GlobalIsSet(utils.NetworkIdFlag.Name):
282+
log.Info("Starting Geth on Ethereum mainnet...")
283+
}
261284
// If we're a full node on mainnet without --cache specified, bump default cache allowance
262285
if ctx.GlobalString(utils.SyncModeFlag.Name) != "light" && !ctx.GlobalIsSet(utils.CacheFlag.Name) && !ctx.GlobalIsSet(utils.NetworkIdFlag.Name) {
263286
// Make sure we're not on any supported preconfigured testnet either
264-
if !ctx.GlobalIsSet(utils.TestnetFlag.Name) && !ctx.GlobalIsSet(utils.RinkebyFlag.Name) && !ctx.GlobalIsSet(utils.GoerliFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) {
287+
if !ctx.GlobalIsSet(utils.LegacyTestnetFlag.Name) && !ctx.GlobalIsSet(utils.RopstenFlag.Name) && !ctx.GlobalIsSet(utils.RinkebyFlag.Name) && !ctx.GlobalIsSet(utils.GoerliFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) {
265288
// Nope, we're really on mainnet. Bump that cache up!
266289
log.Info("Bumping default cache on mainnet", "provided", ctx.GlobalInt(utils.CacheFlag.Name), "updated", 4096)
267290
ctx.GlobalSet(utils.CacheFlag.Name, strconv.Itoa(4096))

cmd/geth/usage.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ var AppHelpFlagGroups = []flagGroup{
7272
utils.NoUSBFlag,
7373
utils.SmartCardDaemonPathFlag,
7474
utils.NetworkIdFlag,
75-
utils.TestnetFlag,
76-
utils.RinkebyFlag,
7775
utils.GoerliFlag,
76+
utils.RinkebyFlag,
77+
utils.RopstenFlag,
7878
utils.SyncModeFlag,
7979
utils.ExitWhenSyncedFlag,
8080
utils.GCModeFlag,
@@ -245,6 +245,7 @@ var AppHelpFlagGroups = []flagGroup{
245245
{
246246
Name: "DEPRECATED",
247247
Flags: []cli.Flag{
248+
utils.LegacyTestnetFlag,
248249
utils.LightLegacyServFlag,
249250
utils.LightLegacyPeersFlag,
250251
utils.MinerLegacyThreadsFlag,

cmd/utils/flags.go

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,24 @@ var (
162162
}
163163
NetworkIdFlag = cli.Uint64Flag{
164164
Name: "networkid",
165-
Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)",
165+
Usage: "Network identifier (integer, 1=Frontier, 3=Ropsten, 4=Rinkeby, 5=Görli)",
166166
Value: eth.DefaultConfig.NetworkId,
167167
}
168-
TestnetFlag = cli.BoolFlag{
168+
LegacyTestnetFlag = cli.BoolFlag{ // TODO(q9f): Remove after Ropsten is discontinued.
169169
Name: "testnet",
170-
Usage: "Ropsten network: pre-configured proof-of-work test network",
170+
Usage: "Pre-configured test network (Deprecated: Please choose one of --goerli, --rinkeby, or --ropsten.)",
171+
}
172+
GoerliFlag = cli.BoolFlag{
173+
Name: "goerli",
174+
Usage: "Görli network: pre-configured proof-of-authority test network",
171175
}
172176
RinkebyFlag = cli.BoolFlag{
173177
Name: "rinkeby",
174178
Usage: "Rinkeby network: pre-configured proof-of-authority test network",
175179
}
176-
GoerliFlag = cli.BoolFlag{
177-
Name: "goerli",
178-
Usage: "Görli network: pre-configured proof-of-authority test network",
180+
RopstenFlag = cli.BoolFlag{
181+
Name: "ropsten",
182+
Usage: "Ropsten network: pre-configured proof-of-work test network",
179183
}
180184
DeveloperFlag = cli.BoolFlag{
181185
Name: "dev",
@@ -759,7 +763,6 @@ var (
759763
Usage: "Comma-separated InfluxDB tags (key/values) attached to all measurements",
760764
Value: "host=localhost",
761765
}
762-
763766
EWASMInterpreterFlag = cli.StringFlag{
764767
Name: "vm.ewasm",
765768
Usage: "External ewasm configuration (default = built-in interpreter)",
@@ -774,11 +777,17 @@ var (
774777

775778
// MakeDataDir retrieves the currently requested data directory, terminating
776779
// if none (or the empty string) is specified. If the node is starting a testnet,
777-
// the a subdirectory of the specified datadir will be used.
780+
// then a subdirectory of the specified datadir will be used.
778781
func MakeDataDir(ctx *cli.Context) string {
779782
if path := ctx.GlobalString(DataDirFlag.Name); path != "" {
780-
if ctx.GlobalBool(TestnetFlag.Name) {
781-
return filepath.Join(path, "testnet")
783+
if ctx.GlobalBool(LegacyTestnetFlag.Name) || ctx.GlobalBool(RopstenFlag.Name) {
784+
// Maintain compatibility with older Geth configurations storing the
785+
// Ropsten database in `testnet` instead of `ropsten`.
786+
legacyPath := filepath.Join(path, "testnet")
787+
if _, err := os.Stat(legacyPath); !os.IsNotExist(err) {
788+
return legacyPath
789+
}
790+
return filepath.Join(path, "ropsten")
782791
}
783792
if ctx.GlobalBool(RinkebyFlag.Name) {
784793
return filepath.Join(path, "rinkeby")
@@ -836,8 +845,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
836845
} else {
837846
urls = splitAndTrim(ctx.GlobalString(BootnodesFlag.Name))
838847
}
839-
case ctx.GlobalBool(TestnetFlag.Name):
840-
urls = params.TestnetBootnodes
848+
case ctx.GlobalBool(LegacyTestnetFlag.Name) || ctx.GlobalBool(RopstenFlag.Name):
849+
urls = params.RopstenBootnodes
841850
case ctx.GlobalBool(RinkebyFlag.Name):
842851
urls = params.RinkebyBootnodes
843852
case ctx.GlobalBool(GoerliFlag.Name):
@@ -1240,8 +1249,16 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) {
12401249
cfg.DataDir = ctx.GlobalString(DataDirFlag.Name)
12411250
case ctx.GlobalBool(DeveloperFlag.Name):
12421251
cfg.DataDir = "" // unless explicitly requested, use memory databases
1243-
case ctx.GlobalBool(TestnetFlag.Name) && cfg.DataDir == node.DefaultDataDir():
1244-
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "testnet")
1252+
case (ctx.GlobalBool(LegacyTestnetFlag.Name) || ctx.GlobalBool(RopstenFlag.Name)) && cfg.DataDir == node.DefaultDataDir():
1253+
// Maintain compatibility with older Geth configurations storing the
1254+
// Ropsten database in `testnet` instead of `ropsten`.
1255+
legacyPath := filepath.Join(node.DefaultDataDir(), "testnet")
1256+
if _, err := os.Stat(legacyPath); !os.IsNotExist(err) {
1257+
log.Warn("Using the deprecated `testnet` datadir. Future versions will store the Ropsten chain in `ropsten`.")
1258+
cfg.DataDir = legacyPath
1259+
} else {
1260+
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "ropsten")
1261+
}
12451262
case ctx.GlobalBool(RinkebyFlag.Name) && cfg.DataDir == node.DefaultDataDir():
12461263
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "rinkeby")
12471264
case ctx.GlobalBool(GoerliFlag.Name) && cfg.DataDir == node.DefaultDataDir():
@@ -1441,7 +1458,7 @@ func SetShhConfig(ctx *cli.Context, stack *node.Node, cfg *whisper.Config) {
14411458
// SetEthConfig applies eth-related command line flags to the config.
14421459
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
14431460
// Avoid conflicting network flags
1444-
CheckExclusive(ctx, DeveloperFlag, TestnetFlag, RinkebyFlag, GoerliFlag)
1461+
CheckExclusive(ctx, DeveloperFlag, LegacyTestnetFlag, RopstenFlag, RinkebyFlag, GoerliFlag)
14451462
CheckExclusive(ctx, LightLegacyServFlag, LightServeFlag, SyncModeFlag, "light")
14461463
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
14471464

@@ -1521,12 +1538,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
15211538

15221539
// Override any default configs for hard coded networks.
15231540
switch {
1524-
case ctx.GlobalBool(TestnetFlag.Name):
1541+
case ctx.GlobalBool(LegacyTestnetFlag.Name) || ctx.GlobalBool(RopstenFlag.Name):
15251542
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
15261543
cfg.NetworkId = 3
15271544
}
1528-
cfg.Genesis = core.DefaultTestnetGenesisBlock()
1529-
setDNSDiscoveryDefaults(cfg, params.KnownDNSNetworks[params.TestnetGenesisHash])
1545+
cfg.Genesis = core.DefaultRopstenGenesisBlock()
1546+
setDNSDiscoveryDefaults(cfg, params.KnownDNSNetworks[params.RopstenGenesisHash])
15301547
case ctx.GlobalBool(RinkebyFlag.Name):
15311548
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
15321549
cfg.NetworkId = 4
@@ -1708,8 +1725,8 @@ func MakeChainDatabase(ctx *cli.Context, stack *node.Node) ethdb.Database {
17081725
func MakeGenesis(ctx *cli.Context) *core.Genesis {
17091726
var genesis *core.Genesis
17101727
switch {
1711-
case ctx.GlobalBool(TestnetFlag.Name):
1712-
genesis = core.DefaultTestnetGenesisBlock()
1728+
case ctx.GlobalBool(LegacyTestnetFlag.Name) || ctx.GlobalBool(RopstenFlag.Name):
1729+
genesis = core.DefaultRopstenGenesisBlock()
17131730
case ctx.GlobalBool(RinkebyFlag.Name):
17141731
genesis = core.DefaultRinkebyGenesisBlock()
17151732
case ctx.GlobalBool(GoerliFlag.Name):

core/forkid/forkid_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ func TestCreation(t *testing.T) {
6565
},
6666
// Ropsten test cases
6767
{
68-
params.TestnetChainConfig,
69-
params.TestnetGenesisHash,
68+
params.RopstenChainConfig,
69+
params.RopstenGenesisHash,
7070
[]testcase{
7171
{0, ID{Hash: checksumToBytes(0x30c7ddbc), Next: 10}}, // Unsynced, last Frontier, Homestead and first Tangerine block
7272
{9, ID{Hash: checksumToBytes(0x30c7ddbc), Next: 10}}, // Last Tangerine block

core/genesis.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,12 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
246246
return g.Config
247247
case ghash == params.MainnetGenesisHash:
248248
return params.MainnetChainConfig
249-
case ghash == params.TestnetGenesisHash:
250-
return params.TestnetChainConfig
249+
case ghash == params.RopstenGenesisHash:
250+
return params.RopstenChainConfig
251+
case ghash == params.RinkebyGenesisHash:
252+
return params.RinkebyChainConfig
253+
case ghash == params.GoerliGenesisHash:
254+
return params.GoerliChainConfig
251255
default:
252256
return params.AllEthashProtocolChanges
253257
}
@@ -347,15 +351,15 @@ func DefaultGenesisBlock() *Genesis {
347351
}
348352
}
349353

350-
// DefaultTestnetGenesisBlock returns the Ropsten network genesis block.
351-
func DefaultTestnetGenesisBlock() *Genesis {
354+
// DefaultRopstenGenesisBlock returns the Ropsten network genesis block.
355+
func DefaultRopstenGenesisBlock() *Genesis {
352356
return &Genesis{
353-
Config: params.TestnetChainConfig,
357+
Config: params.RopstenChainConfig,
354358
Nonce: 66,
355359
ExtraData: hexutil.MustDecode("0x3535353535353535353535353535353535353535353535353535353535353535"),
356360
GasLimit: 16777216,
357361
Difficulty: big.NewInt(1048576),
358-
Alloc: decodePrealloc(testnetAllocData),
362+
Alloc: decodePrealloc(ropstenAllocData),
359363
}
360364
}
361365

core/genesis_alloc.go

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

core/genesis_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ func TestDefaultGenesisBlock(t *testing.T) {
3535
if block.Hash() != params.MainnetGenesisHash {
3636
t.Errorf("wrong mainnet genesis hash, got %v, want %v", block.Hash(), params.MainnetGenesisHash)
3737
}
38-
block = DefaultTestnetGenesisBlock().ToBlock(nil)
39-
if block.Hash() != params.TestnetGenesisHash {
40-
t.Errorf("wrong testnet genesis hash, got %v, want %v", block.Hash(), params.TestnetGenesisHash)
38+
block = DefaultRopstenGenesisBlock().ToBlock(nil)
39+
if block.Hash() != params.RopstenGenesisHash {
40+
t.Errorf("wrong ropsten genesis hash, got %v, want %v", block.Hash(), params.RopstenGenesisHash)
4141
}
4242
}
4343

@@ -95,14 +95,14 @@ func TestSetupGenesis(t *testing.T) {
9595
wantConfig: customg.Config,
9696
},
9797
{
98-
name: "custom block in DB, genesis == testnet",
98+
name: "custom block in DB, genesis == ropsten",
9999
fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) {
100100
customg.MustCommit(db)
101-
return SetupGenesisBlock(db, DefaultTestnetGenesisBlock())
101+
return SetupGenesisBlock(db, DefaultRopstenGenesisBlock())
102102
},
103-
wantErr: &GenesisMismatchError{Stored: customghash, New: params.TestnetGenesisHash},
104-
wantHash: params.TestnetGenesisHash,
105-
wantConfig: params.TestnetChainConfig,
103+
wantErr: &GenesisMismatchError{Stored: customghash, New: params.RopstenGenesisHash},
104+
wantHash: params.RopstenGenesisHash,
105+
wantConfig: params.RopstenChainConfig,
106106
},
107107
{
108108
name: "compatible config in DB",

0 commit comments

Comments
 (0)