-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-6088] Add v1.1 application capabilities flag
This CR adds parsing of the V1.1 capabilities flag to the application capabilities group. It additionally fixes the orderer capabilities group to be in line with the same pattern followed by the channel and applications group as well as adds some additional unit tests for the orderer capabilities. Change-Id: Ic39d2fbbece96b74de7bfffec7df2729ab51453d Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
- Loading branch information
Jason Yellick
committed
Oct 12, 2017
1 parent
376c2ca
commit 978c48c
Showing
5 changed files
with
83 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
Copyright IBM Corp. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package capabilities | ||
|
||
import ( | ||
"testing" | ||
|
||
cb "github.com/hyperledger/fabric/protos/common" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestApplicationV10(t *testing.T) { | ||
op := NewApplicationProvider(map[string]*cb.Capability{}) | ||
assert.NoError(t, op.Supported()) | ||
assert.False(t, op.LifecycleViaConfig()) | ||
} | ||
|
||
func TestApplicationV11(t *testing.T) { | ||
op := NewApplicationProvider(map[string]*cb.Capability{ | ||
ApplicationV1_1: &cb.Capability{}, | ||
}) | ||
assert.NoError(t, op.Supported()) | ||
assert.True(t, op.LifecycleViaConfig()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
Copyright IBM Corp. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package capabilities | ||
|
||
import ( | ||
"testing" | ||
|
||
cb "github.com/hyperledger/fabric/protos/common" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestOrdererV10(t *testing.T) { | ||
op := NewOrdererProvider(map[string]*cb.Capability{}) | ||
assert.NoError(t, op.Supported()) | ||
assert.False(t, op.SetChannelModPolicyDuringCreate()) | ||
} | ||
|
||
func TestOrdererV11(t *testing.T) { | ||
op := NewOrdererProvider(map[string]*cb.Capability{ | ||
OrdererV1_1: &cb.Capability{}, | ||
}) | ||
assert.NoError(t, op.Supported()) | ||
assert.True(t, op.SetChannelModPolicyDuringCreate()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters