You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assert.NoError(err, "failed to get transaction iterators")
72
-
deferit.Close()
73
-
for {
74
-
transactionRecord, err:=it.Next()
75
-
assert.NoError(err, "failed to get next transaction record")
76
-
iftransactionRecord==nil {
77
-
break
78
-
}
79
-
80
-
// compare the status in the vault with the status of the record
81
-
vc, _, err:=v.Status(transactionRecord.TxID)
82
-
iferr!=nil {
83
-
errorMessages=append(errorMessages, fmt.Sprintf("failed to get vault status transaction record [%s]: [%s]", transactionRecord.TxID, err))
84
-
continue
85
-
}
86
-
switch {
87
-
casevc==network.Unknown:
88
-
errorMessages=append(errorMessages, fmt.Sprintf("transaction record [%s] is unknown for vault but not for the db [%s]", transactionRecord.TxID, driver.TxStatusMessage[transactionRecord.Status]))
assert.NoError(err, "failed to retrieve token request for [%s]", transactionRecord.TxID)
110
-
assert.NotNil(tokenRequest, "token requests must not be nil")
111
-
112
-
// check the ledger
113
-
lVC, _, err:=l.Status(transactionRecord.TxID)
114
-
iferr!=nil {
115
-
lVC=network.Unknown
116
-
}
117
-
switch {
118
-
casevc==network.Valid&&lVC!=network.Valid:
119
-
iferr!=nil {
120
-
errorMessages=append(errorMessages, fmt.Sprintf("failed to get ledger transaction status for [%s]: [%s]", transactionRecord.TxID, err))
121
-
}
122
-
errorMessages=append(errorMessages, fmt.Sprintf("transaction record [%s] is valid for vault but not for the ledger [%d]", transactionRecord.TxID, lVC))
errorMessages=append(errorMessages, fmt.Sprintf("failed to get ledger transaction status for [%s]: [%s]", transactionRecord.TxID, err))
127
-
}
128
-
errorMessages=append(errorMessages, fmt.Sprintf("transaction record [%s] is invalid for vault but not for the ledger [%d]", transactionRecord.TxID, lVC))
129
-
}
130
-
casevc==network.Unknown&&lVC!=network.Unknown:
131
-
iferr!=nil {
132
-
errorMessages=append(errorMessages, fmt.Sprintf("failed to get ledger transaction status for [%s]: [%s]", transactionRecord.TxID, err))
133
-
}
134
-
errorMessages=append(errorMessages, fmt.Sprintf("transaction record [%s] is unknown for vault but not for the ledger [%d]", transactionRecord.TxID, lVC))
135
-
casevc==network.Busy&&lVC==network.Busy:
136
-
// this is fine, let's continue
137
-
casevc==network.Busy&&lVC!=network.Unknown:
138
-
iferr!=nil {
139
-
errorMessages=append(errorMessages, fmt.Sprintf("failed to get ledger transaction status for [%s]: [%s]", transactionRecord.TxID, err))
140
-
}
141
-
errorMessages=append(errorMessages, fmt.Sprintf("transaction record [%s] is busy for vault but not for the ledger [%d]", transactionRecord.TxID, lVC))
0 commit comments