Skip to content

Commit e791737

Browse files
authored
Merge branch 'main' into fix/tokenx-integration
Signed-off-by: Ginanjar Utama <ginanjar.utama@gmail.com>
2 parents d534a52 + aa23760 commit e791737

File tree

35 files changed

+697
-676
lines changed

35 files changed

+697
-676
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ TOP = .
88
FABRIC_VERSION ?= 3.1.1
99
FABRIC_TWO_DIGIT_VERSION = $(shell echo $(FABRIC_VERSION) | cut -d '.' -f 1,2)
1010

11-
FABRIC_X_TOOLS_VERSION ?= v0.0.5
12-
FABRIC_X_COMMITTER_VERSION ?= 0.1.5
11+
FABRIC_X_TOOLS_VERSION ?= v0.0.6
12+
FABRIC_X_COMMITTER_VERSION ?= 0.1.7
1313

1414
# need to install fabric binaries outside of fsc tree for now (due to chaincode packaging issues)
1515
FABRIC_BINARY_BASE ?= $(PWD)/../fabric

go.mod

Lines changed: 84 additions & 93 deletions
Large diffs are not rendered by default.

go.sum

Lines changed: 196 additions & 326 deletions
Large diffs are not rendered by default.

platform/fabric/services/state/cc/query/go.mod

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
module github.com/hyperledger-labs/fabric-smart-client/platform/fabric/services/state/cc/query
22

3-
go 1.24.0
4-
5-
toolchain go1.24.1
3+
go 1.24.6
64

75
require (
86
github.com/hyperledger/fabric-chaincode-go/v2 v2.3.0
97
github.com/hyperledger/fabric-protos-go-apiv2 v0.3.7
108
)
119

