Skip to content

Commit accc933

Browse files
adecaroarner
authored andcommitted
this commit does the following:
- all the fungible tests have OnlyUnit set to true. - RestoreTMS will only take care of the Pending transaction. The git issue (hyperledger-labs#766) tracks the restructuring of the checks and recovery functions Signed-off-by: Angelo De Caro <[email protected]>
1 parent 4584d89 commit accc933

File tree

7 files changed

+9
-3
lines changed

7 files changed

+9
-3
lines changed

integration/token/fungible/dloghsm/dlog_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func newTestSuite(commType fsc.P2PCommunicationType, mask int, factor int, names
5858
WebEnabled: mask&WebEnabled > 0,
5959
SDKs: []api.SDK{&fdlog.SDK{}},
6060
ReplicationOpts: opts,
61+
OnlyUnity: true,
6162
},
6263
))
6364
return ts, selector

integration/token/fungible/fabtoken/fabtoken_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ func newTestSuite(commType fsc.P2PCommunicationType, factor int, names ...string
6666
ReplicationOpts: opts,
6767
WebEnabled: true, // Needed for the Remote Wallet with websockets
6868
//FSCLogSpec: "token-sdk=debug:fabric-sdk=debug:info",
69+
OnlyUnity: true,
6970
},
7071
))
7172
return ts, selector

integration/token/fungible/odlog/dlog_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func newTestSuite(commType fsc.P2PCommunicationType, factor int, names ...string
4141
//FSCLogSpec: "token-sdk=debug:orion-sdk=debug:info",
4242
//FSCLogSpec: "token-sdk=debug:orion-sdk=debug:view-sdk.services.comm=debug:info",
4343
ReplicationOpts: opts,
44+
OnlyUnity: true,
4445
},
4546
))
4647
return ts, selector

integration/token/fungible/ofabtoken/fabtoken_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func newTestSuite(commType fsc.P2PCommunicationType, factor int, names ...string
3939
Aries: true,
4040
SDKs: []api.SDK{&ofabtoken.SDK{}},
4141
ReplicationOpts: opts,
42+
OnlyUnity: true,
4243
},
4344
))
4445
return ts, selector

token/services/auditor/manager.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func (cm *Manager) Auditor(tmsID token.TMSID) (*Auditor, error) {
6767
return cm.getAuditor(tmsID)
6868
}
6969

70+
// RestoreTMS restores the auditdb corresponding to the passed TMS ID.
7071
func (cm *Manager) RestoreTMS(tmsID token.TMSID) error {
7172
logger.Infof("restore audit dbs for entry [%s]...", tmsID)
7273
if err := cm.restore(tmsID); err != nil {
@@ -134,7 +135,7 @@ func (cm *Manager) restore(tmsID token.TMSID) error {
134135
if err != nil {
135136
return errors.WithMessagef(err, "failed to get auditor for [%s]", tmsID)
136137
}
137-
it, err := auditor.auditDB.TokenRequests(auditdb.QueryTokenRequestsParams{Statuses: []TxStatus{auditdb.Pending, auditdb.Unknown, auditdb.Deleted}})
138+
it, err := auditor.auditDB.TokenRequests(auditdb.QueryTokenRequestsParams{Statuses: []TxStatus{auditdb.Pending}})
138139
if err != nil {
139140
return errors.Errorf("failed to get tx iterator for [%s]", tmsID)
140141
}

token/services/tokens/tokens.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func (t *Tokens) Append(ctx context.Context, tmsID token.TMSID, txID string, req
119119
if err = ts.Commit(); err != nil {
120120
return errors.WithMessagef(err, "transaction [%s], failed to commit tokens to database", txID)
121121
}
122-
logger.Debugf("transaction [%s], committed tokens to database", txID)
122+
logger.Debugf("transaction [%s], committed tokens [%d:%d] to database", txID, len(toAppend), len(toSpend))
123123

124124
return nil
125125
}

token/services/ttx/manager.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ func (m *Manager) newDB(tmsID token.TMSID) (*DB, error) {
108108
return wrapper, nil
109109
}
110110

111+
// RestoreTMS restores the auditdb corresponding to the passed TMS ID.
111112
func (m *Manager) RestoreTMS(tmsID token.TMSID) error {
112113
net, err := m.networkProvider.GetNetwork(tmsID.Network, tmsID.Channel)
113114
if err != nil {
@@ -119,7 +120,7 @@ func (m *Manager) RestoreTMS(tmsID token.TMSID) error {
119120
return errors.WithMessagef(err, "failed to get db for [%s:%s]", tmsID.Network, tmsID.Channel)
120121
}
121122

122-
it, err := db.ttxDB.TokenRequests(ttxdb.QueryTokenRequestsParams{Statuses: []TxStatus{driver.Pending, driver.Unknown, driver.Deleted}})
123+
it, err := db.ttxDB.TokenRequests(ttxdb.QueryTokenRequestsParams{Statuses: []TxStatus{driver.Pending}})
123124
if err != nil {
124125
return errors.WithMessagef(err, "failed to get tx iterator for [%s:%s:%s]", tmsID.Network, tmsID.Channel, tmsID)
125126
}

0 commit comments

Comments
 (0)