(t *testing.T)
| 131 | } |
| 132 | |
| 133 | func TestNodeSetPrivValTCP(t *testing.T) { |
| 134 | addr := "tcp://" + testFreeAddr(t) |
| 135 | |
| 136 | cfg, err := config.ResetTestRoot("node_priv_val_tcp_test") |
| 137 | require.NoError(t, err) |
| 138 | defer os.RemoveAll(cfg.RootDir) |
| 139 | cfg.PrivValidator.ListenAddr = addr |
| 140 | |
| 141 | dialer := privval.DialTCPFn(addr, 100*time.Millisecond, ed25519.GenPrivKey()) |
| 142 | dialerEndpoint := privval.NewSignerDialerEndpoint( |
| 143 | log.TestingLogger(), |
| 144 | dialer, |
| 145 | ) |
| 146 | privval.SignerDialerEndpointTimeoutReadWrite(100 * time.Millisecond)(dialerEndpoint) |
| 147 | |
| 148 | signerServer := privval.NewSignerServer( |
| 149 | dialerEndpoint, |
| 150 | cfg.ChainID(), |
| 151 | types.NewMockPV(), |
| 152 | ) |
| 153 | |
| 154 | go func() { |
| 155 | err := signerServer.Start() |
| 156 | if err != nil { |
| 157 | panic(err) |
| 158 | } |
| 159 | }() |
| 160 | defer signerServer.Stop() //nolint:errcheck // ignore for tests |
| 161 | |
| 162 | n := getTestNode(t, cfg, log.TestingLogger()) |
| 163 | assert.IsType(t, &privval.RetrySignerClient{}, n.PrivValidator()) |
| 164 | } |
| 165 | |
| 166 | // address without a protocol must result in error |
| 167 | func TestPrivValidatorListenAddrNoProtocol(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…