forked from ameliaholcomb/fastfabric1.4-oqs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resources.go
79 lines (60 loc) · 2.23 KB
/
resources.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
Copyright IBM Corp. 2016 All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package config
import (
"github.com/hyperledger/fabric/common/channelconfig"
"github.com/hyperledger/fabric/common/configtx"
"github.com/hyperledger/fabric/common/policies"
"github.com/hyperledger/fabric/msp"
)
type Resources struct {
// ConfigtxValidatorVal is returned as the result of ConfigtxValidator
ConfigtxValidatorVal configtx.Validator
// PolicyManagerVal is returned as the result of PolicyManager()
PolicyManagerVal policies.Manager
// ChannelConfigVal is returned as the result of ChannelConfig()
ChannelConfigVal channelconfig.Channel
// OrdererConfigVal is returned as the result of OrdererConfig()
OrdererConfigVal channelconfig.Orderer
// ApplicationConfigVal is returned as the result of ApplicationConfig()
ApplicationConfigVal channelconfig.Application
// ConsortiumsConfigVal is returned as the result of ConsortiumsConfig()
ConsortiumsConfigVal channelconfig.Consortiums
// MSPManagerVal is returned as the result of MSPManager()
MSPManagerVal msp.MSPManager
// ValidateNewErr is returned as the result of ValidateNew
ValidateNewErr error
}
// ConfigtxMangaer returns ConfigtxValidatorVal
func (r *Resources) ConfigtxValidator() configtx.Validator {
return r.ConfigtxValidatorVal
}
// Returns the PolicyManagerVal
func (r *Resources) PolicyManager() policies.Manager {
return r.PolicyManagerVal
}
// Returns the ChannelConfigVal
func (r *Resources) ChannelConfig() channelconfig.Channel {
return r.ChannelConfigVal
}
// Returns the OrdererConfigVal
func (r *Resources) OrdererConfig() (channelconfig.Orderer, bool) {
return r.OrdererConfigVal, r.OrdererConfigVal != nil
}
// Returns the ApplicationConfigVal
func (r *Resources) ApplicationConfig() (channelconfig.Application, bool) {
return r.ApplicationConfigVal, r.ApplicationConfigVal != nil
}
func (r *Resources) ConsortiumsConfig() (channelconfig.Consortiums, bool) {
return r.ConsortiumsConfigVal, r.ConsortiumsConfigVal != nil
}
// Returns the MSPManagerVal
func (r *Resources) MSPManager() msp.MSPManager {
return r.MSPManagerVal
}
// ValidateNew returns ValidateNewErr
func (r *Resources) ValidateNew(res channelconfig.Resources) error {
return r.ValidateNewErr
}