MCPcopy Create free account
hub / github.com/tendermint/tendermint / TestNodeSetPrivValIPC

Function TestNodeSetPrivValIPC

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

Source from the content-addressed store, hash-verified

177}
178
179func TestNodeSetPrivValIPC(t *testing.T) {
180 tmpfile := "/tmp/kms." + tmrand.Str(6) + ".sock"
181 defer os.Remove(tmpfile) // clean up
182
183 cfg, err := config.ResetTestRoot("node_priv_val_tcp_test")
184 require.NoError(t, err)
185 defer os.RemoveAll(cfg.RootDir)
186 cfg.PrivValidator.ListenAddr = "unix://" + tmpfile
187
188 dialer := privval.DialUnixFn(tmpfile)
189 dialerEndpoint := privval.NewSignerDialerEndpoint(
190 log.TestingLogger(),
191 dialer,
192 )
193 privval.SignerDialerEndpointTimeoutReadWrite(100 * time.Millisecond)(dialerEndpoint)
194
195 pvsc := privval.NewSignerServer(
196 dialerEndpoint,
197 cfg.ChainID(),
198 types.NewMockPV(),
199 )
200
201 go func() {
202 err := pvsc.Start()
203 require.NoError(t, err)
204 }()
205 defer pvsc.Stop() //nolint:errcheck // ignore for tests
206 n := getTestNode(t, cfg, log.TestingLogger())
207 assert.IsType(t, &privval.RetrySignerClient{}, n.PrivValidator())
208}
209
210// testFreeAddr claims a free port so we don't block on listener being ready.
211func testFreeAddr(t *testing.T) string {

Callers

nothing calls this directly

Calls 13

ResetTestRootFunction · 0.92
DialUnixFnFunction · 0.92
NewSignerDialerEndpointFunction · 0.92
TestingLoggerFunction · 0.92
NewSignerServerFunction · 0.92
NewMockPVFunction · 0.92
getTestNodeFunction · 0.85
PrivValidatorMethod · 0.80
RemoveMethod · 0.65
ChainIDMethod · 0.65
StartMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…