Skip to content

Commit 9b30286

Browse files
Rename db's into stores
Signed-off-by: Alexandros Filios <alexandros.filios@ibm.com>
1 parent f28fe70 commit 9b30286

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+465
-463
lines changed

docs/services/identity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func NewMixedStorageProvider(client *vault.Client, prefix string, manager *ident
117117
}
118118

119119
func (s *MixedStorageProvider) WalletDB(tmsID token.TMSID) (identity.WalletDB, error) {
120-
return s.manager.WalletDBByTMSId(tmsID)
120+
return s.manager.WalletServiceByTMSId(tmsID)
121121
}
122122

123123
func (s *MixedStorageProvider) IdentityDB(tmsID token.TMSID) (identity.IdentityDB, error) {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/gin-gonic/gin v1.10.0
1010
github.com/gobuffalo/packr/v2 v2.7.1
1111
github.com/hashicorp/go-uuid v1.0.3
12-
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250424082942-4426380254a6
12+
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250424121222-e841f27ce668
1313
github.com/hyperledger-labs/orion-sdk-go v0.2.10
1414
github.com/hyperledger-labs/orion-server v0.2.10
1515
github.com/hyperledger/fabric v1.4.0-rc1.0.20230405174026-695dd57e01c2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,8 +1073,8 @@ github.com/hidal-go/hidalgo v0.0.0-20201109092204-05749a6d73df/go.mod h1:bPkrxDl
10731073
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
10741074
github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc=
10751075
github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8=
1076-
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250424082942-4426380254a6 h1:i9KY2d2QvduzkHorhmlv1GctRb+gYbxGpP6FPSGU2Xo=
1077-
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250424082942-4426380254a6/go.mod h1:0uk7mRq5G1JTb0txPR2PL4TQZntcFZjhRpXZvmrajOs=
1076+
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250424121222-e841f27ce668 h1:5zO5dpimWtMMydDuCFZoIH1038umBgyNJrVmnL+AXyI=
1077+
github.com/hyperledger-labs/fabric-smart-client v0.4.1-0.20250424121222-e841f27ce668/go.mod h1:0uk7mRq5G1JTb0txPR2PL4TQZntcFZjhRpXZvmrajOs=
10781078
github.com/hyperledger-labs/orion-sdk-go v0.2.10 h1:lFgWgxyvngIhWnIqymYGBmtmq9D6uC5d0uLG9cbyh5s=
10791079
github.com/hyperledger-labs/orion-sdk-go v0.2.10/go.mod h1:iN2xZB964AqwVJwL+EnwPOs8z1EkMEbbIg/qYeC7gDY=
10801080
github.com/hyperledger-labs/orion-server v0.2.10 h1:G4zbQEL5Egk0Oj+TwHCZWdTOLDBHOjaAEvYOT4G7ozw=

integration/token/common/sdk/identity/provider.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ func NewKVSStorageProvider(kvs kvs.KVS) *KVSStorageProvider {
2121
return &KVSStorageProvider{kvs: kvs}
2222
}
2323

24-
func (s *KVSStorageProvider) WalletDB(tmsID token.TMSID) (driver.WalletStore, error) {
25-
return kvs.NewWalletDB(s.kvs, tmsID), nil
24+
func (s *KVSStorageProvider) WalletStore(tmsID token.TMSID) (driver.WalletStore, error) {
25+
return kvs.NewWalletStore(s.kvs, tmsID), nil
2626
}
2727

28-
func (s *KVSStorageProvider) IdentityDB(tmsID token.TMSID) (driver.IdentityStore, error) {
29-
return kvs.NewIdentityDB(s.kvs, tmsID), nil
28+
func (s *KVSStorageProvider) IdentityStore(tmsID token.TMSID) (driver.IdentityStore, error) {
29+
return kvs.NewIdentityStore(s.kvs, tmsID), nil
3030
}
3131

3232
func (s *KVSStorageProvider) Keystore() (identity.Keystore, error) {

integration/token/fungible/support.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,7 @@ func DoesWalletExist(network *integration.Infrastructure, id *token3.NodeReferen
999999
return exists
10001000
}
10011001

1002-
func CheckOwnerDB(network *integration.Infrastructure, errorCheck func([]string) error, ids ...*token3.NodeReference) {
1002+
func CheckOwnerStore(network *integration.Infrastructure, errorCheck func([]string) error, ids ...*token3.NodeReference) {
10031003
for _, id := range ids {
10041004
for _, replicaName := range id.AllNames() {
10051005
errorMessagesBoxed, err := network.Client(replicaName).CallView("CheckTTXDB", common.JSONMarshall(&views.CheckTTXDB{}))
@@ -1015,7 +1015,7 @@ func CheckOwnerDB(network *integration.Infrastructure, errorCheck func([]string)
10151015
}
10161016
}
10171017

1018-
func CheckAuditorDB(network *integration.Infrastructure, auditor *token3.NodeReference, walletID string, errorCheck func([]string) error) {
1018+
func CheckAuditorStore(network *integration.Infrastructure, auditor *token3.NodeReference, walletID string, errorCheck func([]string) error) {
10191019
errorMessagesBoxed, err := network.Client(auditor.ReplicaName()).CallView("CheckTTXDB", common.JSONMarshall(&views.CheckTTXDB{
10201020
Auditor: true,
10211021
AuditorWalletID: walletID,

integration/token/fungible/tests.go

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ func TestAll(network *integration.Infrastructure, auditorId string, onRestart On
449449
CheckBalanceAndHolding(network, bob, "", "LIRA", 2, auditor)
450450
CheckBalanceAndHolding(network, charlie, "", "LIRA", 3, auditor)
451451
CheckAuditedTransactions(network, auditor, AuditedTransactions[:], &t0, &t16)
452-
CheckOwnerDB(network, nil, issuer, alice, bob, charlie, manager)
452+
CheckOwnerStore(network, nil, issuer, alice, bob, charlie, manager)
453453

454454
IssueCash(network, "", "USD", 1, alice, auditor, true, issuer)
455455

@@ -506,8 +506,8 @@ func TestAll(network *integration.Infrastructure, auditorId string, onRestart On
506506
CheckBalanceAndHolding(network, issuer, "", "EUR", 150, auditor)
507507
CheckBalanceAndHolding(network, issuer, "issuer.owner", "EUR", 10, auditor)
508508

509-
CheckOwnerDB(network, nil, issuer, alice, bob, charlie, manager)
510-
CheckAuditorDB(network, auditor, "", nil)
509+
CheckOwnerStore(network, nil, issuer, alice, bob, charlie, manager)
510+
CheckAuditorStore(network, auditor, "", nil)
511511

512512
// Check double spending
513513
txIDPine := IssueCash(network, "", "PINE", 55, alice, auditor, true, issuer)
@@ -527,7 +527,7 @@ func TestAll(network *integration.Infrastructure, auditorId string, onRestart On
527527
CheckHolding(network, bob, "", "PINE", 110, auditor)
528528
CheckBalanceAndHolding(network, bob, "", "EUR", 20, auditor)
529529
CheckBalanceAndHolding(network, bob, "", "USD", 110, auditor)
530-
CheckOwnerDB(network, nil, bob)
530+
CheckOwnerStore(network, nil, bob)
531531
fmt.Printf("prepared transactions [%s:%s]", txID1, txID2)
532532
Restart(network, true, onRestart, bob)
533533
Restart(network, false, onRestart, auditor)
@@ -548,8 +548,8 @@ func TestAll(network *integration.Infrastructure, auditorId string, onRestart On
548548
common2.CheckFinality(network, auditor, txID2, nil, true)
549549
CheckBalanceAndHolding(network, alice, "", "PINE", 0, auditor)
550550
CheckBalanceAndHolding(network, bob, "", "PINE", 55, auditor)
551-
CheckOwnerDB(network, nil, issuer, alice, bob, charlie, manager)
552-
CheckAuditorDB(network, auditor, "", nil)
551+
CheckOwnerStore(network, nil, issuer, alice, bob, charlie, manager)
552+
CheckAuditorStore(network, auditor, "", nil)
553553

554554
// Test Auditor ability to override transaction state
555555
txID3, tx3 := PrepareTransferCash(network, bob, "", "PINE", 10, alice, auditor, nil)
@@ -565,13 +565,13 @@ func TestAll(network *integration.Infrastructure, auditorId string, onRestart On
565565
SetTransactionOwnersStatus(network, txID3, ttx.Deleted, token3.AllNames(alice, bob)...)
566566

567567
// Restart
568-
CheckOwnerDB(network, nil, alice, bob)
569-
CheckOwnerDB(network, nil, issuer, charlie, manager)
570-
CheckAuditorDB(network, auditor, "", nil)
568+
CheckOwnerStore(network, nil, alice, bob)
569+
CheckOwnerStore(network, nil, issuer, charlie, manager)
570+
CheckAuditorStore(network, auditor, "", nil)
571571
Restart(network, false, onRestart, alice, bob, charlie, manager)
572-
CheckOwnerDB(network, nil, alice, bob)
573-
CheckOwnerDB(network, nil, issuer, charlie, manager)
574-
CheckAuditorDB(network, auditor, "", nil)
572+
CheckOwnerStore(network, nil, alice, bob)
573+
CheckOwnerStore(network, nil, issuer, charlie, manager)
574+
CheckAuditorStore(network, auditor, "", nil)
575575

576576
// Addition transfers
577577
TransferCash(network, issuer, "", "USD", 50, issuer, auditor)
@@ -783,8 +783,8 @@ func TestAll(network *integration.Infrastructure, auditorId string, onRestart On
783783

784784
// Check consistency
785785
CheckPublicParams(network, issuer, auditor, alice, bob, charlie, manager)
786-
CheckOwnerDB(network, nil, issuer, auditor, alice, bob, charlie, manager)
787-
CheckAuditorDB(network, auditor, "", nil)
786+
CheckOwnerStore(network, nil, issuer, auditor, alice, bob, charlie, manager)
787+
CheckAuditorStore(network, auditor, "", nil)
788788
PruneInvalidUnspentTokens(network, issuer, auditor, alice, bob, charlie, manager)
789789

790790
for _, ref := range []*token3.NodeReference{alice, bob, charlie, manager} {
@@ -810,7 +810,7 @@ func TestAll(network *integration.Infrastructure, auditorId string, onRestart On
810810
CheckBalanceAndHolding(network, alice, "", "Pineapples", 6, auditor)
811811
CheckBalanceAndHolding(network, bob, "", "Pineapples", 0, auditor)
812812
CheckBalanceAndHolding(network, charlie, "", "Pineapples", 0, auditor)
813-
CheckAuditorDB(network, auditor, "", nil)
813+
CheckAuditorStore(network, auditor, "", nil)
814814

815815
// test spendable token
816816
txIssueSpendableToken := IssueCash(network, "", "Spendable", 3, alice, auditor, true, issuer)
@@ -820,7 +820,7 @@ func TestAll(network *integration.Infrastructure, auditorId string, onRestart On
820820
TransferCash(network, alice, "", "Spendable", 2, bob, auditor)
821821
CheckBalanceAndHolding(network, alice, "", "Spendable", 1, auditor)
822822
CheckBalanceAndHolding(network, bob, "", "Spendable", 2, auditor)
823-
CheckAuditorDB(network, auditor, "", nil)
823+
CheckAuditorStore(network, auditor, "", nil)
824824
}
825825

826826
func TestSelector(network *integration.Infrastructure, auditorId string, sel *token3.ReplicaSelector) {
@@ -1230,8 +1230,8 @@ func TestTokensUpgrade(network *integration.Infrastructure, auditorId string, on
12301230
IssueSuccessfulCash(network, "", "EUR", 110, alice, auditor, true, issuer, endorsers...)
12311231
CheckBalanceAndHolding(network, alice, "", "EUR", 110, auditor)
12321232
CheckBalanceAndHolding(network, bob, "", "EUR", 0, auditor)
1233-
CheckOwnerDB(network, nil, issuer, alice, bob, charlie, manager)
1234-
CheckAuditorDB(network, auditor, "", nil)
1233+
CheckOwnerStore(network, nil, issuer, alice, bob, charlie, manager)
1234+
CheckAuditorStore(network, auditor, "", nil)
12351235

12361236
// switch to dlog 32bits, perform a few operations
12371237
tms := GetTMSByAlias(network, "dlog-32bits")
@@ -1247,7 +1247,7 @@ func TestTokensUpgrade(network *integration.Infrastructure, auditorId string, on
12471247
Eventually(DoesWalletExist).WithArguments(network, auditor, "", views.AuditorWallet).WithTimeout(1 * time.Minute).WithPolling(15 * time.Second).Should(Equal(true))
12481248

12491249
// alice has one token that cannot be spent directly, it was created when the fabtoken driver was in place
1250-
CheckOwnerDB(network, func(errMsgs []string) error {
1250+
CheckOwnerStore(network, func(errMsgs []string) error {
12511251
if len(errMsgs) != 1 {
12521252
return errors.Errorf("expected one error but got %v", errMsgs)
12531253
}
@@ -1256,8 +1256,8 @@ func TestTokensUpgrade(network *integration.Infrastructure, auditorId string, on
12561256
}
12571257
return nil
12581258
}, alice)
1259-
CheckOwnerDB(network, nil, issuer, bob, charlie, manager)
1260-
CheckAuditorDB(network, auditor, "", nil)
1259+
CheckOwnerStore(network, nil, issuer, bob, charlie, manager)
1260+
CheckAuditorStore(network, auditor, "", nil)
12611261
CheckBalanceAndHolding(network, alice, "", "EUR", 110, auditor)
12621262
CheckBalanceAndHolding(network, bob, "", "EUR", 0, auditor)
12631263

@@ -1271,8 +1271,8 @@ func TestTokensUpgrade(network *integration.Infrastructure, auditorId string, on
12711271
TransferCash(network, alice, "", "EUR", 110, bob, auditor)
12721272
// CopyDBsTo(network, "./testdata", alice)
12731273
// all the tokens are spendable now
1274-
CheckOwnerDB(network, nil, issuer, alice, bob, charlie, manager)
1275-
CheckAuditorDB(network, auditor, "", nil)
1274+
CheckOwnerStore(network, nil, issuer, alice, bob, charlie, manager)
1275+
CheckAuditorStore(network, auditor, "", nil)
12761276
CheckBalanceAndHolding(network, alice, "", "EUR", 0, auditor)
12771277
CheckBalanceAndHolding(network, bob, "", "EUR", 110, auditor)
12781278
}
@@ -1303,8 +1303,8 @@ func TestLocalTokensUpgrade(network *integration.Infrastructure, auditorId strin
13031303
IssueSuccessfulCash(network, "", "EUR", 110, alice, auditor, true, issuer, endorsers...)
13041304
CheckBalanceAndHolding(network, alice, "", "EUR", 110, auditor)
13051305
CheckBalanceAndHolding(network, bob, "", "EUR", 0, auditor)
1306-
CheckOwnerDB(network, nil, issuer, alice, bob, charlie, manager)
1307-
CheckAuditorDB(network, auditor, "", nil)
1306+
CheckOwnerStore(network, nil, issuer, alice, bob, charlie, manager)
1307+
CheckAuditorStore(network, auditor, "", nil)
13081308

13091309
// switch to dlog 32bits, perform a few operations
13101310
tms := GetTMSByAlias(network, "dlog-32bits")
@@ -1319,14 +1319,14 @@ func TestLocalTokensUpgrade(network *integration.Infrastructure, auditorId strin
13191319
Eventually(DoesWalletExist).WithArguments(network, alice, "mango", views.OwnerWallet).WithTimeout(1 * time.Minute).WithPolling(15 * time.Second).Should(Equal(false))
13201320
Eventually(DoesWalletExist).WithArguments(network, auditor, "", views.AuditorWallet).WithTimeout(1 * time.Minute).WithPolling(15 * time.Second).Should(Equal(true))
13211321

1322-
CheckOwnerDB(network, nil, issuer, alice, bob, charlie, manager)
1323-
CheckAuditorDB(network, auditor, "", nil)
1322+
CheckOwnerStore(network, nil, issuer, alice, bob, charlie, manager)
1323+
CheckAuditorStore(network, auditor, "", nil)
13241324
CheckBalanceAndHolding(network, alice, "", "EUR", 110, auditor)
13251325
CheckBalanceAndHolding(network, bob, "", "EUR", 0, auditor)
13261326

13271327
TransferCash(network, alice, "", "EUR", 110, bob, auditor)
1328-
CheckOwnerDB(network, nil, issuer, alice, bob, charlie, manager)
1329-
CheckAuditorDB(network, auditor, "", nil)
1328+
CheckOwnerStore(network, nil, issuer, alice, bob, charlie, manager)
1329+
CheckAuditorStore(network, auditor, "", nil)
13301330
CheckBalanceAndHolding(network, alice, "", "EUR", 0, auditor)
13311331
CheckBalanceAndHolding(network, bob, "", "EUR", 110, auditor)
13321332
}
@@ -1356,8 +1356,8 @@ func TestIdemixIssuerPublicKeyRotation(network *integration.Infrastructure, audi
13561356
Eventually(DoesWalletExist).WithArguments(network, alice, "mango", views.OwnerWallet).WithTimeout(1 * time.Minute).WithPolling(15 * time.Second).Should(Equal(false))
13571357
IssueSuccessfulCash(network, "", "EUR", 110, alice, auditor, true, issuer, endorsers...)
13581358
CheckBalanceAndHolding(network, alice, "", "EUR", 110, auditor)
1359-
CheckOwnerDB(network, nil, issuer, alice, bob, charlie, manager)
1360-
CheckAuditorDB(network, auditor, "", nil)
1359+
CheckOwnerStore(network, nil, issuer, alice, bob, charlie, manager)
1360+
CheckAuditorStore(network, auditor, "", nil)
13611361

13621362
// switch to dlog 32bits, perform a few operations
13631363
tms := GetTMSByAlias(network, "dlog-32bits")
@@ -1372,14 +1372,14 @@ func TestIdemixIssuerPublicKeyRotation(network *integration.Infrastructure, audi
13721372
Eventually(DoesWalletExist).WithArguments(network, alice, "mango", views.OwnerWallet).WithTimeout(1 * time.Minute).WithPolling(15 * time.Second).Should(Equal(false))
13731373
Eventually(DoesWalletExist).WithArguments(network, auditor, "", views.AuditorWallet).WithTimeout(1 * time.Minute).WithPolling(15 * time.Second).Should(Equal(true))
13741374

1375-
CheckOwnerDB(network, nil, issuer, alice, bob, charlie, manager)
1376-
CheckAuditorDB(network, auditor, "", nil)
1375+
CheckOwnerStore(network, nil, issuer, alice, bob, charlie, manager)
1376+
CheckAuditorStore(network, auditor, "", nil)
13771377
CheckBalanceAndHolding(network, alice, "", "EUR", 110, auditor)
13781378
CheckBalanceAndHolding(network, bob, "", "EUR", 0, auditor)
13791379

13801380
TransferCash(network, alice, "", "EUR", 110, bob, auditor)
1381-
CheckOwnerDB(network, nil, issuer, alice, bob, charlie, manager)
1382-
CheckAuditorDB(network, auditor, "", nil)
1381+
CheckOwnerStore(network, nil, issuer, alice, bob, charlie, manager)
1382+
CheckAuditorStore(network, auditor, "", nil)
13831383
CheckBalanceAndHolding(network, alice, "", "EUR", 0, auditor)
13841384
CheckBalanceAndHolding(network, bob, "", "EUR", 110, auditor)
13851385

@@ -1408,14 +1408,14 @@ func TestIdemixIssuerPublicKeyRotation(network *integration.Infrastructure, audi
14081408
Eventually(DoesWalletExist).WithArguments(network, alice, "mango", views.OwnerWallet).WithTimeout(1 * time.Minute).WithPolling(15 * time.Second).Should(Equal(false))
14091409
Eventually(DoesWalletExist).WithArguments(network, auditor, "", views.AuditorWallet).WithTimeout(1 * time.Minute).WithPolling(15 * time.Second).Should(Equal(true))
14101410

1411-
CheckOwnerDB(network, nil, issuer, alice, bob, charlie, manager)
1412-
CheckAuditorDB(network, auditor, "", nil)
1411+
CheckOwnerStore(network, nil, issuer, alice, bob, charlie, manager)
1412+
CheckAuditorStore(network, auditor, "", nil)
14131413
CheckBalanceAndHolding(network, alice, "", "EUR", 0, auditor)
14141414
CheckBalanceAndHolding(network, bob, "", "EUR", 110, auditor)
14151415

14161416
TransferCash(network, bob, "", "EUR", 110, alice, auditor)
1417-
CheckOwnerDB(network, nil, issuer, alice, bob, charlie, manager)
1418-
CheckAuditorDB(network, auditor, "", nil)
1417+
CheckOwnerStore(network, nil, issuer, alice, bob, charlie, manager)
1418+
CheckAuditorStore(network, auditor, "", nil)
14191419
CheckBalanceAndHolding(network, alice, "", "EUR", 110, auditor)
14201420
CheckBalanceAndHolding(network, bob, "", "EUR", 0, auditor)
14211421
CopyDBsTo(network, "./testdata", alice)

integration/token/interop/support.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func CheckPublicParams(network *integration.Infrastructure, tmsID token.TMSID, i
180180
}
181181
}
182182

183-
func CheckOwnerDB(network *integration.Infrastructure, tmsID token.TMSID, expectedErrors []string, ids ...*token3.NodeReference) {
183+
func CheckOwnerStore(network *integration.Infrastructure, tmsID token.TMSID, expectedErrors []string, ids ...*token3.NodeReference) {
184184
for _, id := range ids {
185185
for _, replicaName := range id.AllNames() {
186186
errorMessagesBoxed, err := network.Client(replicaName).CallView("CheckTTXDB", common.JSONMarshall(&views.CheckTTXDB{
@@ -205,7 +205,7 @@ func CheckOwnerDB(network *integration.Infrastructure, tmsID token.TMSID, expect
205205
}
206206
}
207207

208-
func CheckAuditorDB(network *integration.Infrastructure, tmsID token.TMSID, auditor *token3.NodeReference, walletID string, errorCheck func([]string) error) {
208+
func CheckAuditorStore(network *integration.Infrastructure, tmsID token.TMSID, auditor *token3.NodeReference, walletID string, errorCheck func([]string) error) {
209209
errorMessagesBoxed, err := network.Client(auditor.ReplicaName()).CallView("CheckTTXDB", common.JSONMarshall(&views.CheckTTXDB{
210210
Auditor: true,
211211
AuditorWalletID: walletID,

0 commit comments

Comments
 (0)