March 2019
Intermediate to advanced
636 pages
27h 50m
English
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 ...Read now
Unlock full access