1210
require (
13-
golang.org/x/net v0.42.0 // indirect
14-
golang.org/x/sys v0.34.0 // indirect
15-
golang.org/x/text v0.27.0 // indirect
11+
github.com/stretchr/testify v1.11.1 // indirect
12+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
13+
go.opentelemetry.io/otel v1.38.0 // indirect
14+
go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect
15+
golang.org/x/net v0.47.0 // indirect
16+
golang.org/x/sys v0.38.0 // indirect
17+
golang.org/x/text v0.31.0 // indirect
1618
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
1719
google.golang.org/grpc v1.76.0 // indirect
1820
google.golang.org/protobuf v1.36.10 // indirect

platform/fabric/services/state/cc/query/go.sum

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@ github.com/hyperledger/fabric-protos-go-apiv2 v0.3.7 h1:sQ5qv8vQQfwewa1JlCiSCC8d
1616
github.com/hyperledger/fabric-protos-go-apiv2 v0.3.7/go.mod h1:bJnwzfv03oZQeCc863pdGTDgf5nmCy6Za3RAE7d2XsQ=
1717
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1818
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
19-
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
20-
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
21-
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
22-
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
23-
go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
24-
go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
25-
go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE=
26-
go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E=
27-
go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI=
28-
go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg=
29-
go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc=
30-
go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps=
31-
go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
32-
go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
33-
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
34-
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
35-
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
36-
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
37-
golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
38-
golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
19+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
20+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
21+
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
22+
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
23+
go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=
24+
go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=
25+
go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=
26+
go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI=
27+
go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=
28+
go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg=
29+
go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=
30+
go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=
31+
go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=
32+
go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=
33+
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
34+
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
35+
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
36+
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
37+
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
38+
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
3939
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
4040
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
4141
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=

platform/fabricx/core/committer/txhandler.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package committer
88

99
import (
1010
"context"
11-
"fmt"
1211

1312
"github.com/hyperledger-labs/fabric-smart-client/pkg/utils/errors"
1413
"github.com/hyperledger-labs/fabric-smart-client/platform/common/services/logging"
@@ -37,7 +36,7 @@ type handler struct {
3736

3837
func (h *handler) HandleFabricxTransaction(ctx context.Context, blkMetadata *cb.BlockMetadata, tx committer.CommitTx) (*committer.FinalityEvent, error) {
3938
if len(blkMetadata.Metadata) < statusIdx {
40-
return nil, fmt.Errorf("block metadata lacks transaction filter")
39+
return nil, errors.New("block metadata lacks transaction filter")
4140
}
4241

4342
statusCode := protoblocktx.Status(blkMetadata.Metadata[statusIdx][tx.TxNum])
@@ -61,7 +60,7 @@ func (h *handler) HandleFabricxTransaction(ctx context.Context, blkMetadata *cb.
6160
// escaping the switch and discard
6261
break
6362
}
64-
return nil, fmt.Errorf("failed committing transaction [txID=%s]: %w", event.TxID, err)
63+
return nil, errors.Wrapf(err, "committing endorser transaction [txID=%s]", event.TxID)
6564
}
6665
if !processed {
6766
logger.Debugf("TODO: Should we try to get chaincode events?")
@@ -74,7 +73,7 @@ func (h *handler) HandleFabricxTransaction(ctx context.Context, blkMetadata *cb.
7473

7574
logger.Warnf("discarding transaction [txID=%s] [reason=%v]", tx.TxID, statusCode.String())
7675
if err := h.committer.DiscardEndorserTransaction(ctx, event.TxID, tx.BlkNum, tx.Raw, event); err != nil {
77-
return nil, fmt.Errorf("failed discarding transaction [txID=%s]: %w", event.TxID, err)
76+
return nil, errors.Wrapf(err, "discarding endorser transaction [txID=%s]", event.TxID)
7877
}
7978

8079
return event, nil

platform/fabricx/core/committer/v3/test_utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package v3
88

99
const (
1010
CommitterVersion = "v3"
11-
ScalableCommitterImage = "hyperledger/fabric-x-committer-test-node:0.1.5"
11+
ScalableCommitterImage = "hyperledger/fabric-x-committer-test-node:0.1.7"
1212
SidecarDefaultPort = "4001/tcp"
1313
QueryServiceDefaultPort = "7001/tcp"
1414
)

platform/fabricx/core/finality/config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ SPDX-License-Identifier: Apache-2.0
77
package finality
88

99
import (
10-
"fmt"
1110
"time"
11+
12+
"github.com/hyperledger-labs/fabric-smart-client/pkg/utils/errors"
1213
)
1314

1415
const DefaultRequestTimeout = 30 * time.Second
@@ -37,7 +38,7 @@ func NewConfig(configService ConfigService) (*Config, error) {
3738

3839
err := configService.UnmarshalKey("notificationService", &config)
3940
if err != nil {
40-
return config, fmt.Errorf("cannot get notify service config: %w", err)
41+
return config, errors.Wrap(err, "unmarshal notificationService")
4142
}
4243

4344
return config, nil

platform/fabricx/core/finality/grpc.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,22 @@ SPDX-License-Identifier: Apache-2.0
77
package finality
88

99
import (
10-
"errors"
11-
"fmt"
1210
"os"
1311
"time"
1412

13+
"github.com/hyperledger-labs/fabric-smart-client/pkg/utils/errors"
1514
"google.golang.org/grpc"
1615
"google.golang.org/grpc/backoff"
1716
"google.golang.org/grpc/credentials"
1817
"google.golang.org/grpc/credentials/insecure"
1918
)
2019

21-
var ErrInvalidAddress = fmt.Errorf("empty address")
20+
var ErrInvalidAddress = errors.New("empty address")
2221

2322
func GrpcClient(c *Config) (*grpc.ClientConn, error) {
2423
// no endpoints in config
2524
if len(c.Endpoints) != 1 {
26-
return nil, fmt.Errorf("we need a single endpoint")
25+
return nil, errors.New("we need a single endpoint")
2726
}
2827

2928
// currently we only support connections to a single query service

platform/fabricx/core/finality/nlm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ package finality
88

99
import (
1010
"context"
11-
"errors"
1211
"slices"
1312
"sync"
1413
"time"
1514

15+
"github.com/hyperledger-labs/fabric-smart-client/pkg/utils/errors"
1616
"github.com/hyperledger-labs/fabric-smart-client/platform/common/driver"
1717
"github.com/hyperledger-labs/fabric-smart-client/platform/common/services/logging"
1818
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric"

0 commit comments

Comments
 (0)