(txType cb.HeaderType, channelID string, creator []byte)
| 1218 | } |
| 1219 | |
| 1220 | func createHeader(txType cb.HeaderType, channelID string, creator []byte) (*cb.Header, error) { |
| 1221 | nonce, err := crypto.GetRandomNonce() |
| 1222 | if err != nil { |
| 1223 | return nil, err |
| 1224 | } |
| 1225 | chdr := &cb.ChannelHeader{ |
| 1226 | Type: int32(txType), |
| 1227 | ChannelId: channelID, |
| 1228 | TxId: protoutil.ComputeTxID(nonce, creator), |
| 1229 | Epoch: 0, |
| 1230 | Timestamp: timestamppb.Now(), |
| 1231 | } |
| 1232 | chdrBytes := protoutil.MarshalOrPanic(chdr) |
| 1233 | |
| 1234 | shdr := &cb.SignatureHeader{ |
| 1235 | Creator: creator, |
| 1236 | Nonce: nonce, |
| 1237 | } |
| 1238 | shdrBytes := protoutil.MarshalOrPanic(shdr) |
| 1239 | header := &cb.Header{ |
| 1240 | ChannelHeader: chdrBytes, |
| 1241 | SignatureHeader: shdrBytes, |
| 1242 | } |
| 1243 | return header, nil |
| 1244 | } |
| 1245 | |
| 1246 | // verify collection names and pvtdataMap match expectedKVWritesMap |
| 1247 | func assertPrivateDataAsExpected(pvtdataMap map[uint64]*rwset.TxPvtReadWriteSet, expectedKVWritesMap map[string]map[string][]byte) { |
no test coverage detected