Skip to content

Commit

Permalink
[FAB-4437] Fix ccpackage_test (compilation error)
Browse files Browse the repository at this point in the history
Master branch currently fails in CI due to SignaturePolicyEnvelope.Policy
that was changed to SignaturePolicyEnvelope.Rule

Change-Id: I04f7d26cce0243ffbf0fdd0a91d8337aada39f8f
Signed-off-by: Yacov Manevich <yacovm@il.ibm.com>
  • Loading branch information
yacovm committed Jun 6, 2017
1 parent d43269c commit c2b5f2d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion core/common/ccpackage/ccpackage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func createInstantiationPolicy(mspid string, role mspprotos.MSPRole_MSPRoleType)
// create the policy: it requires exactly 1 signature from any of the principals
p := &common.SignaturePolicyEnvelope{
Version: 0,
Policy: cauthdsl.NOutOf(1, sigspolicy),
Rule: cauthdsl.NOutOf(1, sigspolicy),
Identities: principals,
}

Expand Down
28 changes: 14 additions & 14 deletions protos/common/policies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ func TestPoliciesEnums(t *testing.T) {
func TestPoliciesStructs(t *testing.T) {
var policy *Policy
assert.Equal(t, int32(0), policy.GetType())
assert.Nil(t, policy.GetPolicy())
assert.Nil(t, policy.GetValue())
policy = &Policy{
Policy: []byte("policy"),
Type: int32(1),
Value: []byte("policy"),
Type: int32(1),
}
assert.Equal(t, int32(1), policy.GetType())
assert.NotNil(t, policy.GetPolicy())
assert.NotNil(t, policy.GetValue())
policy.Reset()
assert.Nil(t, policy.GetPolicy())
assert.Nil(t, policy.GetValue())
_, _ = policy.Descriptor()
_ = policy.String()
policy.ProtoMessage()
Expand All @@ -58,18 +58,18 @@ func TestPoliciesStructs(t *testing.T) {
env = nil
assert.Equal(t, int32(0), env.GetVersion())
assert.Nil(t, env.GetIdentities())
assert.Nil(t, env.GetPolicy())
assert.Nil(t, env.GetRule())
env = &SignaturePolicyEnvelope{
Policy: &SignaturePolicy{},
Rule: &SignaturePolicy{},
Identities: []*common1.MSPPrincipal{&common1.MSPPrincipal{}},
Version: int32(1),
}
assert.Equal(t, int32(1), env.GetVersion())
assert.NotNil(t, env.GetIdentities())
assert.NotNil(t, env.GetPolicy())
assert.NotNil(t, env.GetRule())
env.Reset()
assert.Nil(t, env.GetIdentities())
assert.Nil(t, env.GetPolicy())
assert.Nil(t, env.GetRule())
_, _ = env.Descriptor()
_ = env.String()
env.ProtoMessage()
Expand Down Expand Up @@ -108,15 +108,15 @@ func TestPoliciesStructs(t *testing.T) {
var n *SignaturePolicy_NOutOf
n = nil
assert.Equal(t, int32(0), n.GetN())
assert.Nil(t, n.GetPolicies())
assert.Nil(t, n.GetRules())
n = &SignaturePolicy_NOutOf{
Policies: []*SignaturePolicy{&SignaturePolicy{}},
N: int32(1),
Rules: []*SignaturePolicy{&SignaturePolicy{}},
N: int32(1),
}
assert.Equal(t, int32(1), n.GetN())
assert.NotNil(t, n.GetPolicies())
assert.NotNil(t, n.GetRules())
n.Reset()
assert.Nil(t, n.GetPolicies())
assert.Nil(t, n.GetRules())
_, _ = n.Descriptor()
_ = n.String()
n.ProtoMessage()
Expand Down

0 comments on commit c2b5f2d

Please sign in to comment.