// ===============================================
// readMarble - read a marble from chaincode state
// ===============================================

read a marble from chaincode state
// =============================================== // readMarble - read a marble from chaincode state // ===============================================
func (t *HeroesServiceChaincode) readHoer(stub shim.ChaincodeStubInterface, args []string) pb.Response {
	var name, jsonResp string
	if len(args) != 1 {
		return shim.Error("Incorrect number of arguments. Expecting name of the marble to query")
	}
	name = args[1]
	valAsbytes, err := stub.GetState(name) 
	if err != nil {
		jsonResp = "{\"Error\":\"Failed to get state for " + name + "\"}"
		return shim.Error(jsonResp)
	} else if valAsbytes == nil {
		jsonResp = "{\"Error\":\"hoer does not exist: " + name + "\"}"
		return shim.Error(jsonResp)
	}
	return shim.Success(valAsbytes)
}
func ( t * HeroesServiceChaincode ) readHoer ( stub shim . ChaincodeStubInterface , args [ ] string ) pb . Response { var name , jsonResp string if len ( args ) != 1 { return shim . Error ( " " ) } name = args [ 1 ] valAsbytes , err := stub . GetState ( name ) if err != nil { jsonResp = " \" \" \" " + name + " \" " return shim . Error ( jsonResp ) } else if valAsbytes == nil { jsonResp = " \" \" \" " + name + " \" " return shim . Error ( jsonResp ) } return shim . Success ( valAsbytes ) }
read a marble from chaincode state
read a marble from chaincode state
//get the hoer from chaincode state
