File tree 4 files changed +22
-0
lines changed
4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,12 @@ func (ap *ApplicationProvider) PrivateChannelData() bool {
75
75
return ap .v11PvtDataExperimental
76
76
}
77
77
78
+ // CollectionUpgrade returns true if this channel is configured to allow updates to
79
+ // existing collection or add new collections through chaincode upgrade (as introduced in v1.2)
80
+ func (ap ApplicationProvider ) CollectionUpgrade () bool {
81
+ return ap .v12
82
+ }
83
+
78
84
// V1_1Validation returns true is this channel is configured to perform stricter validation
79
85
// of transactions (as introduced in v1.1).
80
86
func (ap * ApplicationProvider ) V1_1Validation () bool {
Original file line number Diff line number Diff line change @@ -46,6 +46,13 @@ func TestApplicationPvtDataExperimental(t *testing.T) {
46
46
assert .True (t , op .PrivateChannelData ())
47
47
}
48
48
49
+ func TestApplicationCollectionUpgrade (t * testing.T ) {
50
+ op := NewApplicationProvider (map [string ]* cb.Capability {
51
+ ApplicationV1_2 : {},
52
+ })
53
+ assert .True (t , op .CollectionUpgrade ())
54
+ }
55
+
49
56
func TestChaincodeLifecycleExperimental (t * testing.T ) {
50
57
op := NewApplicationProvider (map [string ]* cb.Capability {
51
58
ApplicationChaincodeLifecycleExperimental : {},
Original file line number Diff line number Diff line change @@ -129,6 +129,10 @@ type ApplicationCapabilities interface {
129
129
// PrivateChannelData returns true if support for private channel data (a.k.a. collections) is enabled.
130
130
PrivateChannelData () bool
131
131
132
+ // CollectionUpgrade returns true if this channel is configured to allow updates to
133
+ // existing collection or add new collections through chaincode upgrade (as introduced in v1.2)
134
+ CollectionUpgrade () bool
135
+
132
136
// V1_1Validation returns true is this channel is configured to perform stricter validation
133
137
// of transactions (as introduced in v1.1).
134
138
V1_1Validation () bool
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ type MockApplicationCapabilities struct {
40
40
ForbidDuplicateTXIdInBlockRv bool
41
41
ResourcesTreeRv bool
42
42
PrivateChannelDataRv bool
43
+ CollectionUpgradeRv bool
43
44
V1_1ValidationRv bool
44
45
V1_2ValidationRv bool
45
46
MetadataLifecycleRv bool
@@ -62,6 +63,10 @@ func (mac *MockApplicationCapabilities) PrivateChannelData() bool {
62
63
return mac .PrivateChannelDataRv
63
64
}
64
65
66
+ func (mac * MockApplicationCapabilities ) CollectionUpgrade () bool {
67
+ return mac .CollectionUpgradeRv
68
+ }
69
+
65
70
func (mac * MockApplicationCapabilities ) V1_1Validation () bool {
66
71
return mac .V1_1ValidationRv
67
72
}
You can’t perform that action at this time.
0 commit comments