(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor)
| 253 | } |
| 254 | |
| 255 | func (lscc *SCC) ChaincodeEndorsementInfo(channelID, chaincodeName string, qe ledger.SimpleQueryExecutor) (*lifecycle.ChaincodeEndorsementInfo, error) { |
| 256 | chaincodeDataBytes, err := qe.GetState("lscc", chaincodeName) |
| 257 | if err != nil { |
| 258 | return nil, errors.Wrapf(err, "could not retrieve state for chaincode %s", chaincodeName) |
| 259 | } |
| 260 | |
| 261 | if chaincodeDataBytes == nil { |
| 262 | return nil, errors.Errorf("chaincode %s not found", chaincodeName) |
| 263 | } |
| 264 | |
| 265 | chaincodeData := &ccprovider.ChaincodeData{} |
| 266 | err = proto.Unmarshal(chaincodeDataBytes, chaincodeData) |
| 267 | if err != nil { |
| 268 | return nil, errors.Wrapf(err, "chaincode %s has bad definition", chaincodeName) |
| 269 | } |
| 270 | |
| 271 | ls := &LegacySecurity{ |
| 272 | Support: lscc.Support, |
| 273 | PackageCache: &lscc.PackageCache, |
| 274 | } |
| 275 | |
| 276 | err = ls.SecurityCheckLegacyChaincode(chaincodeData) |
| 277 | if err != nil { |
| 278 | return nil, errors.WithMessage(err, "failed security checks") |
| 279 | } |
| 280 | |
| 281 | return &lifecycle.ChaincodeEndorsementInfo{ |
| 282 | Version: chaincodeData.Version, |
| 283 | EndorsementPlugin: chaincodeData.Escc, |
| 284 | ChaincodeID: chaincodeData.Name + ":" + chaincodeData.Version, |
| 285 | }, nil |
| 286 | } |
| 287 | |
| 288 | // ValidationInfo returns name&arguments of the validation plugin for the supplied chaincode. |
| 289 | // The function returns two types of errors, unexpected errors and validation errors. The |
nothing calls this directly
no test coverage detected