put to state keys from "key0" to "key(cntCall-1)"
(stub shim.ChaincodeStubInterface, numberCallsPut string)
| 66 | |
| 67 | // put to state keys from "key0" to "key(cntCall-1)" |
| 68 | func (t *Operations) put(stub shim.ChaincodeStubInterface, numberCallsPut string) *pb.Response { |
| 69 | cntCall, _ := strconv.Atoi(numberCallsPut) |
| 70 | |
| 71 | for i := range cntCall { |
| 72 | key := "key" + strconv.Itoa(i) |
| 73 | err := stub.PutState(key, []byte(key)) |
| 74 | if err != nil { |
| 75 | return shim.Error(err.Error()) |
| 76 | } |
| 77 | } |
| 78 | return shim.Success(nil) |
| 79 | } |
| 80 | |
| 81 | func (t *Operations) getKey(stub shim.ChaincodeStubInterface, keyUniq string) *pb.Response { |
| 82 | key := "key" + keyUniq |