diff --git a/common/capabilities/application.go b/common/capabilities/application.go index 1e9135e2e27..9c31da3130a 100644 --- a/common/capabilities/application.go +++ b/common/capabilities/application.go @@ -57,3 +57,9 @@ func (ap *ApplicationProvider) ForbidDuplicateTXIdInBlock() bool { func (ap *ApplicationProvider) PrivateChannelData() bool { return ap.v11PvtDataExperimental } + +// V1_1Validation returns true is this channel is configured to perform stricter validation +// of transactions (as introduced in v1.1). +func (ap *ApplicationProvider) V1_1Validation() bool { + return ap.v11 +} diff --git a/common/capabilities/application_test.go b/common/capabilities/application_test.go index 89dbcf78533..850951bfaf5 100644 --- a/common/capabilities/application_test.go +++ b/common/capabilities/application_test.go @@ -26,6 +26,8 @@ func TestApplicationV11(t *testing.T) { }) assert.NoError(t, op.Supported()) assert.True(t, op.LifecycleViaConfig()) + assert.True(t, op.ForbidDuplicateTXIdInBlock()) + assert.True(t, op.V1_1Validation()) } func TestApplicationPvtDataExperimental(t *testing.T) { diff --git a/common/channelconfig/api.go b/common/channelconfig/api.go index c9709530d22..bb42bef8c12 100644 --- a/common/channelconfig/api.go +++ b/common/channelconfig/api.go @@ -126,6 +126,10 @@ type ApplicationCapabilities interface { // PrivateChannelData returns true if support for private channel data (a.k.a. collections) is enabled. PrivateChannelData() bool + + // V1_1Validation returns true is this channel is configured to perform stricter validation + // of transactions (as introduced in v1.1). + V1_1Validation() bool } // OrdererCapabilities defines the capabilities for the orderer portion of a channel diff --git a/common/mocks/config/application.go b/common/mocks/config/application.go index f5fc7e2d1e0..b2c77451d61 100644 --- a/common/mocks/config/application.go +++ b/common/mocks/config/application.go @@ -25,6 +25,7 @@ type MockApplicationCapabilities struct { ForbidDuplicateTXIdInBlockRv bool LifecycleViaConfigRv bool PrivateChannelDataRv bool + V1_1ValidationRv bool } func (mac *MockApplicationCapabilities) Supported() error { @@ -42,3 +43,7 @@ func (mac *MockApplicationCapabilities) LifecycleViaConfig() bool { func (mac *MockApplicationCapabilities) PrivateChannelData() bool { return mac.PrivateChannelDataRv } + +func (mac *MockApplicationCapabilities) V1_1Validation() bool { + return mac.V1_1ValidationRv +}