@@ -196,22 +196,22 @@ func ClaimFungibleAsset(ctx contractapi.TransactionContextInterface, contractId,
196196 if err != nil {
197197 return logThenErrorf (err .Error ())
198198 }
199-
199+
200200 return claimAssetCommon (ctx , assetLockVal .LockInfo , assetLockVal .ExpiryTimeSecs , assetLockVal .Recipient , "" , contractId , claimInfoBytesBase64 )
201201}
202202
203- // ClaimAsset cc is used to record claim of an asset on the ledger (this uses the contractId)
203+ // Record claim of an asset on the ledger (this uses the contractId)
204204func ClaimAssetUsingContractId (ctx contractapi.TransactionContextInterface , contractId , claimInfoBytesBase64 string ) error {
205205
206206 assetLockKey , assetLockVal , err := fetchLockStateUsingContractId (ctx , contractId )
207207 if err != nil {
208208 return logThenErrorf (err .Error ())
209209 }
210-
210+
211211 return claimAssetCommon (ctx , assetLockVal .GetLockInfo (), assetLockVal .GetExpiryTimeSecs (), assetLockVal .GetRecipient (), assetLockKey , contractId , claimInfoBytesBase64 )
212212}
213213
214- // Common Claim function for both fungible and non-fungible assets,
214+ // Common Claim function for both fungible and non-fungible assets,
215215// with or without contractId
216216func claimAssetCommon (ctx contractapi.TransactionContextInterface , lockInfo interface {}, expiryTimeSecs uint64 , recipient , assetLockKey , contractId , claimInfoBytesBase64 string ) error {
217217
@@ -261,7 +261,7 @@ func claimAssetCommon(ctx contractapi.TransactionContextInterface, lockInfo inte
261261 if err != nil {
262262 return logThenErrorf ("failed to delete lock for the asset associated with the contractId %s: %+v" , contractId , err )
263263 }
264-
264+
265265 err = ctx .GetStub ().PutState (generateAssetLockMapKey (assetLockKey ), []byte (contractId ))
266266 if err != nil {
267267 return logThenErrorf ("failed to write to the world state: %+v" , err )
@@ -333,7 +333,7 @@ func UnlockFungibleAsset(ctx contractapi.TransactionContextInterface, contractId
333333 if err != nil {
334334 return logThenErrorf (err .Error ())
335335 }
336-
336+
337337 return unlockAssetCommon (ctx , assetLockVal .ExpiryTimeSecs , assetLockVal .Locker , "" , contractId )
338338}
339339
@@ -344,14 +344,14 @@ func UnlockAssetUsingContractId(ctx contractapi.TransactionContextInterface, con
344344 if err != nil {
345345 return logThenErrorf (err .Error ())
346346 }
347-
347+
348348 return unlockAssetCommon (ctx , assetLockVal .GetExpiryTimeSecs (), assetLockVal .GetLocker (), assetLockKey , contractId )
349349}
350350
351351// Common unlock functions for both fungible and non-fungible assets,
352352// with or without contractId
353353func unlockAssetCommon (ctx contractapi.TransactionContextInterface , expiryTimeSecs uint64 , locker , assetLockKey , contractId string ) error {
354-
354+
355355 txCreatorECertBase64 , err := getECertOfTxCreatorBase64 (ctx )
356356 if err != nil {
357357 return logThenErrorf ("unable to get the transaction creator information: %+v" , err )
@@ -470,7 +470,7 @@ func IsAssetLockedQueryUsingContractId(ctx contractapi.TransactionContextInterfa
470470 if err != nil {
471471 errStr := fmt .Sprintf ("no contractId %s exists on the ledger" , contractId )
472472 errStrFungible := fmt .Sprintf ("contractId %s is not associated with any currently locked asset" , contractId )
473-
473+
474474 // Reporting no error only if the lock contract doesn't exist at all
475475 if err .Error () == errStr || err .Error () == errStrFungible {
476476 return false , nil
@@ -486,5 +486,3 @@ func IsAssetLockedQueryUsingContractId(ctx contractapi.TransactionContextInterfa
486486
487487 return true , nil
488488}
489-
490-
0 commit comments