Skip to content

Commit 1d59d3c

Browse files
committed
[FAB-14718] Remove unnecessary function from interface
Change-Id: I2126c18b6f138eeaad8194866d436cb648dbc873 Signed-off-by: Alessandro Sorniotti <ale.linux@sopit.net>
1 parent ef4a80d commit 1d59d3c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

core/policy/application.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,14 @@ type ApplicationPolicyEvaluator struct {
4040
channelPolicyReferenceProvider ChannelPolicyReferenceProvider
4141
}
4242

43+
// Manager defines functions to interface with the policy manager of a channel
44+
type Manager interface {
45+
// GetPolicy returns a policy and true if it was the policy requested, or false if it is the default policy
46+
GetPolicy(id string) (policies.Policy, bool)
47+
}
48+
4349
type ChannelPolicyReferenceProviderImpl struct {
44-
policies.Manager
50+
Manager
4551
}
4652

4753
func (c *ChannelPolicyReferenceProviderImpl) NewPolicy(channelConfigPolicyReference string) (policies.Policy, error) {
@@ -73,11 +79,6 @@ func (d *dynamicPolicyManager) GetPolicy(id string) (policies.Policy, bool) {
7379
return mgr.GetPolicy(id)
7480
}
7581

76-
func (d *dynamicPolicyManager) Manager(path []string) (policies.Manager, bool) {
77-
// we don't use this function
78-
panic("programming error")
79-
}
80-
8182
// New returns an evaluator for application policies
8283
func New(deserializer msp.IdentityDeserializer, channel string, channelPolicyManagerGetter policies.ChannelPolicyManagerGetter) (*ApplicationPolicyEvaluator, error) {
8384
_, ok := channelPolicyManagerGetter.Manager(channel)

0 commit comments

Comments
 (0)