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