Skip to content

Commit

Permalink
[FAB-17619] Fix exported ConfigTx functions to retrieve/set correct f…
Browse files Browse the repository at this point in the history
…ield

Signed-off-by: Tiffany Harris <tiffany.harris@ibm.com>
  • Loading branch information
stephyee authored and sykesm committed Mar 26, 2020
1 parent 79fb075 commit 4d515e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/config/msp.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (c *ConfigTx) GetMSPConfigurationForOrdererOrg(orgName string) (MSP, error)
// GetMSPConfigurationForConsortiumOrg returns the MSP configuration for an existing consortium
// org in a config transaction.
func (c *ConfigTx) GetMSPConfigurationForConsortiumOrg(consortiumName, orgName string) (MSP, error) {
consortiumGroup, ok := c.updated.ChannelGroup.Groups[ConsortiumsGroupKey].Groups[consortiumName]
consortiumGroup, ok := c.base.ChannelGroup.Groups[ConsortiumsGroupKey].Groups[consortiumName]
if !ok {
return MSP{}, fmt.Errorf("consortium %s does not exist in config", consortiumName)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/config/policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (c *ConfigTx) GetPoliciesForApplicationOrg(orgName string) (map[string]Poli
// AddApplicationPolicy modifies an existing application policy configuration.
// When the policy exists it will overwrite the existing policy.
func (c *ConfigTx) AddApplicationPolicy(modPolicy, policyName string, policy Policy) error {
err := addPolicy(c.base.ChannelGroup.Groups[ApplicationGroupKey], modPolicy, policyName, policy)
err := addPolicy(c.updated.ChannelGroup.Groups[ApplicationGroupKey], modPolicy, policyName, policy)
if err != nil {
return fmt.Errorf("failed to add policy '%s': %v", policyName, err)
}
Expand Down Expand Up @@ -138,7 +138,7 @@ func (c *ConfigTx) RemoveApplicationOrgPolicy(orgName, policyName string) error
func (c *ConfigTx) AddConsortiumOrgPolicy(consortiumName, orgName, policyName string, policy Policy) error {
groupKey := ConsortiumsGroupKey

consortiumGroup, ok := c.base.ChannelGroup.Groups[groupKey].Groups[consortiumName]
consortiumGroup, ok := c.updated.ChannelGroup.Groups[groupKey].Groups[consortiumName]
if !ok {
return fmt.Errorf("consortium '%s' does not exist in channel config", consortiumName)
}
Expand All @@ -161,7 +161,7 @@ func (c *ConfigTx) AddConsortiumOrgPolicy(consortiumName, orgName, policyName st
func (c *ConfigTx) RemoveConsortiumOrgPolicy(consortiumName, orgName, policyName string) error {
groupKey := ConsortiumsGroupKey

consortiumGroup, ok := c.base.ChannelGroup.Groups[groupKey].Groups[consortiumName]
consortiumGroup, ok := c.updated.ChannelGroup.Groups[groupKey].Groups[consortiumName]
if !ok {
return fmt.Errorf("consortium '%s' does not exist in channel config", consortiumName)
}
Expand Down

0 comments on commit 4d515e0

Please sign in to comment.