Fixed geth/node and geth/params tests (#332)

This commit is contained in:
Ivan Tomilov 2017-09-19 14:40:43 +03:00 committed by GitHub
parent 477cd92585
commit 283ae3e7df
5 changed files with 19 additions and 18 deletions

View File

@ -118,14 +118,14 @@ func (s *ManagerTestSuite) TestReferences() {
func() (interface{}, error) {
return s.NodeManager.RPCClient(), nil
},
node.ErrNoRunningNode,
nil,
},
}
for _, testCase := range noNodeTests {
s.T().Log(testCase.name)
obj, err := testCase.initFn()
s.Nil(obj)
s.EqualError(err, testCase.expectedErr.Error())
s.Equal(testCase.expectedErr, err)
}
// test with node fully started

View File

@ -225,8 +225,8 @@ var loadConfigTestCases = []struct {
require.NoError(t, err)
require.True(t, nodeConfig.BootClusterConfig.Enabled, "boot cluster is expected to be enabled by default")
require.Equal(t, "91825fffecb5678167273955deaddbf03c26ae04287cfda61403c0bad5ceab8d", nodeConfig.BootClusterConfig.RootHash)
require.Equal(t, 259, nodeConfig.BootClusterConfig.RootNumber)
require.Equal(t, "673363514b866bbbaf1b94462203650e3b1a2d4fb498df33361458b465b61ca3", nodeConfig.BootClusterConfig.RootHash)
require.Equal(t, 395, nodeConfig.BootClusterConfig.RootNumber)
enodes := nodeConfig.BootClusterConfig.BootNodes
expectedEnodes := []string{
@ -275,8 +275,8 @@ var loadConfigTestCases = []struct {
func(t *testing.T, dataDir string, nodeConfig *params.NodeConfig, err error) {
require.NoError(t, err)
require.True(t, nodeConfig.BootClusterConfig.Enabled, "boot cluster is expected to be enabled by default")
require.Equal(t, "91825fffecb5678167273955deaddbf03c26ae04287cfda61403c0bad5ceab8d", nodeConfig.BootClusterConfig.RootHash)
require.Equal(t, 259, nodeConfig.BootClusterConfig.RootNumber)
require.Equal(t, "673363514b866bbbaf1b94462203650e3b1a2d4fb498df33361458b465b61ca3", nodeConfig.BootClusterConfig.RootHash)
require.Equal(t, 395, nodeConfig.BootClusterConfig.RootNumber)
enodes := nodeConfig.BootClusterConfig.BootNodes
expectedEnodes := []string{
@ -308,8 +308,8 @@ var loadConfigTestCases = []struct {
func(t *testing.T, dataDir string, nodeConfig *params.NodeConfig, err error) {
require.NoError(t, err)
require.True(t, nodeConfig.BootClusterConfig.Enabled, "boot cluster is expected to be enabled by default")
require.Equal(t, "rinkeby-dev", nodeConfig.BootClusterConfig.RootHash)
require.True(t, nodeConfig.BootClusterConfig.RootNumber >= 66)
require.Equal(t, "f946d8f4d46d5b8a68006485cef0d1583db4a45feab83661323d4d52000aa2db", nodeConfig.BootClusterConfig.RootHash)
require.Equal(t, 205, nodeConfig.BootClusterConfig.RootNumber)
enodes := nodeConfig.BootClusterConfig.BootNodes
expectedEnodes := []string{
@ -330,8 +330,8 @@ var loadConfigTestCases = []struct {
func(t *testing.T, dataDir string, nodeConfig *params.NodeConfig, err error) {
require.NoError(t, err)
require.True(t, nodeConfig.BootClusterConfig.Enabled, "boot cluster is expected to be enabled by default")
require.Equal(t, "rinkeby-prod", nodeConfig.BootClusterConfig.RootHash)
require.True(t, nodeConfig.BootClusterConfig.RootNumber >= 66)
require.Equal(t, "f946d8f4d46d5b8a68006485cef0d1583db4a45feab83661323d4d52000aa2db", nodeConfig.BootClusterConfig.RootHash)
require.Equal(t, 205, nodeConfig.BootClusterConfig.RootNumber)
enodes := nodeConfig.BootClusterConfig.BootNodes
expectedEnodes := []string{
@ -451,7 +451,8 @@ func TestConfigWriteRead(t *testing.T) {
refConfigData := LoadFromFile(refFile)
// ioutil.WriteFile(fmt.Sprintf("/tmp/chainId.%d.json", networkId), []byte(loadedConfigData), 0777) // ease updating new config
// Ease updating new config data.
//ioutil.WriteFile(fmt.Sprintf("/tmp/chainId.%d.json", networkId), []byte(loadedConfigData), 0777)
refConfigData = strings.Replace(refConfigData, "$TMPDIR", nodeConfig.DataDir, -1)
refConfigData = strings.Replace(refConfigData, "$VERSION", params.Version, -1)

View File

@ -61,4 +61,4 @@
"SwarmConfig": {
"Enabled": false
}
}
}

View File

@ -27,8 +27,8 @@
},
"BootClusterConfig": {
"Enabled": true,
"RootNumber": 66,
"RootHash": "rinkeby-dev",
"RootNumber": 205,
"RootHash": "f946d8f4d46d5b8a68006485cef0d1583db4a45feab83661323d4d52000aa2db",
"BootNodes": [
"enode://7512c8f6e7ffdcc723cf77e602a1de9d8cc2e8ad35db309464819122cd773857131aee390fec33894db13da730c8432bb248eed64039e3810e156e979b2847cb@51.15.78.243:30303",
"enode://1cc27a5a41130a5c8b90db5b2273dc28f7b56f3edfc0dcc57b665d451274b26541e8de49ea7a074281906a82209b9600239c981163b6ff85c3038a8e2bc5d8b8@51.15.68.93:30303",
@ -61,4 +61,4 @@
"SwarmConfig": {
"Enabled": false
}
}
}

View File

@ -27,8 +27,8 @@
},
"BootClusterConfig": {
"Enabled": true,
"RootNumber": 259,
"RootHash": "91825fffecb5678167273955deaddbf03c26ae04287cfda61403c0bad5ceab8d",
"RootNumber": 395,
"RootHash": "673363514b866bbbaf1b94462203650e3b1a2d4fb498df33361458b465b61ca3",
"BootNodes": [
"enode://7ab298cedc4185a894d21d8a4615262ec6bdce66c9b6783878258e0d5b31013d30c9038932432f70e5b2b6a5cd323bf820554fcb22fbc7b45367889522e9c449@51.15.63.93:30303",
"enode://f59e8701f18c79c5cbc7618dc7bb928d44dc2f5405c7d693dad97da2d8585975942ec6fd36d3fe608bfdc7270a34a4dd00f38cfe96b2baa24f7cd0ac28d382a1@51.15.79.88:30303",
@ -73,4 +73,4 @@
"SwarmConfig": {
"Enabled": false
}
}
}