File tree Expand file tree Collapse file tree 6 files changed +26
-8
lines changed Expand file tree Collapse file tree 6 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -16,19 +16,24 @@ const (
16
16
17
17
// ChannelV1_1 is the capabilties string for standard new non-backwards compatible fabric v1.1 channel capabilities.
18
18
ChannelV1_1 = "V1_1"
19
+
20
+ // ChannelV1_3 is the capabilties string for standard new non-backwards compatible fabric v1.3 channel capabilities.
21
+ ChannelV1_3 = "V1_3"
19
22
)
20
23
21
24
// ChannelProvider provides capabilities information for channel level config.
22
25
type ChannelProvider struct {
23
26
* registry
24
27
v11 bool
28
+ v13 bool
25
29
}
26
30
27
31
// NewChannelProvider creates a channel capabilities provider.
28
32
func NewChannelProvider (capabilities map [string ]* cb.Capability ) * ChannelProvider {
29
33
cp := & ChannelProvider {}
30
34
cp .registry = newRegistry (cp , capabilities )
31
35
_ , cp .v11 = capabilities [ChannelV1_1 ]
36
+ _ , cp .v13 = capabilities [ChannelV1_3 ]
32
37
return cp
33
38
}
34
39
@@ -41,6 +46,8 @@ func (cp *ChannelProvider) Type() string {
41
46
func (cp * ChannelProvider ) HasCapability (capability string ) bool {
42
47
switch capability {
43
48
// Add new capability names here
49
+ case ChannelV1_3 :
50
+ return true
44
51
case ChannelV1_1 :
45
52
return true
46
53
default :
@@ -51,6 +58,8 @@ func (cp *ChannelProvider) HasCapability(capability string) bool {
51
58
// MSPVersion returns the level of MSP support required by this channel.
52
59
func (cp * ChannelProvider ) MSPVersion () msp.MSPVersion {
53
60
switch {
61
+ case cp .v13 :
62
+ return msp .MSPv1_3
54
63
case cp .v11 :
55
64
return msp .MSPv1_1
56
65
default :
Original file line number Diff line number Diff line change @@ -28,3 +28,12 @@ func TestChannelV11(t *testing.T) {
28
28
assert .NoError (t , op .Supported ())
29
29
assert .True (t , op .MSPVersion () == msp .MSPv1_1 )
30
30
}
31
+
32
+ func TestChannelV13 (t * testing.T ) {
33
+ op := NewChannelProvider (map [string ]* cb.Capability {
34
+ ChannelV1_1 : {},
35
+ ChannelV1_3 : {},
36
+ })
37
+ assert .NoError (t , op .Supported ())
38
+ assert .True (t , op .MSPVersion () == msp .MSPv1_3 )
39
+ }
Original file line number Diff line number Diff line change @@ -159,11 +159,11 @@ Capabilities:
159
159
# Channel capabilities apply to both the orderers and the peers and must be
160
160
# supported by both. Set the value of the capability to true to require it.
161
161
Global : &ChannelCapabilities
162
- # V1.1 for Global is a catchall flag for behavior which has been
163
- # determined to be desired for all orderers and peers running v1.0.x ,
162
+ # V1.3 for Channel is a catchall flag for behavior which has been
163
+ # determined to be desired for all orderers and peers running < v1.3.0 ,
164
164
# but the modification of which would cause incompatibilities. Users
165
165
# should leave this flag set to true.
166
- V1_1 : true
166
+ V1_3 : true
167
167
168
168
# Orderer capabilities apply only to the orderers, and may be safely
169
169
# manipulated without concern for upgrading peers. Set the value of the
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ Organizations:{{ range .PeerOrgs }}
47
47
48
48
Channel: &ChannelDefaults
49
49
Capabilities:
50
- V1_1 : true
50
+ V1_3 : true
51
51
Policies:
52
52
Readers:
53
53
Type: ImplicitMeta
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ Organizations:
24
24
25
25
Capabilities :
26
26
Global : &ChannelCapabilities
27
- V1_1 : true
27
+ V1_3 : true
28
28
Orderer : &OrdererCapabilities
29
29
V1_1 : true
30
30
Application : &ApplicationCapabilities
Original file line number Diff line number Diff line change @@ -79,11 +79,11 @@ Capabilities:
79
79
# Channel capabilities apply to both the orderers and the peers and must be
80
80
# supported by both. Set the value of the capability to true to require it.
81
81
Channel : &ChannelCapabilities
82
- # V1.1 for Channel is a catchall flag for behavior which has been
83
- # determined to be desired for all orderers and peers running v1.0.x ,
82
+ # V1.3 for Channel is a catchall flag for behavior which has been
83
+ # determined to be desired for all orderers and peers running < v1.3.0 ,
84
84
# but the modification of which would cause incompatibilities. Users
85
85
# should leave this flag set to true.
86
- V1_1 : true
86
+ V1_3 : true
87
87
88
88
# Orderer capabilities apply only to the orderers, and may be safely
89
89
# manipulated without concern for upgrading peers. Set the value of the
You can’t perform that action at this time.
0 commit comments