Commit 2178e6eb authored by Alessandro Sorniotti's avatar Alessandro Sorniotti Committed by Yacov Manevich
Browse files

[FAB-11550] Expose 1.3 validation capability



The capability for 1.3-style validation needs to be exposed through the 
application capability interface. This capability implies state-based 
endorsement and new chaincode lifecycle.

Change-Id: Idc8fc32e98fb295e26f18fd665e198421c5fdf02
Signed-off-by: default avatarAlessandro Sorniotti <ale.linux@sopit.net>
Signed-off-by: default avatarMatthias Neugschwandtner <eug@zurich.ibm.com>
parent 3d56023d
......@@ -146,6 +146,12 @@ type ApplicationCapabilities interface {
// of transactions (as introduced in v1.2).
V1_2Validation() bool
// V1_3Validation returns true if this channel supports transaction validation
// as introduced in v1.3. This includes:
// - policies expressible at a ledger key granularity, as described in FAB-8812
// - new chaincode lifecycle, as described in FAB-11237
V1_3Validation() bool
// MetadataLifecycle indicates whether the peer should use the deprecated and problematic
// v1.0/v1.1 lifecycle, or whether it should use the newer per channel peer local chaincode
// metadata package approach planned for release with Fabric v1.2
......
......@@ -45,6 +45,7 @@ type MockApplicationCapabilities struct {
V1_2ValidationRv bool
MetadataLifecycleRv bool
KeyLevelEndorsementRv bool
V1_3ValidationRv bool
}
func (mac *MockApplicationCapabilities) Supported() error {
......@@ -82,3 +83,7 @@ func (mac *MockApplicationCapabilities) MetadataLifecycle() bool {
func (mac *MockApplicationCapabilities) KeyLevelEndorsement() bool {
return mac.KeyLevelEndorsementRv
}
func (mac *MockApplicationCapabilities) V1_3Validation() bool {
return mac.V1_3ValidationRv
}
......@@ -133,3 +133,17 @@ func (_m *Capabilities) V1_2Validation() bool {
return r0
}
// V1_3Validation provides a mock function with given fields:
func (_m *Capabilities) V1_3Validation() bool {
ret := _m.Called()
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
......@@ -628,3 +628,7 @@ func (ds *dynamicCapabilities) V1_1Validation() bool {
func (ds *dynamicCapabilities) V1_2Validation() bool {
return ds.support.Capabilities().V1_2Validation()
}
func (ds *dynamicCapabilities) V1_3Validation() bool {
return ds.support.Capabilities().V1_3Validation()
}
......@@ -37,6 +37,12 @@ type Capabilities interface {
// of transactions (as introduced in v1.2).
V1_2Validation() bool
// V1_3Validation returns true if this channel supports transaction validation
// as introduced in v1.3. This includes:
// - policies expressible at a ledger key granularity, as described in FAB-8812
// - new chaincode lifecycle, as described in FAB-11237
V1_3Validation() bool
// MetadataLifecycle indicates whether the peer should use the deprecated and problematic
// v1.0/v1.1 lifecycle, or whether it should use the newer per channel peer local chaincode
// metadata package approach planned for release with Fabric v1.2
......
......@@ -133,3 +133,17 @@ func (_m *Capabilities) V1_2Validation() bool {
return r0
}
// V1_3Validation provides a mock function with given fields:
func (_m *Capabilities) V1_3Validation() bool {
ret := _m.Called()
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment