Skip to content

Commit 9a64721

Browse files
committed
[FAB-3179] Fix staticcheck issues in sbft package
Change-Id: I092537a4772b71e02f191b77b5df1999eb3eec88 Signed-off-by: Kostas Christidis <[email protected]>
1 parent 441b308 commit 9a64721

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

orderer/sbft/backend/backend.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ func Sign(privateKey crypto.PrivateKey, data []byte) []byte {
468468
if err != nil {
469469
panic(err)
470470
}
471-
encsig, err = asn1.Marshal(struct{ R, S *big.Int }{r, s})
471+
encsig, _ = asn1.Marshal(struct{ R, S *big.Int }{r, s})
472472
default:
473473
panic("Unsupported private key type given.")
474474
}

orderer/sbft/connection/connection.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func New(addr string, certFile string, keyFile string) (_ *Manager, err error) {
5656
}
5757

5858
c.Cert = &cert
59-
c.Self, err = NewPeerInfo("", cert.Certificate[0])
59+
c.Self, _ = NewPeerInfo("", cert.Certificate[0])
6060

6161
c.tlsConfig = &tls.Config{
6262
Certificates: []tls.Certificate{cert},

orderer/sbft/simplebft/newview_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func TestXsetByz0(t *testing.T) {
118118
},
119119
}
120120

121-
xset, _, ok := s.makeXset(vcs)
121+
_, _, ok := s.makeXset(vcs)
122122
if ok {
123123
t.Error("should not have received an xset")
124124
}
@@ -131,7 +131,7 @@ func TestXsetByz0(t *testing.T) {
131131
Checkpoint: s.makeBatch(2, []byte("prev"), nil),
132132
})
133133

134-
xset, _, ok = s.makeXset(vcs)
134+
xset, _, ok := s.makeXset(vcs)
135135
if !ok {
136136
t.Error("no xset")
137137
}
@@ -164,7 +164,7 @@ func TestXsetByz2(t *testing.T) {
164164
},
165165
}
166166

167-
xset, _, ok := s.makeXset(vcs)
167+
_, _, ok := s.makeXset(vcs)
168168
if ok {
169169
t.Error("should not have received an xset")
170170
}
@@ -176,7 +176,7 @@ func TestXsetByz2(t *testing.T) {
176176
Checkpoint: s.makeBatch(1, []byte("prev"), nil),
177177
})
178178

179-
xset, _, ok = s.makeXset(vcs)
179+
xset, _, ok := s.makeXset(vcs)
180180
if !ok {
181181
t.Error("no xset")
182182
}

0 commit comments

Comments
 (0)