Skip to content

Commit c098b33

Browse files
author
auxten
committed
Cleanup all conf.GConf.IsTestMode
1 parent 1835b4b commit c098b33

File tree

8 files changed

+19
-20
lines changed

8 files changed

+19
-20
lines changed

cmd/cql-minerd/node.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333

3434
func initNode() (server *rpc.Server, err error) {
3535
var masterKey []byte
36-
if !conf.GConf.IsTestMode {
36+
if !conf.GConf.UseTestMasterKey {
3737
// read master key
3838
fmt.Print("Type in Master key to continue: ")
3939
masterKey, err = terminal.ReadPassword(syscall.Stdin)

cmd/cql-observer/node.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030

3131
func initNode() (err error) {
3232
var masterKey []byte
33-
if !conf.GConf.IsTestMode {
33+
if !conf.GConf.UseTestMasterKey {
3434
fmt.Print("Type in Master key to continue:")
3535
masterKey, err = terminal.ReadPassword(syscall.Stdin)
3636
if err != nil {

cmd/cql-utils/confgen.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,16 @@ func runConfgen() {
7474
testnetConfig.PrivateKeyFile = privateKeyFileName
7575
testnetConfig.PubKeyStoreFile = publicKeystoreFileName
7676
testnetConfig.ThisNodeID = cliNodeID
77-
testnetConfig.KnownNodes = append(testnetConfig.KnownNodes, proto.Node{
77+
if testnetConfig.KnownNodes == nil {
78+
testnetConfig.KnownNodes = make([]proto.Node, 1)
79+
}
80+
testnetConfig.KnownNodes[0] = proto.Node{
7881
ID: cliNodeID,
7982
Role: proto.Client,
8083
Addr: "0.0.0.0:15151",
8184
PublicKey: publicKey,
8285
Nonce: nonce.Nonce,
83-
})
86+
}
8487

8588
// Write config
8689
out, err := yaml.Marshal(testnetConfig)

cmd/cqld/bootstrap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func runNode(nodeID proto.NodeID, listenAddr string) (err error) {
4747
}
4848

4949
var masterKey []byte
50-
if !conf.GConf.IsTestMode {
50+
if !conf.GConf.UseTestMasterKey {
5151
// read master key
5252
fmt.Print("Type in Master key to continue: ")
5353
masterKey, err = terminal.ReadPassword(syscall.Stdin)

sqlchain/chain_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,14 @@ func TestMultiChain(t *testing.T) {
206206
}
207207

208208
conf.GConf = &conf.Config{
209-
IsTestMode: true,
210-
GenerateKeyPair: false,
211-
WorkingRoot: testDataDir,
212-
PubKeyStoreFile: "public.keystore",
213-
PrivateKeyFile: "private.key",
214-
DHTFileName: "dht.db",
215-
ListenAddr: bpsvr.Listener.Addr().String(),
216-
ThisNodeID: bpinfo.NodeID,
209+
UseTestMasterKey: true,
210+
GenerateKeyPair: false,
211+
WorkingRoot: testDataDir,
212+
PubKeyStoreFile: "public.keystore",
213+
PrivateKeyFile: "private.key",
214+
DHTFileName: "dht.db",
215+
ListenAddr: bpsvr.Listener.Addr().String(),
216+
ThisNodeID: bpinfo.NodeID,
217217
ValidDNSKeys: map[string]string{
218218
"koPbw9wmYZ7ggcjnQ6ayHyhHaDNMYELKTqT+qRGrZpWSccr/lBcrm10Z1PuQHB3Azhii+sb0PYFkH1ruxLhe5g==": "cloudflare.com",
219219
"mdsswUyr3DPW132mOi8V9xESWE8jTo0dxCjjnopKl+GqJxpVXckHAeF+KkxLbxILfDLUT0rAK9iUzy1L53eKGQ==": "cloudflare.com",

sqlchain/observer/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestLoadConfig(t *testing.T) {
5757
})
5858
Convey("Given a config file without observer section", func() {
5959
err = ioutil.WriteFile(fl, []byte(
60-
`IsTestMode: true
60+
`UseTestMasterKey: true
6161
WorkingRoot: "./"
6262
PubKeyStoreFile: "public.keystore"
6363
PrivateKeyFile: "private.key"
@@ -184,7 +184,7 @@ KnownNodes:
184184
})
185185
Convey("Given a full config file", func() {
186186
err = ioutil.WriteFile(fl, []byte(
187-
`IsTestMode: true
187+
`UseTestMasterKey: true
188188
WorkingRoot: "./"
189189
PubKeyStoreFile: "public.keystore"
190190
PrivateKeyFile: "private.key"

test/integration/node_c/config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
UseTestMasterKey: true
2-
WorkingRoot: "./"
3-
PubKeyStoreFile: "public.keystore"
4-
PrivateKeyFile: "private.key"
5-
DHTFileName: "dht.db"
62
ListenAddr: "127.0.0.1:3120"
73
ThisNodeID: "00000f3b43288fe99831eb533ab77ec455d13e11fc38ec35a42d4edd17aa320d"
84

xenomint/mux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func setupMuxParallel(priv *ca.PrivateKey) (
7979
nis[2].Role = proto.Client
8080
// Setup global config
8181
conf.GConf = &conf.Config{
82-
IsTestMode: true,
82+
UseTestMasterKey: true,
8383
GenerateKeyPair: false,
8484
MinNodeIDDifficulty: testingNonceDifficulty,
8585
BP: &conf.BPInfo{

0 commit comments

Comments
 (0)