Skip to content

Commit a3e455f

Browse files
committed
[FAB-9851] Enable PvtChanData by default in v1.2
In v1.1, the private data feature within a channel is an experimental feature. Hence, one needs to set privateChannelData capability in config tx to enable it. In v1.2, private data feature is enabled by default, i.e., non-experimental. As a result, privateChannelData() capability API in v1.2 should return (privateChannelData || v1.2) to support rolling upgrades. In v1.3, we can remove the privateChannelData capability flag. Change-Id: I9f1adbe87b8bab1d98b89602cca410fba18aba86 Signed-off-by: senthil <cendhu@gmail.com>
1 parent 0a34859 commit a3e455f

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

common/capabilities/application.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ func (ap *ApplicationProvider) ForbidDuplicateTXIdInBlock() bool {
7171
}
7272

7373
// PrivateChannelData returns true if support for private channel data (a.k.a. collections) is enabled.
74+
// In v1.1, the private channel data is experimental and has to be enabled explicitly.
75+
// In v1.2, the private channel data is enabled by default.
7476
func (ap *ApplicationProvider) PrivateChannelData() bool {
75-
return ap.v11PvtDataExperimental
77+
return ap.v11PvtDataExperimental || ap.v12
7678
}
7779

7880
// V1_1Validation returns true is this channel is configured to perform stricter validation

common/capabilities/application_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ func TestApplicationPvtDataExperimental(t *testing.T) {
4444
ApplicationPvtDataExperimental: {},
4545
})
4646
assert.True(t, op.PrivateChannelData())
47+
48+
op = NewApplicationProvider(map[string]*cb.Capability{
49+
ApplicationV1_2: {},
50+
})
51+
assert.True(t, op.PrivateChannelData())
52+
4753
}
4854

4955
func TestChaincodeLifecycleExperimental(t *testing.T) {

common/channelconfig/api.go

+2
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ type ApplicationCapabilities interface {
127127
ResourcesTree() bool
128128

129129
// PrivateChannelData returns true if support for private channel data (a.k.a. collections) is enabled.
130+
// In v1.1, the private channel data is experimental and has to be enabled explicitly.
131+
// In v1.2, the private channel data is enabled by default.
130132
PrivateChannelData() bool
131133

132134
// V1_1Validation returns true is this channel is configured to perform stricter validation

0 commit comments

Comments
 (0)