Re: return type of chaincode functions using EvaluateTransaction


Nikos Karamolegkos
 

the
evaluateResult, err := contract.EvaluateTransaction("GetAirQNomVals")
returns Invalid type. Expected: array, given: string - Transaction processing for endorser


func (s *smartContract) GetAirQNomVals(ctx contractapi.TransactionContextInterface) ([]byte, error) {
resultsIterator, err := ctx.GetStub().GetState("NominalValuesState")

if err != nil {
return nil, fmt.Errorf("failed to read from world state. %s", err.Error())
}

if resultsIterator == nil {
return nil, fmt.Errorf("%s does not exist", "NominalValuesState")
}


return resultsIterator, nil
}

Join fabric@lists.hyperledger.org to automatically receive all group messages.