MCPcopy
hub / github.com/hyperledger/fabric / putPrivateKey

Method putPrivateKey

integration/chaincode/multi/chaincode.go:92–104  ·  view source on GitHub ↗

put to private key with a collection is not exists

(stub shim.ChaincodeStubInterface, numberCallsPut string)

Source from the content-addressed store, hash-verified

90
91// put to private key with a collection is not exists
92func (t *Operations) putPrivateKey(stub shim.ChaincodeStubInterface, numberCallsPut string) *pb.Response {
93 cntCall, _ := strconv.Atoi(numberCallsPut)
94
95 for i := range cntCall {
96 key := "key" + strconv.Itoa(i)
97 col := "col" + strconv.Itoa(i)
98 err := stub.PutPrivateData(col, key, []byte(key))
99 if err != nil {
100 return shim.Error(err.Error())
101 }
102 }
103 return shim.Success(nil)
104}
105
106// getMultiple - get multiple states
107func (t *Operations) getMultiple(stub shim.ChaincodeStubInterface, countKeys string) *pb.Response {

Callers 1

InvokeMethod · 0.95

Calls 2

ErrorMethod · 0.65
PutPrivateDataMethod · 0.45

Tested by

no test coverage detected