mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-03 08:31:20 +00:00
address review comments
- remove lock from remote signer - remove some require.NoError's
This commit is contained in:
parent
f9a564cfc3
commit
138a57258f
@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@ -19,7 +18,6 @@ import (
|
||||
type RemoteSignerClient struct {
|
||||
conn net.Conn
|
||||
consensusPubKey crypto.PubKey
|
||||
lock sync.Mutex
|
||||
}
|
||||
|
||||
// Check that RemoteSignerClient implements PrivValidator.
|
||||
@ -47,9 +45,6 @@ func (sc *RemoteSignerClient) GetPubKey() crypto.PubKey {
|
||||
}
|
||||
|
||||
func (sc *RemoteSignerClient) getPubKey() (crypto.PubKey, error) {
|
||||
sc.lock.Lock()
|
||||
defer sc.lock.Unlock()
|
||||
|
||||
err := writeMsg(sc.conn, &PubKeyRequest{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -73,9 +68,6 @@ func (sc *RemoteSignerClient) getPubKey() (crypto.PubKey, error) {
|
||||
|
||||
// SignVote implements PrivValidator.
|
||||
func (sc *RemoteSignerClient) SignVote(chainID string, vote *types.Vote) error {
|
||||
sc.lock.Lock()
|
||||
defer sc.lock.Unlock()
|
||||
|
||||
err := writeMsg(sc.conn, &SignVoteRequest{Vote: vote})
|
||||
if err != nil {
|
||||
return err
|
||||
@ -103,9 +95,6 @@ func (sc *RemoteSignerClient) SignProposal(
|
||||
chainID string,
|
||||
proposal *types.Proposal,
|
||||
) error {
|
||||
sc.lock.Lock()
|
||||
defer sc.lock.Unlock()
|
||||
|
||||
err := writeMsg(sc.conn, &SignProposalRequest{Proposal: proposal})
|
||||
if err != nil {
|
||||
return err
|
||||
@ -129,9 +118,6 @@ func (sc *RemoteSignerClient) SignProposal(
|
||||
|
||||
// Ping is used to check connection health.
|
||||
func (sc *RemoteSignerClient) Ping() error {
|
||||
sc.lock.Lock()
|
||||
defer sc.lock.Unlock()
|
||||
|
||||
err := writeMsg(sc.conn, &PingRequest{})
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -43,7 +43,6 @@ func TestSocketPVPubKey(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
privvalPubKey := rs.privVal.GetPubKey()
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, privvalPubKey, clientKey)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user