github.com/hellobchain/third_party@v0.0.0-20230331131523-deb0478a2e52/hyperledger/fabric/core/common/ccprovider/cdspackage.go (about) 1 /* 2 Copyright IBM Corp. 2017 All Rights Reserved. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 /* 17 Notice: This file has been modified for Hyperledger Fabric SDK Go usage. 18 Please review third_party pinning scripts and patches for more details. 19 */ 20 21 package ccprovider 22 23 import ( 24 "github.com/golang/protobuf/proto" 25 ) 26 27 //----- CDSData ------ 28 29 //CDSData is data stored in the LSCC on instantiation of a CC 30 //for CDSPackage. This needs to be serialized for ChaincodeData 31 //hence the protobuf format 32 type CDSData struct { 33 //CodeHash hash of CodePackage from ChaincodeDeploymentSpec 34 CodeHash []byte `protobuf:"bytes,1,opt,name=codehash,proto3"` 35 36 //MetaDataHash hash of Name and Version from ChaincodeDeploymentSpec 37 MetaDataHash []byte `protobuf:"bytes,2,opt,name=metadatahash,proto3"` 38 } 39 40 //----implement functions needed from proto.Message for proto's mar/unmarshal functions 41 42 //Reset resets 43 func (data *CDSData) Reset() { *data = CDSData{} } 44 45 //String converts to string 46 func (data *CDSData) String() string { return proto.CompactTextString(data) } 47 48 //ProtoMessage just exists to make proto happy 49 func (*CDSData) ProtoMessage() {}