MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / TestNodeSetAppVersion

Function TestNodeSetAppVersion

node/node_test.go:117–135  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

115}
116
117func TestNodeSetAppVersion(t *testing.T) {
118 config := cfg.ResetTestRoot("node_app_version_test")
119 defer os.RemoveAll(config.RootDir)
120
121 // create & start node
122 n, err := DefaultNewNode(config, log.TestingLogger())
123 require.NoError(t, err)
124
125 // default config uses the kvstore app
126 var appVersion uint64 = kvstore.ProtocolVersion
127
128 // check version is set in state
129 state, err := n.stateStore.Load()
130 require.NoError(t, err)
131 assert.Equal(t, state.Version.Consensus.App, appVersion)
132
133 // check version is set in node info
134 assert.Equal(t, n.nodeInfo.(p2p.DefaultNodeInfo).ProtocolVersion.App, appVersion)
135}
136
137func TestNodeSetPrivValTCP(t *testing.T) {
138 addr := "tcp://" + testFreeAddr(t)

Callers

nothing calls this directly

Calls 4

TestingLoggerFunction · 0.92
DefaultNewNodeFunction · 0.70
LoadMethod · 0.65
EqualMethod · 0.65

Tested by

no test coverage detected