Skip to content

Commit e0407c6

Browse files
committed
test fix with replicas
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
1 parent 2c10771 commit e0407c6

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

integration/token/fungible/support.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ func RegisterOwnerIdentity(network *integration.Infrastructure, id *token3.NodeR
11291129
_, err := network.Client(replicaName).CallView("RegisterOwnerIdentity", common.JSONMarshall(&views.RegisterOwnerIdentity{
11301130
IdentityConfiguration: identityConfiguration,
11311131
}))
1132-
Expect(err).NotTo(HaveOccurred())
1132+
Expect(err).NotTo(HaveOccurred(), "cannot register owner identity at replica [%s]", replicaName)
11331133
network.Ctx.SetViewClient(identityConfiguration.ID, network.Client(replicaName))
11341134
}
11351135
}

token/services/db/sql/common/identity.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (db *IdentityDB) AddConfiguration(wp driver.IdentityConfiguration) error {
9797
if err != nil {
9898
return errors.Wrapf(err, "failed compiling query")
9999
}
100-
logger.Debug(query)
100+
logger.Debug(query, wp.ID, wp.Type, wp.URL, wp.Config, wp.Raw)
101101

102102
_, err = db.db.Exec(query, wp.ID, wp.Type, wp.URL, wp.Config, wp.Raw)
103103
return err

token/services/identity/common/lm.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func (l *LocalMembership) registerLocalIdentity(identityConfig *driver.IdentityC
312312
return errors.Wrapf(err, "failed to add local identity for [%s]", identityConfig.ID)
313313
}
314314

315-
if exists, _ := l.identityDB.ConfigurationExists(identityConfig.ID, identityConfig.Type, identityConfig.URL); !exists {
315+
if exists, _ := l.identityDB.ConfigurationExists(identityConfig.ID, l.IdentityType, identityConfig.URL); !exists {
316316
l.logger.Debugf("does the configuration already exists for [%s]? no, add it", identityConfig.ID)
317317
if err := l.identityDB.AddConfiguration(driver3.IdentityConfiguration{
318318
ID: identityConfig.ID,
@@ -348,6 +348,7 @@ func (l *LocalMembership) registerLocalIdentities(configuration *driver.Identity
348348
return nil
349349
}
350350
found := 0
351+
var errs []error
351352
for _, entry := range entries {
352353
if !entry.IsDir() {
353354
continue
@@ -358,13 +359,14 @@ func (l *LocalMembership) registerLocalIdentities(configuration *driver.Identity
358359
URL: filepath.Join(configuration.URL, id),
359360
Config: configuration.Config,
360361
}, false); err != nil {
362+
errs = append(errs, err)
361363
l.logger.Errorf("failed registering local identity [%s]: [%s]", id, err)
362364
continue
363365
}
364366
found++
365367
}
366368
if found == 0 {
367-
return errors.Errorf("no valid identities found in [%s]", configuration.URL)
369+
return errors.Errorf("no valid identities found in [%s], errs [%v]", configuration.URL, errs)
368370
}
369371
return nil
370372
}

token/services/identity/msp/idemix/kmp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ func (l *KeyManagerProvider) Get(identityConfig *driver.IdentityConfiguration) (
4444
var err error
4545
if len(identityConfig.Raw) != 0 {
4646
// load the msp config directly from identityConfig.Raw
47-
logger.Infof("load the msp config directly from identityConfig.Raw [%s]", hash.Hashable(identityConfig.Raw))
47+
logger.Infof("load the msp config directly from identityConfig.Raw [%s][%s]", identityConfig.ID, hash.Hashable(identityConfig.Raw))
4848
conf, err = msp2.NewMSPConfigFromRawSigner(l.issuerPublicKey, identityConfig.Raw, l.mspID)
4949
} else {
5050
// load from URL
51-
logger.Infof("load the msp config form identityConfig.URL [%s]", identityConfig.URL)
51+
logger.Infof("load the msp config form identityConfig.URL [%s][%s]", identityConfig.ID, identityConfig.URL)
5252
conf, err = msp2.NewMSPConfigFromURL(l.issuerPublicKey, identityConfig.URL, l.mspID, l.ignoreVerifyOnlyWallet)
5353
}
5454
if err != nil {

0 commit comments

Comments
 (0)