Skip to content

Commit 32f2012

Browse files
authored
Test FSC's PR #960 (#1119)
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
1 parent c6a84d2 commit 32f2012

File tree

6 files changed

+10
-78
lines changed

6 files changed

+10
-78
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/gin-gonic/gin v1.10.0
1212
github.com/gobuffalo/packr/v2 v2.7.1
1313
github.com/hashicorp/go-uuid v1.0.3
14-
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250611074151-9d28d47d908b
14+
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250619184516-0b8322da538b
1515
github.com/hyperledger/fabric v1.4.0-rc1.0.20230405174026-695dd57e01c2
1616
github.com/hyperledger/fabric-chaincode-go v0.0.0-20240704073638-9fb89180dc17
1717
github.com/hyperledger/fabric-lib-go v1.1.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,8 +1052,8 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T
10521052
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
10531053
github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc=
10541054
github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8=
1055-
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250611074151-9d28d47d908b h1:53OkUyBRcJtwl2MnkjNtKk0BxFiVIek9lz0IyV029ds=
1056-
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250611074151-9d28d47d908b/go.mod h1:qYv/trRBFf95pKaYtG1c5K1Zc/zxGI7wJXPBCEG+01M=
1055+
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250619184516-0b8322da538b h1:LNrC1jETuJmWeFhbBEBYrmYCsnbPd16ZUnCPzQRjrho=
1056+
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250619184516-0b8322da538b/go.mod h1:qYv/trRBFf95pKaYtG1c5K1Zc/zxGI7wJXPBCEG+01M=
10571057
github.com/hyperledger/fabric v1.4.0-rc1.0.20230405174026-695dd57e01c2 h1:w5BGxCYEsc9vjdDEdZGrZ5redvs263RYsdT2tqF7cNk=
10581058
github.com/hyperledger/fabric v1.4.0-rc1.0.20230405174026-695dd57e01c2/go.mod h1:LSwfuRgX/5C2uHkdT3hJtBFu/ALxuL7dFj1pmBby2R4=
10591059
github.com/hyperledger/fabric-amcl v0.0.0-20230602173724-9e02669dceb2 h1:B1Nt8hKb//KvgGRprk0h1t4lCnwhE9/ryb1WqfZbV+M=

integration/nwo/token/common/utils.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,11 @@ import (
1010
"os"
1111
"path"
1212

13-
"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fsc/node"
1413
"github.com/hyperledger-labs/fabric-token-sdk/token/services/logging"
1514
)
1615

1716
var logger = logging.MustGetLogger()
1817

