preprod version

This commit is contained in:
projet 2019-04-04 10:48:36 +02:00
parent 60b5414944
commit f3b00deecb

View file

@ -148,9 +148,9 @@ func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {
} else if function == "getHistoryForWallet" {
// make a transaction of X units from a wallet to an other
return t.getHistoryForWallet(stub, args)
} else if function == "getAllWallets" {
// get All Wallets
return t.getAllWallets(stub, args)
} else if function == "getAllEntities" {
// get All Entities of the present ledger
return t.getAllEntities(stub, args)
}
return shim.Error("Invalid invoke function name. Expecting \"invoke\" \"delete\" \"query\" \"register\"")
@ -850,7 +850,7 @@ func (t *SimpleChaincode) queryWalletsByOwner(stub shim.ChaincodeStubInterface,
return shim.Error("Incorrect number of arguments. Expecting 1")
}
owner := strings.ToLower(args[0])
owner := args[0]
queryString := fmt.Sprintf("{\"selector\":{\"docType\":\"wallet\",\"owner\":\"%s\"}}", owner)
@ -982,7 +982,7 @@ func (t *SimpleChaincode) getHistoryForWallet(stub shim.ChaincodeStubInterface,
}
func (t *SimpleChaincode) getAllWallets(stub shim.ChaincodeStubInterface, args []string) pb.Response {
func (t *SimpleChaincode) getAllEntities(stub shim.ChaincodeStubInterface, args []string) pb.Response {
if len(args) < 2 {
return shim.Error("Incorrect number of arguments. Expecting 2")
@ -1002,7 +1002,7 @@ func (t *SimpleChaincode) getAllWallets(stub shim.ChaincodeStubInterface, args [
return shim.Error(err.Error())
}
fmt.Printf("- getAllWallets queryResult:\n%s\n", buffer.String())
fmt.Printf("- getAllEntities queryResult:\n%s\n", buffer.String())
return shim.Success(buffer.Bytes())
}