// QuerySreCC query the chaincode to get the state of sreCC

QuerySreCC query the chaincode to get the state of sreCC
// QuerySreCC query the chaincode to get the state of sreCC
func (setup *FabricSetup) QuerySreCC(value string) (string, error) {
	var args []string
	args = append(args, "invoke")
	args = append(args, "query")
	args = append(args, value)
	response, err := setup.client.Query(channel.Request{ChaincodeID: setup.ChainCodeID, Fcn: args[0], Args: [][]byte{[]byte(args[1]), []byte(args[2])}})
	if err != nil {
		return "", fmt.Errorf("failed to srezd-service query: %v", err)
	}
	if strings.EqualFold(string(response.Payload),"[]") {
		for _, ccid := range setup.ChainCodeListID {
			if strings.EqualFold(ccid,setup.ChainCodeID) {
				continue
			}else{
				response, err = setup.client.Query(channel.Request{ChaincodeID: "srezd1-service", Fcn: args[0], Args: [][]byte{[]byte(args[1]), []byte(args[2])}})
				if err != nil {
					return "", fmt.Errorf("failed to srezd1-service query: %v", err)
				}
			}
		}
	}
	return string(response.Payload), nil
}
func ( setup * FabricSetup ) QuerySreCC ( value string ) ( string , error ) { var args [ ] string args = append ( args , " " ) args = append ( args , " " ) args = append ( args , value ) response , err := setup . client . Query ( channel . Request { ChaincodeID : setup . ChainCodeID , Fcn : args [ 0 ] , Args : [ ] [ ] byte { [ ] byte ( args [ 1 ] ) , [ ] byte ( args [ 2 ] ) } } ) if err != nil { return " " , fmt . Errorf ( " " , err ) } if strings . EqualFold ( string ( response . Payload ) , " " ) { for _ , ccid := range setup . ChainCodeListID { if strings . EqualFold ( ccid , setup . ChainCodeID ) { continue } else { response , err = setup . client . Query ( channel . Request { ChaincodeID : " " , Fcn : args [ 0 ] , Args : [ ] [ ] byte { [ ] byte ( args [ 1 ] ) , [ ] byte ( args [ 2 ] ) } } ) if err != nil { return " " , fmt . Errorf ( " " , err ) } } } } return string ( response . Payload ) , nil }
QuerySreCC query the chaincode to get the state of sreCC
QuerySreCC query the chaincode to get the state of sreCC
// Prepare arguments
