63 Star 183 Fork 3

Gitee 极速下载/hyperledger-fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/hyperledger/fabric
克隆/下载
cc_package.go 16.14 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
// Code generated by counterfeiter. DO NOT EDIT.
package mock
import (
"sync"
"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric/core/common/ccprovider"
pb "github.com/hyperledger/fabric/protos/peer"
)
type CCPackage struct {
InitFromBufferStub func(buf []byte) (*ccprovider.ChaincodeData, error)
initFromBufferMutex sync.RWMutex
initFromBufferArgsForCall []struct {
buf []byte
}
initFromBufferReturns struct {
result1 *ccprovider.ChaincodeData
result2 error
}
initFromBufferReturnsOnCall map[int]struct {
result1 *ccprovider.ChaincodeData
result2 error
}
InitFromFSStub func(ccname string, ccversion string) ([]byte, *pb.ChaincodeDeploymentSpec, error)
initFromFSMutex sync.RWMutex
initFromFSArgsForCall []struct {
ccname string
ccversion string
}
initFromFSReturns struct {
result1 []byte
result2 *pb.ChaincodeDeploymentSpec
result3 error
}
initFromFSReturnsOnCall map[int]struct {
result1 []byte
result2 *pb.ChaincodeDeploymentSpec
result3 error
}
PutChaincodeToFSStub func() error
putChaincodeToFSMutex sync.RWMutex
putChaincodeToFSArgsForCall []struct{}
putChaincodeToFSReturns struct {
result1 error
}
putChaincodeToFSReturnsOnCall map[int]struct {
result1 error
}
GetDepSpecStub func() *pb.ChaincodeDeploymentSpec
getDepSpecMutex sync.RWMutex
getDepSpecArgsForCall []struct{}
getDepSpecReturns struct {
result1 *pb.ChaincodeDeploymentSpec
}
getDepSpecReturnsOnCall map[int]struct {
result1 *pb.ChaincodeDeploymentSpec
}
GetDepSpecBytesStub func() []byte
getDepSpecBytesMutex sync.RWMutex
getDepSpecBytesArgsForCall []struct{}
getDepSpecBytesReturns struct {
result1 []byte
}
getDepSpecBytesReturnsOnCall map[int]struct {
result1 []byte
}
ValidateCCStub func(ccdata *ccprovider.ChaincodeData) error
validateCCMutex sync.RWMutex
validateCCArgsForCall []struct {
ccdata *ccprovider.ChaincodeData
}
validateCCReturns struct {
result1 error
}
validateCCReturnsOnCall map[int]struct {
result1 error
}
GetPackageObjectStub func() proto.Message
getPackageObjectMutex sync.RWMutex
getPackageObjectArgsForCall []struct{}
getPackageObjectReturns struct {
result1 proto.Message
}
getPackageObjectReturnsOnCall map[int]struct {
result1 proto.Message
}
GetChaincodeDataStub func() *ccprovider.ChaincodeData
getChaincodeDataMutex sync.RWMutex
getChaincodeDataArgsForCall []struct{}
getChaincodeDataReturns struct {
result1 *ccprovider.ChaincodeData
}
getChaincodeDataReturnsOnCall map[int]struct {
result1 *ccprovider.ChaincodeData
}
GetIdStub func() []byte
getIdMutex sync.RWMutex
getIdArgsForCall []struct{}
getIdReturns struct {
result1 []byte
}
getIdReturnsOnCall map[int]struct {
result1 []byte
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *CCPackage) InitFromBuffer(buf []byte) (*ccprovider.ChaincodeData, error) {
var bufCopy []byte
if buf != nil {
bufCopy = make([]byte, len(buf))
copy(bufCopy, buf)
}
fake.initFromBufferMutex.Lock()
ret, specificReturn := fake.initFromBufferReturnsOnCall[len(fake.initFromBufferArgsForCall)]
fake.initFromBufferArgsForCall = append(fake.initFromBufferArgsForCall, struct {
buf []byte
}{bufCopy})
fake.recordInvocation("InitFromBuffer", []interface{}{bufCopy})
fake.initFromBufferMutex.Unlock()
if fake.InitFromBufferStub != nil {
return fake.InitFromBufferStub(buf)
}
if specificReturn {
return ret.result1, ret.result2
}
return fake.initFromBufferReturns.result1, fake.initFromBufferReturns.result2
}
func (fake *CCPackage) InitFromBufferCallCount() int {
fake.initFromBufferMutex.RLock()
defer fake.initFromBufferMutex.RUnlock()
return len(fake.initFromBufferArgsForCall)
}
func (fake *CCPackage) InitFromBufferArgsForCall(i int) []byte {
fake.initFromBufferMutex.RLock()
defer fake.initFromBufferMutex.RUnlock()
return fake.initFromBufferArgsForCall[i].buf
}
func (fake *CCPackage) InitFromBufferReturns(result1 *ccprovider.ChaincodeData, result2 error) {
fake.InitFromBufferStub = nil
fake.initFromBufferReturns = struct {
result1 *ccprovider.ChaincodeData
result2 error
}{result1, result2}
}
func (fake *CCPackage) InitFromBufferReturnsOnCall(i int, result1 *ccprovider.ChaincodeData, result2 error) {
fake.InitFromBufferStub = nil
if fake.initFromBufferReturnsOnCall == nil {
fake.initFromBufferReturnsOnCall = make(map[int]struct {
result1 *ccprovider.ChaincodeData
result2 error
})
}
fake.initFromBufferReturnsOnCall[i] = struct {
result1 *ccprovider.ChaincodeData
result2 error
}{result1, result2}
}
func (fake *CCPackage) InitFromFS(ccname string, ccversion string) ([]byte, *pb.ChaincodeDeploymentSpec, error) {
fake.initFromFSMutex.Lock()
ret, specificReturn := fake.initFromFSReturnsOnCall[len(fake.initFromFSArgsForCall)]
fake.initFromFSArgsForCall = append(fake.initFromFSArgsForCall, struct {
ccname string
ccversion string
}{ccname, ccversion})
fake.recordInvocation("InitFromFS", []interface{}{ccname, ccversion})
fake.initFromFSMutex.Unlock()
if fake.InitFromFSStub != nil {
return fake.InitFromFSStub(ccname, ccversion)
}
if specificReturn {
return ret.result1, ret.result2, ret.result3
}
return fake.initFromFSReturns.result1, fake.initFromFSReturns.result2, fake.initFromFSReturns.result3
}
func (fake *CCPackage) InitFromFSCallCount() int {
fake.initFromFSMutex.RLock()
defer fake.initFromFSMutex.RUnlock()
return len(fake.initFromFSArgsForCall)
}
func (fake *CCPackage) InitFromFSArgsForCall(i int) (string, string) {
fake.initFromFSMutex.RLock()
defer fake.initFromFSMutex.RUnlock()
return fake.initFromFSArgsForCall[i].ccname, fake.initFromFSArgsForCall[i].ccversion
}
func (fake *CCPackage) InitFromFSReturns(result1 []byte, result2 *pb.ChaincodeDeploymentSpec, result3 error) {
fake.InitFromFSStub = nil
fake.initFromFSReturns = struct {
result1 []byte
result2 *pb.ChaincodeDeploymentSpec
result3 error
}{result1, result2, result3}
}
func (fake *CCPackage) InitFromFSReturnsOnCall(i int, result1 []byte, result2 *pb.ChaincodeDeploymentSpec, result3 error) {
fake.InitFromFSStub = nil
if fake.initFromFSReturnsOnCall == nil {
fake.initFromFSReturnsOnCall = make(map[int]struct {
result1 []byte
result2 *pb.ChaincodeDeploymentSpec
result3 error
})
}
fake.initFromFSReturnsOnCall[i] = struct {
result1 []byte
result2 *pb.ChaincodeDeploymentSpec
result3 error
}{result1, result2, result3}
}
func (fake *CCPackage) PutChaincodeToFS() error {
fake.putChaincodeToFSMutex.Lock()
ret, specificReturn := fake.putChaincodeToFSReturnsOnCall[len(fake.putChaincodeToFSArgsForCall)]
fake.putChaincodeToFSArgsForCall = append(fake.putChaincodeToFSArgsForCall, struct{}{})
fake.recordInvocation("PutChaincodeToFS", []interface{}{})
fake.putChaincodeToFSMutex.Unlock()
if fake.PutChaincodeToFSStub != nil {
return fake.PutChaincodeToFSStub()
}
if specificReturn {
return ret.result1
}
return fake.putChaincodeToFSReturns.result1
}
func (fake *CCPackage) PutChaincodeToFSCallCount() int {
fake.putChaincodeToFSMutex.RLock()
defer fake.putChaincodeToFSMutex.RUnlock()
return len(fake.putChaincodeToFSArgsForCall)
}
func (fake *CCPackage) PutChaincodeToFSReturns(result1 error) {
fake.PutChaincodeToFSStub = nil
fake.putChaincodeToFSReturns = struct {
result1 error
}{result1}
}
func (fake *CCPackage) PutChaincodeToFSReturnsOnCall(i int, result1 error) {
fake.PutChaincodeToFSStub = nil
if fake.putChaincodeToFSReturnsOnCall == nil {
fake.putChaincodeToFSReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.putChaincodeToFSReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *CCPackage) GetDepSpec() *pb.ChaincodeDeploymentSpec {
fake.getDepSpecMutex.Lock()
ret, specificReturn := fake.getDepSpecReturnsOnCall[len(fake.getDepSpecArgsForCall)]
fake.getDepSpecArgsForCall = append(fake.getDepSpecArgsForCall, struct{}{})
fake.recordInvocation("GetDepSpec", []interface{}{})
fake.getDepSpecMutex.Unlock()
if fake.GetDepSpecStub != nil {
return fake.GetDepSpecStub()
}
if specificReturn {
return ret.result1
}
return fake.getDepSpecReturns.result1
}
func (fake *CCPackage) GetDepSpecCallCount() int {
fake.getDepSpecMutex.RLock()
defer fake.getDepSpecMutex.RUnlock()
return len(fake.getDepSpecArgsForCall)
}
func (fake *CCPackage) GetDepSpecReturns(result1 *pb.ChaincodeDeploymentSpec) {
fake.GetDepSpecStub = nil
fake.getDepSpecReturns = struct {
result1 *pb.ChaincodeDeploymentSpec
}{result1}
}
func (fake *CCPackage) GetDepSpecReturnsOnCall(i int, result1 *pb.ChaincodeDeploymentSpec) {
fake.GetDepSpecStub = nil
if fake.getDepSpecReturnsOnCall == nil {
fake.getDepSpecReturnsOnCall = make(map[int]struct {
result1 *pb.ChaincodeDeploymentSpec
})
}
fake.getDepSpecReturnsOnCall[i] = struct {
result1 *pb.ChaincodeDeploymentSpec
}{result1}
}
func (fake *CCPackage) GetDepSpecBytes() []byte {
fake.getDepSpecBytesMutex.Lock()
ret, specificReturn := fake.getDepSpecBytesReturnsOnCall[len(fake.getDepSpecBytesArgsForCall)]
fake.getDepSpecBytesArgsForCall = append(fake.getDepSpecBytesArgsForCall, struct{}{})
fake.recordInvocation("GetDepSpecBytes", []interface{}{})
fake.getDepSpecBytesMutex.Unlock()
if fake.GetDepSpecBytesStub != nil {
return fake.GetDepSpecBytesStub()
}
if specificReturn {
return ret.result1
}
return fake.getDepSpecBytesReturns.result1
}
func (fake *CCPackage) GetDepSpecBytesCallCount() int {
fake.getDepSpecBytesMutex.RLock()
defer fake.getDepSpecBytesMutex.RUnlock()
return len(fake.getDepSpecBytesArgsForCall)
}
func (fake *CCPackage) GetDepSpecBytesReturns(result1 []byte) {
fake.GetDepSpecBytesStub = nil
fake.getDepSpecBytesReturns = struct {
result1 []byte
}{result1}
}
func (fake *CCPackage) GetDepSpecBytesReturnsOnCall(i int, result1 []byte) {
fake.GetDepSpecBytesStub = nil
if fake.getDepSpecBytesReturnsOnCall == nil {
fake.getDepSpecBytesReturnsOnCall = make(map[int]struct {
result1 []byte
})
}
fake.getDepSpecBytesReturnsOnCall[i] = struct {
result1 []byte
}{result1}
}
func (fake *CCPackage) ValidateCC(ccdata *ccprovider.ChaincodeData) error {
fake.validateCCMutex.Lock()
ret, specificReturn := fake.validateCCReturnsOnCall[len(fake.validateCCArgsForCall)]
fake.validateCCArgsForCall = append(fake.validateCCArgsForCall, struct {
ccdata *ccprovider.ChaincodeData
}{ccdata})
fake.recordInvocation("ValidateCC", []interface{}{ccdata})
fake.validateCCMutex.Unlock()
if fake.ValidateCCStub != nil {
return fake.ValidateCCStub(ccdata)
}
if specificReturn {
return ret.result1
}
return fake.validateCCReturns.result1
}
func (fake *CCPackage) ValidateCCCallCount() int {
fake.validateCCMutex.RLock()
defer fake.validateCCMutex.RUnlock()
return len(fake.validateCCArgsForCall)
}
func (fake *CCPackage) ValidateCCArgsForCall(i int) *ccprovider.ChaincodeData {
fake.validateCCMutex.RLock()
defer fake.validateCCMutex.RUnlock()
return fake.validateCCArgsForCall[i].ccdata
}
func (fake *CCPackage) ValidateCCReturns(result1 error) {
fake.ValidateCCStub = nil
fake.validateCCReturns = struct {
result1 error
}{result1}
}
func (fake *CCPackage) ValidateCCReturnsOnCall(i int, result1 error) {
fake.ValidateCCStub = nil
if fake.validateCCReturnsOnCall == nil {
fake.validateCCReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.validateCCReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *CCPackage) GetPackageObject() proto.Message {
fake.getPackageObjectMutex.Lock()
ret, specificReturn := fake.getPackageObjectReturnsOnCall[len(fake.getPackageObjectArgsForCall)]
fake.getPackageObjectArgsForCall = append(fake.getPackageObjectArgsForCall, struct{}{})
fake.recordInvocation("GetPackageObject", []interface{}{})
fake.getPackageObjectMutex.Unlock()
if fake.GetPackageObjectStub != nil {
return fake.GetPackageObjectStub()
}
if specificReturn {
return ret.result1
}
return fake.getPackageObjectReturns.result1
}
func (fake *CCPackage) GetPackageObjectCallCount() int {
fake.getPackageObjectMutex.RLock()
defer fake.getPackageObjectMutex.RUnlock()
return len(fake.getPackageObjectArgsForCall)
}
func (fake *CCPackage) GetPackageObjectReturns(result1 proto.Message) {
fake.GetPackageObjectStub = nil
fake.getPackageObjectReturns = struct {
result1 proto.Message
}{result1}
}
func (fake *CCPackage) GetPackageObjectReturnsOnCall(i int, result1 proto.Message) {
fake.GetPackageObjectStub = nil
if fake.getPackageObjectReturnsOnCall == nil {
fake.getPackageObjectReturnsOnCall = make(map[int]struct {
result1 proto.Message
})
}
fake.getPackageObjectReturnsOnCall[i] = struct {
result1 proto.Message
}{result1}
}
func (fake *CCPackage) GetChaincodeData() *ccprovider.ChaincodeData {
fake.getChaincodeDataMutex.Lock()
ret, specificReturn := fake.getChaincodeDataReturnsOnCall[len(fake.getChaincodeDataArgsForCall)]
fake.getChaincodeDataArgsForCall = append(fake.getChaincodeDataArgsForCall, struct{}{})
fake.recordInvocation("GetChaincodeData", []interface{}{})
fake.getChaincodeDataMutex.Unlock()
if fake.GetChaincodeDataStub != nil {
return fake.GetChaincodeDataStub()
}
if specificReturn {
return ret.result1
}
return fake.getChaincodeDataReturns.result1
}
func (fake *CCPackage) GetChaincodeDataCallCount() int {
fake.getChaincodeDataMutex.RLock()
defer fake.getChaincodeDataMutex.RUnlock()
return len(fake.getChaincodeDataArgsForCall)
}
func (fake *CCPackage) GetChaincodeDataReturns(result1 *ccprovider.ChaincodeData) {
fake.GetChaincodeDataStub = nil
fake.getChaincodeDataReturns = struct {
result1 *ccprovider.ChaincodeData
}{result1}
}
func (fake *CCPackage) GetChaincodeDataReturnsOnCall(i int, result1 *ccprovider.ChaincodeData) {
fake.GetChaincodeDataStub = nil
if fake.getChaincodeDataReturnsOnCall == nil {
fake.getChaincodeDataReturnsOnCall = make(map[int]struct {
result1 *ccprovider.ChaincodeData
})
}
fake.getChaincodeDataReturnsOnCall[i] = struct {
result1 *ccprovider.ChaincodeData
}{result1}
}
func (fake *CCPackage) GetId() []byte {
fake.getIdMutex.Lock()
ret, specificReturn := fake.getIdReturnsOnCall[len(fake.getIdArgsForCall)]
fake.getIdArgsForCall = append(fake.getIdArgsForCall, struct{}{})
fake.recordInvocation("GetId", []interface{}{})
fake.getIdMutex.Unlock()
if fake.GetIdStub != nil {
return fake.GetIdStub()
}
if specificReturn {
return ret.result1
}
return fake.getIdReturns.result1
}
func (fake *CCPackage) GetIdCallCount() int {
fake.getIdMutex.RLock()
defer fake.getIdMutex.RUnlock()
return len(fake.getIdArgsForCall)
}
func (fake *CCPackage) GetIdReturns(result1 []byte) {
fake.GetIdStub = nil
fake.getIdReturns = struct {
result1 []byte
}{result1}
}
func (fake *CCPackage) GetIdReturnsOnCall(i int, result1 []byte) {
fake.GetIdStub = nil
if fake.getIdReturnsOnCall == nil {
fake.getIdReturnsOnCall = make(map[int]struct {
result1 []byte
})
}
fake.getIdReturnsOnCall[i] = struct {
result1 []byte
}{result1}
}
func (fake *CCPackage) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.initFromBufferMutex.RLock()
defer fake.initFromBufferMutex.RUnlock()
fake.initFromFSMutex.RLock()
defer fake.initFromFSMutex.RUnlock()
fake.putChaincodeToFSMutex.RLock()
defer fake.putChaincodeToFSMutex.RUnlock()
fake.getDepSpecMutex.RLock()
defer fake.getDepSpecMutex.RUnlock()
fake.getDepSpecBytesMutex.RLock()
defer fake.getDepSpecBytesMutex.RUnlock()
fake.validateCCMutex.RLock()
defer fake.validateCCMutex.RUnlock()
fake.getPackageObjectMutex.RLock()
defer fake.getPackageObjectMutex.RUnlock()
fake.getChaincodeDataMutex.RLock()
defer fake.getChaincodeDataMutex.RUnlock()
fake.getIdMutex.RLock()
defer fake.getIdMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *CCPackage) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/mirrors/hyperledger-fabric.git
git@gitee.com:mirrors/hyperledger-fabric.git
mirrors
hyperledger-fabric
hyperledger-fabric
v1.2.0-rc1

搜索帮助

0d507c66 1850385 C8b1a773 1850385