Skip to content

Commit ce06fe6

Browse files
authored
Merge branch 'main' into typo-fix
2 parents 8c5bd49 + 71f04f3 commit ce06fe6

File tree

18 files changed

+62
-49
lines changed

18 files changed

+62
-49
lines changed

.github/pull_request_template.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ Fixes # <issue_number_here>
3030
- [ ] I have performed a self-review of my own code or work.
3131
- [ ] I have commented my code, particularly in hard-to-understand areas.
3232
- [ ] My changes generates no new warnings.
33-
- [ ] My Pull Request title is in format <code>< issue name ></code> eg <code>Added links in the documentation</code>.
3433
- [ ] I have added tests that prove my fix is effective or that my feature works.
3534
- [ ] My changes have sufficient code coverage (unit, integration, e2e tests).
3635

auditevents/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package main
1818

1919
import (
2020
"encoding/json"
21+
"errors"
2122
"fmt"
2223
"io"
2324
"net/http"
@@ -94,7 +95,7 @@ func run(host string) error {
9495
protocolID := event.BlockchainEvent.ProtocolID
9596
fmt.Printf("%-10d %s\n", lastSequence, protocolID)
9697
if protocolID <= lastProtocolID {
97-
return fmt.Errorf("out of order events detected")
98+
return errors.New("out of order events detected")
9899
}
99100
lastProtocolID = protocolID
100101
validated++

ffconfig/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package main
1818

1919
import (
20+
"errors"
2021
"fmt"
2122
"os"
2223

@@ -29,7 +30,7 @@ var rootCmd = &cobra.Command{
2930
Short: "FireFly configuration tool",
3031
Long: "Tool for managing and migrating config files for Hyperledger FireFly",
3132
RunE: func(cmd *cobra.Command, args []string) error {
32-
return fmt.Errorf("a command is required")
33+
return errors.New("a command is required")
3334
},
3435
}
3536

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/gorilla/mux v1.8.1
1919
github.com/gorilla/websocket v1.5.1
2020
github.com/hyperledger/firefly-common v1.4.15
21-
github.com/hyperledger/firefly-signer v1.1.19
21+
github.com/hyperledger/firefly-signer v1.1.20
2222
github.com/jarcoal/httpmock v1.2.0
2323
github.com/lib/pq v1.10.9
2424
github.com/mattn/go-sqlite3 v1.14.19

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
7979
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
8080
github.com/hyperledger/firefly-common v1.4.15 h1:dp4Mo2JQRPMbL7hoMw8T/ktvIUgematOLkXIppQtBp0=
8181
github.com/hyperledger/firefly-common v1.4.15/go.mod h1:bA7tAJxcpfQMrHN3/YycTSpyk4g2WlnDlpHx8WOUtAY=
82-
github.com/hyperledger/firefly-signer v1.1.19 h1:Gq5HqUp9/7egLrahJY9WMk4Y9dZVPIl99aSIged93HM=
83-
github.com/hyperledger/firefly-signer v1.1.19/go.mod h1:XTwaPRkAfVxk2G3PQOYHLbuvMOiBs0px/4vwXTsUtsA=
82+
github.com/hyperledger/firefly-signer v1.1.20 h1:U/oGj+QuHdFp4NVZyYOzt3RW51m9nsdYQAGGeChG7g0=
83+
github.com/hyperledger/firefly-signer v1.1.20/go.mod h1:4S8Ki1f1d8U+Ujojea/a3mkXnJ5Fuz+JBfrf9HBdyO0=
8484
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
8585
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
8686
github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY=

go.work.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,8 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l
356356
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
357357
github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY=
358358
github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4=
359+
github.com/hyperledger/firefly-signer v1.1.20 h1:U/oGj+QuHdFp4NVZyYOzt3RW51m9nsdYQAGGeChG7g0=
360+
github.com/hyperledger/firefly-signer v1.1.20/go.mod h1:4S8Ki1f1d8U+Ujojea/a3mkXnJ5Fuz+JBfrf9HBdyO0=
359361
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
360362
github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
361363
github.com/jackc/pgconn v1.14.0 h1:vrbA9Ud87g6JdFWkHTJXppVce58qPIdP7N8y0Ml/A7Q=

internal/blockchain/ethereum/ethereum.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"encoding/hex"
2222
"encoding/json"
2323
"fmt"
24+
"net/http"
2425
"regexp"
2526
"strconv"
2627
"strings"
@@ -1197,7 +1198,7 @@ func (e *Ethereum) GetTransactionStatus(ctx context.Context, operation *core.Ope
11971198
SetResult(&statusResponse).
11981199
Get(transactionRequestPath)
11991200
if err != nil || !res.IsSuccess() {
1200-
if res.StatusCode() == 404 {
1201+
if res.StatusCode() == http.StatusNotFound {
12011202
return nil, nil
12021203
}
12031204
return nil, common.WrapRESTError(ctx, &resErr, res, err, coremsgs.MsgEthConnectorRESTErr)

internal/blockchain/ethereum/eventstream.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"crypto/sha256"
2222
"encoding/hex"
2323
"fmt"
24+
"net/http"
2425
"strconv"
2526
"strings"
2627

@@ -161,7 +162,7 @@ func (s *streamManager) deleteEventStream(ctx context.Context, esID string, okNo
161162
SetContext(ctx).
162163
Delete("/eventstreams/" + esID)
163164
if err != nil || !res.IsSuccess() {
164-
if okNotFound && res.StatusCode() == 404 {
165+
if okNotFound && res.StatusCode() == http.StatusNotFound {
165166
return nil
166167
}
167168
return ffresty.WrapRestErr(ctx, res, err, coremsgs.MsgEthConnectorRESTErr)
@@ -186,7 +187,7 @@ func (s *streamManager) getSubscription(ctx context.Context, subID string, okNot
186187
SetResult(&sub).
187188
Get(fmt.Sprintf("/subscriptions/%s", subID))
188189
if err != nil || !res.IsSuccess() {
189-
if okNotFound && res.StatusCode() == 404 {
190+
if okNotFound && res.StatusCode() == http.StatusNotFound {
190191
return nil, nil
191192
}
192193
return nil, ffresty.WrapRestErr(ctx, res, err, coremsgs.MsgEthConnectorRESTErr)
@@ -282,7 +283,7 @@ func (s *streamManager) deleteSubscription(ctx context.Context, subID string, ok
282283
SetContext(ctx).
283284
Delete("/subscriptions/" + subID)
284285
if err != nil || !res.IsSuccess() {
285-
if okNotFound && res.StatusCode() == 404 {
286+
if okNotFound && res.StatusCode() == http.StatusNotFound {
286287
return nil
287288
}
288289
return ffresty.WrapRestErr(ctx, res, err, coremsgs.MsgEthConnectorRESTErr)

internal/blockchain/fabric/eventstream.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package fabric
1919
import (
2020
"context"
2121
"fmt"
22+
"net/http"
2223
"strconv"
2324
"strings"
2425

@@ -137,7 +138,7 @@ func (s *streamManager) deleteEventStream(ctx context.Context, esID string, okNo
137138
SetContext(ctx).
138139
Delete("/eventstreams/" + esID)
139140
if err != nil || !res.IsSuccess() {
140-
if okNotFound && res.StatusCode() == 404 {
141+
if okNotFound && res.StatusCode() == http.StatusNotFound {
141142
return nil
142143
}
143144
return ffresty.WrapRestErr(ctx, res, err, coremsgs.MsgFabconnectRESTErr)
@@ -162,7 +163,7 @@ func (s *streamManager) getSubscription(ctx context.Context, subID string, okNot
162163
SetResult(&sub).
163164
Get(fmt.Sprintf("/subscriptions/%s", subID))
164165
if err != nil || !res.IsSuccess() {
165-
if okNotFound && res.StatusCode() == 404 {
166+
if okNotFound && res.StatusCode() == http.StatusNotFound {
166167
return nil, nil
167168
}
168169
return nil, ffresty.WrapRestErr(ctx, res, err, coremsgs.MsgFabconnectRESTErr)
@@ -261,7 +262,7 @@ func (s *streamManager) deleteSubscription(ctx context.Context, subID string, ok
261262
SetContext(ctx).
262263
Delete("/subscriptions/" + subID)
263264
if err != nil || !res.IsSuccess() {
264-
if okNotFound && res.StatusCode() == 404 {
265+
if okNotFound && res.StatusCode() == http.StatusNotFound {
265266
return nil
266267
}
267268
return ffresty.WrapRestErr(ctx, res, err, coremsgs.MsgFabconnectRESTErr)

internal/blockchain/fabric/fabric.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"encoding/hex"
2323
"encoding/json"
2424
"fmt"
25+
"net/http"
2526
"regexp"
2627
"strings"
2728

@@ -1118,7 +1119,7 @@ func (f *Fabric) GetTransactionStatus(ctx context.Context, operation *core.Opera
11181119
SetQueryParam("fly-signer", defaultSigner).
11191120
Get(transactionRequestPath)
11201121
if err != nil || !res.IsSuccess() {
1121-
if res.StatusCode() == 404 {
1122+
if res.StatusCode() == http.StatusNotFound {
11221123
return nil, nil
11231124
}
11241125
return nil, common.WrapRESTError(ctx, &resErr, res, err, coremsgs.MsgFabconnectRESTErr)

0 commit comments

Comments
 (0)