Skip to content

Commit

Permalink
Remove unused Ping
Browse files Browse the repository at this point in the history
  • Loading branch information
ulbqb committed Dec 6, 2022
1 parent a990fab commit 6d38592
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 50 deletions.
4 changes: 0 additions & 4 deletions privval/retry_signer_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ func (sc *RetrySignerClient) WaitForConnection(maxWait time.Duration) error {
//--------------------------------------------------------
// Implement PrivValidator

func (sc *RetrySignerClient) Ping() error {
return sc.next.Ping()
}

func (sc *RetrySignerClient) GetPubKey() (crypto.PubKey, error) {
var (
pk crypto.PubKey
Expand Down
16 changes: 0 additions & 16 deletions privval/signer_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,6 @@ func (sc *SignerClient) WaitForConnection(maxWait time.Duration) error {
//--------------------------------------------------------
// Implement PrivValidator

// Ping sends a ping request to the remote signer
func (sc *SignerClient) Ping() error {
response, err := sc.endpoint.SendRequest(mustWrapMsg(&privvalproto.PingRequest{}))
if err != nil {
sc.endpoint.Logger.Error("SignerClient::Ping", "err", err)
return nil
}

pb := response.GetPingResponse()
if pb == nil {
return err
}

return nil
}

// GetPubKey retrieves a public key from a remote signer
// returns an error if client is not able to provide the key
func (sc *SignerClient) GetPubKey() (crypto.PubKey, error) {
Expand Down
19 changes: 0 additions & 19 deletions privval/signer_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,6 @@ func TestSignerClose(t *testing.T) {
}
}

func TestSignerPing(t *testing.T) {
for _, tc := range getSignerTestCases(t, nil, true) {
tc := tc
t.Cleanup(func() {
if err := tc.signerServer.Stop(); err != nil {
t.Error(err)
}
})
t.Cleanup(func() {
if err := tc.signerClient.Close(); err != nil {
t.Error(err)
}
})

err := tc.signerClient.Ping()
assert.NoError(t, err)
}
}

func TestSignerGetPubKey(t *testing.T) {
for _, tc := range getSignerTestCases(t, nil, true) {
tc := tc
Expand Down
11 changes: 0 additions & 11 deletions test/kms/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ func BenchmarkKMS(b *testing.B) {
client, err := privval.NewSignerClient(endpoint, chainID)
require.NoError(b, err)

// ensure connection and warm up
b.Run("Ping", func(b *testing.B) {
var err error
b.ResetTimer()
for i := 0; i < b.N; i++ {
err = client.Ping()
}
b.StopTimer()
require.NoError(b, err)
})

benchmarkPrivValidator(b, client)
}

Expand Down

0 comments on commit 6d38592

Please sign in to comment.