(n *nwo.Network, orderer *nwo.Orderer, chaincodeName string, writeInput []kvexecutor.KVData, peers ...*nwo.Peer)
| 139 | }) |
| 140 | |
| 141 | func writeImplicitCollection(n *nwo.Network, orderer *nwo.Orderer, chaincodeName string, writeInput []kvexecutor.KVData, peers ...*nwo.Peer) { |
| 142 | writeInputBytes, err := json.Marshal(writeInput) |
| 143 | Expect(err).NotTo(HaveOccurred()) |
| 144 | writeInputBase64 := base64.StdEncoding.EncodeToString(writeInputBytes) |
| 145 | |
| 146 | peerAddresses := make([]string, 0) |
| 147 | for _, peer := range peers { |
| 148 | peerAddresses = append(peerAddresses, n.PeerAddress(peer, nwo.ListenPort)) |
| 149 | } |
| 150 | command := commands.ChaincodeInvoke{ |
| 151 | ChannelID: channelID, |
| 152 | Orderer: n.OrdererAddress(orderer, nwo.ListenPort), |
| 153 | Name: chaincodeName, |
| 154 | Ctor: fmt.Sprintf(`{"Args":["readWriteKVs","%s","%s"]}`, "", writeInputBase64), |
| 155 | PeerAddresses: peerAddresses, |
| 156 | WaitForEvent: true, |
| 157 | } |
| 158 | invokeChaincode(n, peers[0], command) |
| 159 | nwo.WaitUntilEqualLedgerHeight(n, channelID, nwo.GetLedgerHeight(n, peers[0], channelID), n.Peers...) |
| 160 | } |
| 161 | |
| 162 | func readImplicitCollection(n *nwo.Network, peer *nwo.Peer, chaincodeName string, readInput []kvexecutor.KVData, expectedMsg string, expectSuccess bool) { |
| 163 | readInputBytes, err := json.Marshal(readInput) |
no test coverage detected