-
Notifications
You must be signed in to change notification settings - Fork 0
/
support.go
36 lines (28 loc) · 949 Bytes
/
support.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package peer
import (
"github.com/hyperledger/fabric/common/channelconfig"
"github.com/hyperledger/fabric/core/common/ccprovider"
"github.com/hyperledger/fabric/core/peer"
)
type MockSupportImpl struct {
GetApplicationConfigRv channelconfig.Application
GetApplicationConfigBoolRv bool
ChaincodeByNameRv *ccprovider.ChaincodeData
ChaincodeByNameBoolRv bool
}
func (s *MockSupportImpl) GetApplicationConfig(cid string) (channelconfig.Application, bool) {
return s.GetApplicationConfigRv, s.GetApplicationConfigBoolRv
}
func (s *MockSupportImpl) ChaincodeByName(chainname, ccname string) (*ccprovider.ChaincodeData, bool) {
return s.ChaincodeByNameRv, s.ChaincodeByNameBoolRv
}
type MockSupportFactoryImpl struct {
NewSupportRv *MockSupportImpl
}
func (c *MockSupportFactoryImpl) NewSupport() peer.Support {
return c.NewSupportRv
}