mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-23 01:55:10 +00:00
fixed bug
This commit is contained in:
parent
fcd39e5296
commit
ff8d083555
1 changed files with 15 additions and 0 deletions
|
|
@ -56,6 +56,21 @@ public final class ClaimProcessing implements ContractInterface {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the existence of the asset on the ledger
|
||||
*
|
||||
* @param ctx the transaction context
|
||||
* @param assetID the ID of the asset
|
||||
* @return boolean indicating the existence of the asset
|
||||
*/
|
||||
@Transaction(intent = Transaction.TYPE.EVALUATE)
|
||||
public boolean ClaimExists(final Context ctx, final String claimID) {
|
||||
ChaincodeStub stub = ctx.getStub();
|
||||
String claimJSON = stub.getStringState(claimID);
|
||||
|
||||
return (claimJSON != null && !claimJSON.isEmpty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new claim on the ledger.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue