From f3b00deecbcaecd5effe43ea5bd3b6f739ae4bc8 Mon Sep 17 00:00:00 2001 From: projet Date: Thu, 4 Apr 2019 10:48:36 +0200 Subject: [PATCH] preprod version --- monnethic.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/monnethic.go b/monnethic.go index e5d76af..80090ce 100644 --- a/monnethic.go +++ b/monnethic.go @@ -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()) }