19-
const (
20-
TokenKey = "tkn"
21-
IdentityKey = "idty"
22-
TokenLockKey = "tknlk"
23-
OwnerTransactionKey = "owntx"
24-
AuditTransactionKey = "audtx"
25-
)
26-
27-
var AllPrefixes = []node.PersistenceKey{
28-
TokenKey,
29-
IdentityKey,
30-
TokenLockKey,
31-
OwnerTransactionKey,
32-
AuditTransactionKey,
33-
}
34-
3518
const (
3619
FabricBinsPathEnvKey = "FAB_BINS"
3720
fabricCaClientCMD = "fabric-ca-client"

integration/nwo/token/fabric/fabric.go

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
api2 "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/api"
1818
"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fsc"
1919
sfcnode "github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fsc/node"
20-
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/db/driver"
2120
common2 "github.com/hyperledger-labs/fabric-token-sdk/integration/nwo/token/common"
2221
"github.com/hyperledger-labs/fabric-token-sdk/integration/nwo/token/generators"
2322
"github.com/hyperledger-labs/fabric-token-sdk/integration/nwo/token/generators/dlog"
@@ -125,21 +124,14 @@ func (p *NetworkHandler) GenerateExtension(tms *topology2.TMS, node *sfcnode.Nod
125124
gomega.Expect(os.MkdirAll(p.AuditDBSQLDataSourceDir(uniqueName), 0775)).ToNot(gomega.HaveOccurred(), "failed to create [%s]", p.AuditDBSQLDataSourceDir(uniqueName))
126125
gomega.Expect(os.MkdirAll(p.IdentityDBSQLDataSourceDir(uniqueName), 0775)).ToNot(gomega.HaveOccurred(), "failed to create [%s]", p.IdentityDBSQLDataSourceDir(uniqueName))
127126

128-
persistenceNames := fsc.GetPersistenceNames(node.Options, common2.AllPrefixes...)
129-
130127
t, err := template.New("peer").Funcs(template.FuncMap{
131-
"TMSID": func() string { return tms.TmsID() },
132-
"TMS": func() *topology2.TMS { return tms },
133-
"Wallets": func() *topology2.Wallets { return p.GetEntry(tms).Wallets[node.Name] },
134-
"TokenPersistence": func() driver.PersistenceName { return persistenceNames[common2.TokenKey] },
135-
"IdentityPersistence": func() driver.PersistenceName { return persistenceNames[common2.IdentityKey] },
136-
"TokenLockPersistence": func() driver.PersistenceName { return persistenceNames[common2.TokenLockKey] },
137-
"AuditTxPersistence": func() driver.PersistenceName { return persistenceNames[common2.AuditTransactionKey] },
138-
"OwnerTxPersistence": func() driver.PersistenceName { return persistenceNames[common2.OwnerTransactionKey] },
139-
"Endorsement": func() bool { return IsFSCEndorsementEnabled(tms) },
140-
"Endorsers": func() []string { return Endorsers(tms) },
141-
"EndorserID": func() string { return "" },
142-
"Endorser": func() bool { return topology2.ToOptions(node.Options).Endorser() },
128+
"TMSID": func() string { return tms.TmsID() },
129+
"TMS": func() *topology2.TMS { return tms },
130+
"Wallets": func() *topology2.Wallets { return p.GetEntry(tms).Wallets[node.Name] },
131+
"Endorsement": func() bool { return IsFSCEndorsementEnabled(tms) },
132+
"Endorsers": func() []string { return Endorsers(tms) },
133+
"EndorserID": func() string { return "" },
134+
"Endorser": func() bool { return topology2.ToOptions(node.Options).Endorser() },
143135
}).Parse(Extension)
144136
gomega.Expect(err).NotTo(gomega.HaveOccurred())
145137

integration/nwo/token/fabric/template.go

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,36 +37,6 @@ token:
3737
- {{ . }}{{ end }}
3838
{{ end }}
3939
40-
{{- if and (ne TokenPersistence "") (ne TokenPersistence "default") }}
41-
tokendb:
42-
persistence: {{ TokenPersistence }}
43-
{{- else }}
44-
# tokendb.persistence omitted
45-
{{- end }}
46-
{{- if and (ne IdentityPersistence "") (ne IdentityPersistence "default") }}
47-
identitydb:
48-
persistence: {{ IdentityPersistence }}
49-
{{- else }}
50-
# identitydb.persistence omitted
51-
{{- end }}
52-
{{- if and (ne TokenLockPersistence "") (ne TokenLockPersistence "default") }}
53-
tokenlockdb:
54-
persistence: {{ TokenLockPersistence }}
55-
{{- else }}
56-
# tokenlockdb.persistence omitted
57-
{{- end }}
58-
{{- if and (ne AuditTxPersistence "") (ne AuditTxPersistence "default") }}
59-
auditdb:
60-
persistence: {{ AuditTxPersistence }}
61-
{{- else }}
62-
# auditdb.persistence omitted
63-
{{- end }}
64-
{{- if and (ne OwnerTxPersistence "") (ne OwnerTxPersistence "default") }}
65-
ttxdb:
66-
persistence: {{ OwnerTxPersistence }}
67-
{{- else }}
68-
# ttxdb.persistence omitted
69-
{{- end }}
7040
{{ if Wallets }}
7141
# Wallets associated with this TMS
7242
wallets:

integration/token/test_utils.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ import (
1111

1212
"github.com/hyperledger-labs/fabric-smart-client/integration"
1313
"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/api"
14-
"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fabric"
1514
"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fsc/node"
16-
common2 "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/db/driver/common"
1715
postgres2 "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/db/driver/sql/postgres"
1816
"github.com/hyperledger-labs/fabric-token-sdk/integration/nwo/token"
19-
"github.com/hyperledger-labs/fabric-token-sdk/integration/nwo/token/common"
2017
"github.com/onsi/gomega"
2118
)
2219

@@ -30,16 +27,6 @@ type ReplicationOptions struct {
3027
*integration.ReplicationOptions
3128
}
3229

33-
func (o *ReplicationOptions) For(name string) []node.Option {
34-
opts := o.ReplicationOptions.For(name)
35-
if _, ok := o.SQLConfigs[name]; ok {
36-
opts = append(opts, fabric.WithPostgresPersistenceNames(common2.DefaultPersistence, common.AllPrefixes...))
37-
} else {
38-
opts = append(opts, fabric.WithSqlitePersistences(common.AllPrefixes...))
39-
}
40-
return opts
41-
}
42-
4330
func NoReplication() (*ReplicationOptions, *ReplicaSelector) {
4431
return &ReplicationOptions{ReplicationOptions: integration.NoReplication}, &ReplicaSelector{}
4532
}

0 commit comments

Comments
 (0)