Skip to content

Commit 95a914b

Browse files
fixup! Included new stores in config for integration tests
Signed-off-by: Alexandros Filios <alexandros.filios@ibm.com>
1 parent 78b045b commit 95a914b

File tree

3 files changed

+18
-22
lines changed

3 files changed

+18
-22
lines changed

platform/fabric/sdk/dig/generic/providers.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"github.com/hyperledger-labs/fabric-smart-client/pkg/utils/errors"
1111
committer2 "github.com/hyperledger-labs/fabric-smart-client/platform/common/core/generic/committer"
1212
driver2 "github.com/hyperledger-labs/fabric-smart-client/platform/common/driver"
13-
"github.com/hyperledger-labs/fabric-smart-client/platform/common/utils"
1413
digutils "github.com/hyperledger-labs/fabric-smart-client/platform/common/utils/dig"
1514
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/core"
1615
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/core/generic"
@@ -28,7 +27,6 @@ import (
2827
vdriver "github.com/hyperledger-labs/fabric-smart-client/platform/view/driver"
2928
sdk "github.com/hyperledger-labs/fabric-smart-client/platform/view/sdk/dig"
3029
dbdriver "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/db/driver"
31-
mem "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/db/driver/memory"
3230
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/events"
3331
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/hash"
3432
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/kvs"
@@ -187,8 +185,8 @@ func NewEndorseTxStore(in struct {
187185
Config vdriver.ConfigService
188186
Drivers []dbdriver.NamedDriver `group:"db-drivers"`
189187
}) (driver.EndorseTxStore, error) {
190-
driverName := driver2.PersistenceType(utils.DefaultString(in.Config.GetString("fsc.endorsetx.persistence.type"), string(mem.MemoryPersistence)))
191-
if sdk.UnsupportedStores.Contains(driverName) {
188+
driverName := driver2.PersistenceType(in.Config.GetString("fsc.endorsetx.persistence.type"))
189+
if len(driverName) == 0 || sdk.UnsupportedStores.Contains(driverName) {
192190
return services.NewKVSBasedEndorseTxStore(in.KVS), nil
193191
}
194192
for _, d := range in.Drivers {
@@ -205,8 +203,8 @@ func NewMetadataStore(in struct {
205203
Config vdriver.ConfigService
206204
Drivers []dbdriver.NamedDriver `group:"db-drivers"`
207205
}) (driver.MetadataStore, error) {
208-
driverName := driver2.PersistenceType(utils.DefaultString(in.Config.GetString("fsc.metadata.persistence.type"), string(mem.MemoryPersistence)))
209-
if sdk.UnsupportedStores.Contains(driverName) {
206+
driverName := driver2.PersistenceType(in.Config.GetString("fsc.metadata.persistence.type"))
207+
if len(driverName) == 0 || sdk.UnsupportedStores.Contains(driverName) {
210208
return services.NewKVSBasedMetadataStore(in.KVS), nil
211209
}
212210
for _, d := range in.Drivers {
@@ -223,8 +221,8 @@ func NewEnvelopeStore(in struct {
223221
Config vdriver.ConfigService
224222
Drivers []dbdriver.NamedDriver `group:"db-drivers"`
225223
}) (driver.EnvelopeStore, error) {
226-
driverName := driver2.PersistenceType(utils.DefaultString(in.Config.GetString("fsc.envelope.persistence.type"), string(mem.MemoryPersistence)))
227-
if sdk.UnsupportedStores.Contains(driverName) {
224+
driverName := driver2.PersistenceType(in.Config.GetString("fsc.envelope.persistence.type"))
225+
if len(driverName) == 0 || sdk.UnsupportedStores.Contains(driverName) {
228226
return services.NewKVSBasedEnvelopeStore(in.KVS), nil
229227
}
230228
for _, d := range in.Drivers {

platform/orion/sdk/dig/providers.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ package orion
88

99
import (
1010
driver2 "github.com/hyperledger-labs/fabric-smart-client/platform/common/driver"
11-
"github.com/hyperledger-labs/fabric-smart-client/platform/common/utils"
1211
driver3 "github.com/hyperledger-labs/fabric-smart-client/platform/orion/driver"
1312
"github.com/hyperledger-labs/fabric-smart-client/platform/orion/services"
1413
"github.com/hyperledger-labs/fabric-smart-client/platform/view/driver"
1514
sdk "github.com/hyperledger-labs/fabric-smart-client/platform/view/sdk/dig"
1615
dbdriver "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/db/driver"
17-
mem "github.com/hyperledger-labs/fabric-smart-client/platform/view/services/db/driver/memory"
1816
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/kvs"
1917
"github.com/pkg/errors"
2018
"go.uber.org/dig"
@@ -26,8 +24,8 @@ func NewEndorseTxStore(in struct {
2624
Config driver.ConfigService
2725
Drivers []dbdriver.NamedDriver `group:"db-drivers"`
2826
}) (driver3.EndorseTxStore, error) {
29-
driverName := driver2.PersistenceType(utils.DefaultString(in.Config.GetString("fsc.endorsetx.persistence.type"), string(mem.MemoryPersistence)))
30-
if sdk.UnsupportedStores.Contains(driverName) {
27+
driverName := driver2.PersistenceType(in.Config.GetString("fsc.endorsetx.persistence.type"))
28+
if len(driverName) == 0 || sdk.UnsupportedStores.Contains(driverName) {
3129
return services.NewKVSBasedEndorseTxStore(in.KVS), nil
3230
}
3331
for _, d := range in.Drivers {
@@ -44,8 +42,8 @@ func NewMetadataStore(in struct {
4442
Config driver.ConfigService
4543
Drivers []dbdriver.NamedDriver `group:"db-drivers"`
4644
}) (driver3.MetadataStore, error) {
47-
driverName := driver2.PersistenceType(utils.DefaultString(in.Config.GetString("fsc.metadata.persistence.type"), string(mem.MemoryPersistence)))
48-
if sdk.UnsupportedStores.Contains(driverName) {
45+
driverName := driver2.PersistenceType(in.Config.GetString("fsc.metadata.persistence.type"))
46+
if len(driverName) == 0 || sdk.UnsupportedStores.Contains(driverName) {
4947
return services.NewKVSBasedMetadataStore(in.KVS), nil
5048
}
5149
for _, d := range in.Drivers {
@@ -62,8 +60,8 @@ func NewEnvelopeStore(in struct {
6260
Config driver.ConfigService
6361
Drivers []dbdriver.NamedDriver `group:"db-drivers"`
6462
}) (driver3.EnvelopeStore, error) {
65-
driverName := driver2.PersistenceType(utils.DefaultString(in.Config.GetString("fsc.envelope.persistence.type"), string(mem.MemoryPersistence)))
66-
if sdk.UnsupportedStores.Contains(driverName) {
63+
driverName := driver2.PersistenceType(in.Config.GetString("fsc.envelope.persistence.type"))
64+
if len(driverName) == 0 || sdk.UnsupportedStores.Contains(driverName) {
6765
return services.NewKVSBasedEnvelopeStore(in.KVS), nil
6866
}
6967
for _, d := range in.Drivers {

platform/view/sdk/dig/providers.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ func newBindingStore(in struct {
4646
Config driver.ConfigService
4747
Drivers []driver2.NamedDriver `group:"db-drivers"`
4848
}) (driver4.BindingStore, error) {
49-
driverName := driver4.PersistenceType(utils.DefaultString(in.Config.GetString("fsc.binding.persistence.type"), string(mem.MemoryPersistence)))
50-
if UnsupportedStores.Contains(driverName) {
49+
driverName := driver4.PersistenceType(in.Config.GetString("fsc.binding.persistence.type"))
50+
if len(driverName) == 0 || UnsupportedStores.Contains(driverName) {
5151
return binding.NewKVSBased(in.KVS), nil
5252
}
5353
for _, d := range in.Drivers {
@@ -64,8 +64,8 @@ func newSignerInfoStore(in struct {
6464
Config driver.ConfigService
6565
Drivers []driver2.NamedDriver `group:"db-drivers"`
6666
}) (driver4.SignerInfoStore, error) {
67-
driverName := driver4.PersistenceType(utils.DefaultString(in.Config.GetString("fsc.signerinfo.persistence.type"), string(mem.MemoryPersistence)))
68-
if UnsupportedStores.Contains(driverName) {
67+
driverName := driver4.PersistenceType(in.Config.GetString("fsc.signerinfo.persistence.type"))
68+
if len(driverName) == 0 || UnsupportedStores.Contains(driverName) {
6969
return signerinfo.NewKVSBased(in.KVS), nil
7070
}
7171
for _, d := range in.Drivers {
@@ -82,8 +82,8 @@ func newAuditInfoStore(in struct {
8282
Config driver.ConfigService
8383
Drivers []driver2.NamedDriver `group:"db-drivers"`
8484
}) (driver4.AuditInfoStore, error) {
85-
driverName := driver4.PersistenceType(utils.DefaultString(in.Config.GetString("fsc.auditinfo.persistence.type"), string(mem.MemoryPersistence)))
86-
if UnsupportedStores.Contains(driverName) {
85+
driverName := driver4.PersistenceType(in.Config.GetString("fsc.auditinfo.persistence.type"))
86+
if len(driverName) == 0 || UnsupportedStores.Contains(driverName) {
8787
return auditinfo.NewKVSBased(in.KVS), nil
8888
}
8989
for _, d := range in.Drivers {

0 commit comments

Comments
 (0)