RequestedInfo

After the insuree reports a loss, the next step is for the broker to return RequestedInfo, as follows:

func (c *ClaimContract) RequestedInfo(stub shim.ChaincodeStubInterface, args []string) pb.Response {         return c.UpdateClaim(stub, args, "RequestedInfo")}func (c *ClaimContract) UpdateClaim(stub shim.ChaincodeStubInterface, args []string, currentStatus string) pb.Response {         claimId := args[0]         comment := args[1]         claimBytes, err := stub.GetState(claimId)         claim := Claim{}         err = json.Unmarshal(claimBytes, &claim)         if err != nil {                 return shim.Error(err.Error())         }         if currentStatus == "RequestedInfo" && claim.Status != "ReportLost" {                 claim.Status = "Error"                 fmt.Printf("Claim is not initialized yet")                 return shim.Error(err.Error()) } else ...

Get Blockchain Development with Hyperledger now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.