@@ -7,7 +7,6 @@ SPDX-License-Identifier: Apache-2.0
77package membership
88
99import (
10- "fmt"
1110 "sync"
1211
1312 "github.com/hyperledger-labs/fabric-smart-client/pkg/utils/errors"
@@ -72,30 +71,30 @@ func (c *Service) DryUpdate(env *cb.Envelope) error {
7271func (c * Service ) validateConfig (env * cb.Envelope ) (* channelconfig.Bundle , error ) {
7372 payload , err := protoutil .UnmarshalPayload (env .Payload )
7473 if err != nil {
75- return nil , errors .Wrapf (err , "cannot get payload from config transaction " )
74+ return nil , errors .Wrapf (err , "unmarshal common payload" )
7675 }
7776
7877 cenv , err := configtx .UnmarshalConfigEnvelope (payload .Data )
7978 if err != nil {
80- return nil , errors .Wrapf (err , "error unmarshalling config which passed initial validity checks " )
79+ return nil , errors .Wrapf (err , "unmarshal config envelope " )
8180 }
8281
8382 // check if config tx is valid
8483 if c .channelResources != nil {
8584 v := c .channelResources .ConfigtxValidator ()
8685 if err := v .Validate (cenv ); err != nil {
87- return nil , errors .Wrap (err , "failed to validate config transaction" )
86+ return nil , errors .Wrap (err , "validate config transaction" )
8887 }
8988 }
9089
9190 bundle , err := channelconfig .NewBundle (c .channelID , cenv .Config , factory .GetDefault ())
9291 if err != nil {
93- return nil , errors .Wrapf (err , "failed to build a new bundle" )
92+ return nil , errors .Wrapf (err , "build a new bundle" )
9493 }
9594
9695 channelconfig .LogSanityChecks (bundle )
9796 if err := capabilitiesSupported (bundle ); err != nil {
98- return nil , err
97+ return nil , errors . Wrapf ( err , "check bundle capabilities" )
9998 }
10099
101100 return bundle , nil
@@ -108,11 +107,11 @@ func capabilitiesSupported(res channelconfig.Resources) error {
108107 }
109108
110109 if err := ac .Capabilities ().Supported (); err != nil {
111- return errors .Wrapf (err , "[Channel %s] incompatible" , res .ConfigtxValidator ().ChannelID ())
110+ return errors .Wrapf (err , "[Channel %s] application config capabilities incompatible" , res .ConfigtxValidator ().ChannelID ())
112111 }
113112
114113 if err := res .ChannelConfig ().Capabilities ().Supported (); err != nil {
115- return errors .Wrapf (err , "[Channel %s] incompatible" , res .ConfigtxValidator ().ChannelID ())
114+ return errors .Wrapf (err , "[Channel %s] channel config capabilities incompatible" , res .ConfigtxValidator ().ChannelID ())
116115 }
117116
118117 return nil
@@ -121,7 +120,7 @@ func capabilitiesSupported(res channelconfig.Resources) error {
121120func (c * Service ) IsValid (identity view.Identity ) error {
122121 id , err := c .resources ().MSPManager ().DeserializeIdentity (identity )
123122 if err != nil {
124- return errors .Wrapf (err , "failed deserializing identity [%s]" , identity .String ())
123+ return errors .Wrapf (err , "deserializing identity [%s]" , identity .String ())
125124 }
126125
127126 return id .Validate ()
@@ -130,7 +129,7 @@ func (c *Service) IsValid(identity view.Identity) error {
130129func (c * Service ) GetVerifier (identity view.Identity ) (driver.Verifier , error ) {
131130 id , err := c .resources ().MSPManager ().DeserializeIdentity (identity )
132131 if err != nil {
133- return nil , errors .Wrapf (err , "failed deserializing identity [%s]" , identity .String ())
132+ return nil , errors .Wrapf (err , "deserializing identity [%s]" , identity .String ())
134133 }
135134 return id , nil
136135}
@@ -154,7 +153,7 @@ func (c *Service) GetMSPIDs() []string {
154153func (c * Service ) OrdererConfig (cs driver.ConfigService ) (string , []* grpc.ConnectionConfig , error ) {
155154 oc , ok := c .resources ().OrdererConfig ()
156155 if ! ok || oc .Organizations () == nil {
157- return "" , nil , fmt . Errorf ("orderer config does not exist" )
156+ return "" , nil , errors . New ("orderer config does not exist" )
158157 }
159158
160159 tlsEnabled , isSet := cs .OrderingTLSEnabled ()
@@ -182,7 +181,7 @@ func (c *Service) OrdererConfig(cs driver.ConfigService) (string, []*grpc.Connec
182181
183182 ep , err := parseEndpoint (epStr )
184183 if err != nil {
185- return "" , nil , fmt . Errorf ( "cannot parse orderer endpoint [%s]: %w " , epStr , err )
184+ return "" , nil , errors . Wrapf ( err , " parse orderer endpoint [%s]" , epStr )
186185 }
187186 logger .Debugf ("new OS endpoint: %s" , epStr )
188187
0 commit comments