From c2b5f2d76d6a8c2e97caeaf57241e48f6b66caf0 Mon Sep 17 00:00:00 2001 From: YACOVM Date: Wed, 7 Jun 2017 01:48:49 +0300 Subject: [PATCH] [FAB-4437] Fix ccpackage_test (compilation error) Master branch currently fails in CI due to SignaturePolicyEnvelope.Policy that was changed to SignaturePolicyEnvelope.Rule Change-Id: I04f7d26cce0243ffbf0fdd0a91d8337aada39f8f Signed-off-by: Yacov Manevich --- core/common/ccpackage/ccpackage_test.go | 2 +- protos/common/policies_test.go | 28 ++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/core/common/ccpackage/ccpackage_test.go b/core/common/ccpackage/ccpackage_test.go index f3211224131..b59cbe2091e 100644 --- a/core/common/ccpackage/ccpackage_test.go +++ b/core/common/ccpackage/ccpackage_test.go @@ -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, } diff --git a/protos/common/policies_test.go b/protos/common/policies_test.go index 1cc455b7e29..17d3923ba55 100644 --- a/protos/common/policies_test.go +++ b/protos/common/policies_test.go @@ -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() @@ -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() @@ -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()