Skip to content

Commit b3f03b1

Browse files
author
Jason Yellick
committed
[FAB-1776] Policy manager instantiation to common
https://jira.hyperledger.org/browse/FAB-1776 The policy manager is currently only initialized within the orderer, but this is a common function and needs to be moved into the common components. Change-Id: I7bed73fdccbc3258418f226eb1ff11e3e29147f9 Signed-off-by: Jason Yellick <[email protected]>
1 parent 0372dae commit b3f03b1

File tree

7 files changed

+180
-83
lines changed

7 files changed

+180
-83
lines changed

common/configtx/filter_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,23 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package configtx
17+
package configtx_test
1818

1919
import (
2020
"fmt"
2121
"reflect"
2222
"testing"
2323

24+
. "github.com/hyperledger/fabric/common/configtx"
2425
"github.com/hyperledger/fabric/orderer/common/filter"
26+
mockconfigtx "github.com/hyperledger/fabric/orderer/mocks/configtx"
2527
cb "github.com/hyperledger/fabric/protos/common"
2628

2729
"github.com/golang/protobuf/proto"
2830
)
2931

3032
type mockConfigManager struct {
33+
mockconfigtx.Manager
3134
applied *cb.ConfigurationEnvelope
3235
err error
3336
}

common/configtx/manager.go

+14-14
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ type Handler interface {
4747

4848
// Manager provides a mechanism to query and update configuration
4949
type Manager interface {
50+
Resources
51+
5052
// Apply attempts to apply a configtx to become the new configuration
5153
Apply(configtx *cb.ConfigurationEnvelope) error
5254

@@ -70,11 +72,10 @@ func (ap *acceptAllPolicy) Evaluate(signedData []*cb.SignedData) error {
7072
}
7173

7274
type configurationManager struct {
75+
Initializer
7376
sequence uint64
7477
chainID string
75-
pm policies.Manager
7678
configuration map[cb.ConfigurationItem_ConfigurationType]map[string]*cb.ConfigurationItem
77-
handlers map[cb.ConfigurationItem_ConfigurationType]Handler
7879
}
7980

8081
// computeChainIDAndSequence returns the chain id and the sequence number for a configuration envelope
@@ -118,10 +119,10 @@ func computeChainIDAndSequence(configtx *cb.ConfigurationEnvelope) (string, uint
118119
return chainID, m, nil
119120
}
120121

121-
// NewConfigurationManager creates a new Manager unless an error is encountered
122-
func NewConfigurationManager(configtx *cb.ConfigurationEnvelope, pm policies.Manager, handlers map[cb.ConfigurationItem_ConfigurationType]Handler) (Manager, error) {
122+
// NewManagerImpl creates a new Manager unless an error is encountered
123+
func NewManagerImpl(configtx *cb.ConfigurationEnvelope, initializer Initializer) (Manager, error) {
123124
for ctype := range cb.ConfigurationItem_ConfigurationType_name {
124-
if _, ok := handlers[cb.ConfigurationItem_ConfigurationType(ctype)]; !ok {
125+
if _, ok := initializer.Handlers()[cb.ConfigurationItem_ConfigurationType(ctype)]; !ok {
125126
return nil, errors.New("Must supply a handler for all known types")
126127
}
127128
}
@@ -132,10 +133,9 @@ func NewConfigurationManager(configtx *cb.ConfigurationEnvelope, pm policies.Man
132133
}
133134

134135
cm := &configurationManager{
136+
Initializer: initializer,
135137
sequence: seq - 1,
136138
chainID: chainID,
137-
pm: pm,
138-
handlers: handlers,
139139
configuration: makeConfigMap(),
140140
}
141141

@@ -159,21 +159,21 @@ func makeConfigMap() map[cb.ConfigurationItem_ConfigurationType]map[string]*cb.C
159159
func (cm *configurationManager) beginHandlers() {
160160
logger.Debugf("Beginning new configuration for chain %s", cm.chainID)
161161
for ctype := range cb.ConfigurationItem_ConfigurationType_name {
162-
cm.handlers[cb.ConfigurationItem_ConfigurationType(ctype)].BeginConfig()
162+
cm.Initializer.Handlers()[cb.ConfigurationItem_ConfigurationType(ctype)].BeginConfig()
163163
}
164164
}
165165

166166
func (cm *configurationManager) rollbackHandlers() {
167167
logger.Debugf("Rolling back configuration for chain %s", cm.chainID)
168168
for ctype := range cb.ConfigurationItem_ConfigurationType_name {
169-
cm.handlers[cb.ConfigurationItem_ConfigurationType(ctype)].RollbackConfig()
169+
cm.Initializer.Handlers()[cb.ConfigurationItem_ConfigurationType(ctype)].RollbackConfig()
170170
}
171171
}
172172

173173
func (cm *configurationManager) commitHandlers() {
174174
logger.Debugf("Committing configuration for chain %s", cm.chainID)
175175
for ctype := range cb.ConfigurationItem_ConfigurationType_name {
176-
cm.handlers[cb.ConfigurationItem_ConfigurationType(ctype)].CommitConfig()
176+
cm.Initializer.Handlers()[cb.ConfigurationItem_ConfigurationType(ctype)].CommitConfig()
177177
}
178178
}
179179

@@ -193,7 +193,7 @@ func (cm *configurationManager) processConfig(configtx *cb.ConfigurationEnvelope
193193
return nil, fmt.Errorf("Config is for the wrong chain, expected %s, got %s", cm.chainID, chainID)
194194
}
195195

196-
defaultModificationPolicy, defaultPolicySet := cm.pm.GetPolicy(NewConfigurationItemPolicyKey)
196+
defaultModificationPolicy, defaultPolicySet := cm.PolicyManager().GetPolicy(NewConfigurationItemPolicyKey)
197197

198198
// If the default modification policy is not set, it indicates this is an uninitialized chain, so be permissive of modification
199199
if !defaultPolicySet {
@@ -226,7 +226,7 @@ func (cm *configurationManager) processConfig(configtx *cb.ConfigurationEnvelope
226226

227227
// If a config item was modified, its LastModified must be set correctly, and it must satisfy the modification policy
228228
if isModified {
229-
logger.Debugf("Proposed configuration item of type %v and key %t on chain %s has been modified", config.Type, config.Key, cm.chainID)
229+
logger.Debugf("Proposed configuration item of type %v and key %s on chain %s has been modified", config.Type, config.Key, cm.chainID)
230230

231231
if config.LastModified != seq {
232232
return nil, fmt.Errorf("Key %v for type %v was modified, but its LastModified %d does not equal current configtx Sequence %d", config.Key, config.Type, config.LastModified, seq)
@@ -237,7 +237,7 @@ func (cm *configurationManager) processConfig(configtx *cb.ConfigurationEnvelope
237237
var policy policies.Policy
238238
oldItem, ok := cm.configuration[config.Type][config.Key]
239239
if ok {
240-
policy, _ = cm.pm.GetPolicy(oldItem.ModificationPolicy)
240+
policy, _ = cm.PolicyManager().GetPolicy(oldItem.ModificationPolicy)
241241
} else {
242242
policy = defaultModificationPolicy
243243
}
@@ -256,7 +256,7 @@ func (cm *configurationManager) processConfig(configtx *cb.ConfigurationEnvelope
256256

257257
// Ensure the type handler agrees the config is well formed
258258
logger.Debugf("Proposing configuration item of type %v for key %s on chain %s", config.Type, config.Key, cm.chainID)
259-
err = cm.handlers[config.Type].ProposeConfig(config)
259+
err = cm.Initializer.Handlers()[config.Type].ProposeConfig(config)
260260
if err != nil {
261261
return nil, fmt.Errorf("Error proposing configuration item of type %v for key %s on chain %s: %s", config.Type, config.Key, chainID, err)
262262
}

common/configtx/manager_test.go

+39-37
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package configtx
17+
package configtx_test
1818

1919
import (
2020
"fmt"
2121
"testing"
2222

23+
. "github.com/hyperledger/fabric/common/configtx"
2324
"github.com/hyperledger/fabric/common/policies"
25+
mockconfigtx "github.com/hyperledger/fabric/orderer/mocks/configtx"
2426
cb "github.com/hyperledger/fabric/protos/common"
2527

2628
"errors"
@@ -88,9 +90,9 @@ func makeSignedConfigurationItem(id, modificationPolicy string, lastModified uin
8890

8991
// TestOmittedHandler tests that startup fails if not all configuration types have an associated handler
9092
func TestOmittedHandler(t *testing.T) {
91-
_, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
93+
_, err := NewManagerImpl(&cb.ConfigurationEnvelope{
9294
Items: []*cb.SignedConfigurationItem{makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), defaultChain)},
93-
}, &mockPolicyManager{&mockPolicy{}}, map[cb.ConfigurationItem_ConfigurationType]Handler{})
95+
}, &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{}}, HandlersVal: map[cb.ConfigurationItem_ConfigurationType]Handler{}})
9496

9597
if err == nil {
9698
t.Fatal("Should have failed to construct manager because handlers were missing")
@@ -99,9 +101,9 @@ func TestOmittedHandler(t *testing.T) {
99101

100102
// TestWrongChainID tests that a configuration update for a different chain ID fails
101103
func TestWrongChainID(t *testing.T) {
102-
cm, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
104+
cm, err := NewManagerImpl(&cb.ConfigurationEnvelope{
103105
Items: []*cb.SignedConfigurationItem{makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), defaultChain)},
104-
}, &mockPolicyManager{&mockPolicy{}}, defaultHandlers())
106+
}, &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{}}, HandlersVal: defaultHandlers()})
105107

106108
if err != nil {
107109
t.Fatalf("Error constructing configuration manager: %s", err)
@@ -124,9 +126,9 @@ func TestWrongChainID(t *testing.T) {
124126

125127
// TestOldConfigReplay tests that resubmitting a config for a sequence number which is not newer is ignored
126128
func TestOldConfigReplay(t *testing.T) {
127-
cm, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
129+
cm, err := NewManagerImpl(&cb.ConfigurationEnvelope{
128130
Items: []*cb.SignedConfigurationItem{makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), defaultChain)},
129-
}, &mockPolicyManager{&mockPolicy{}}, defaultHandlers())
131+
}, &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{}}, HandlersVal: defaultHandlers()})
130132

131133
if err != nil {
132134
t.Fatalf("Error constructing configuration manager: %s", err)
@@ -151,9 +153,9 @@ func TestOldConfigReplay(t *testing.T) {
151153
func TestInvalidInitialConfigByStructure(t *testing.T) {
152154
entries := []*cb.SignedConfigurationItem{makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), defaultChain)}
153155
entries[0].ConfigurationItem = []byte("Corrupted")
154-
_, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
156+
_, err := NewManagerImpl(&cb.ConfigurationEnvelope{
155157
Items: entries,
156-
}, &mockPolicyManager{&mockPolicy{}}, defaultHandlers())
158+
}, &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{}}, HandlersVal: defaultHandlers()})
157159

158160
if err == nil {
159161
t.Fatal("Should have failed to construct configuration by policy")
@@ -162,9 +164,9 @@ func TestInvalidInitialConfigByStructure(t *testing.T) {
162164

163165
// TestValidConfigChange tests the happy path of updating a configuration value with no defaultModificationPolicy
164166
func TestValidConfigChange(t *testing.T) {
165-
cm, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
167+
cm, err := NewManagerImpl(&cb.ConfigurationEnvelope{
166168
Items: []*cb.SignedConfigurationItem{makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), defaultChain)},
167-
}, &mockPolicyManager{&mockPolicy{}}, defaultHandlers())
169+
}, &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{}}, HandlersVal: defaultHandlers()})
168170

169171
if err != nil {
170172
t.Fatalf("Error constructing configuration manager: %s", err)
@@ -188,9 +190,9 @@ func TestValidConfigChange(t *testing.T) {
188190
// TestConfigChangeRegressedSequence tests to make sure that a new config cannot roll back one of the
189191
// config values while advancing another
190192
func TestConfigChangeRegressedSequence(t *testing.T) {
191-
cm, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
193+
cm, err := NewManagerImpl(&cb.ConfigurationEnvelope{
192194
Items: []*cb.SignedConfigurationItem{makeSignedConfigurationItem("foo", "foo", 1, []byte("foo"), defaultChain)},
193-
}, &mockPolicyManager{&mockPolicy{}}, defaultHandlers())
195+
}, &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{}}, HandlersVal: defaultHandlers()})
194196

195197
if err != nil {
196198
t.Fatalf("Error constructing configuration manager: %s", err)
@@ -217,9 +219,9 @@ func TestConfigChangeRegressedSequence(t *testing.T) {
217219
// TestConfigChangeOldSequence tests to make sure that a new config cannot roll back one of the
218220
// config values while advancing another
219221
func TestConfigChangeOldSequence(t *testing.T) {
220-
cm, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
222+
cm, err := NewManagerImpl(&cb.ConfigurationEnvelope{
221223
Items: []*cb.SignedConfigurationItem{makeSignedConfigurationItem("foo", "foo", 1, []byte("foo"), defaultChain)},
222-
}, &mockPolicyManager{&mockPolicy{}}, defaultHandlers())
224+
}, &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{}}, HandlersVal: defaultHandlers()})
223225

224226
if err != nil {
225227
t.Fatalf("Error constructing configuration manager: %s", err)
@@ -246,12 +248,12 @@ func TestConfigChangeOldSequence(t *testing.T) {
246248
// TestConfigImplicitDelete tests to make sure that a new config does not implicitly delete config items
247249
// by omitting them in the new config
248250
func TestConfigImplicitDelete(t *testing.T) {
249-
cm, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
251+
cm, err := NewManagerImpl(&cb.ConfigurationEnvelope{
250252
Items: []*cb.SignedConfigurationItem{
251253
makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), defaultChain),
252254
makeSignedConfigurationItem("bar", "bar", 0, []byte("bar"), defaultChain),
253255
},
254-
}, &mockPolicyManager{&mockPolicy{}}, defaultHandlers())
256+
}, &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{}}, HandlersVal: defaultHandlers()})
255257

256258
if err != nil {
257259
t.Fatalf("Error constructing configuration manager: %s", err)
@@ -276,9 +278,9 @@ func TestConfigImplicitDelete(t *testing.T) {
276278

277279
// TestEmptyConfigUpdate tests to make sure that an empty config is rejected as an update
278280
func TestEmptyConfigUpdate(t *testing.T) {
279-
cm, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
281+
cm, err := NewManagerImpl(&cb.ConfigurationEnvelope{
280282
Items: []*cb.SignedConfigurationItem{makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), defaultChain)},
281-
}, &mockPolicyManager{&mockPolicy{}}, defaultHandlers())
283+
}, &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{}}, HandlersVal: defaultHandlers()})
282284

283285
if err != nil {
284286
t.Fatalf("Error constructing configuration manager: %s", err)
@@ -301,12 +303,12 @@ func TestEmptyConfigUpdate(t *testing.T) {
301303
// is substituted into an otherwise valid new config, that the new config is rejected for attempting a modification without
302304
// increasing the config item's LastModified
303305
func TestSilentConfigModification(t *testing.T) {
304-
cm, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
306+
cm, err := NewManagerImpl(&cb.ConfigurationEnvelope{
305307
Items: []*cb.SignedConfigurationItem{
306308
makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), defaultChain),
307309
makeSignedConfigurationItem("bar", "bar", 0, []byte("bar"), defaultChain),
308310
},
309-
}, &mockPolicyManager{&mockPolicy{}}, defaultHandlers())
311+
}, &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{}}, HandlersVal: defaultHandlers()})
310312

311313
if err != nil {
312314
t.Fatalf("Error constructing configuration manager: %s", err)
@@ -333,10 +335,9 @@ func TestSilentConfigModification(t *testing.T) {
333335
// TestInvalidInitialConfigByPolicy tests to make sure that if an existing policies does not validate the config that
334336
// even construction fails
335337
func TestInvalidInitialConfigByPolicy(t *testing.T) {
336-
_, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
338+
_, err := NewManagerImpl(&cb.ConfigurationEnvelope{
337339
Items: []*cb.SignedConfigurationItem{makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), defaultChain)},
338-
}, &mockPolicyManager{&mockPolicy{policyResult: fmt.Errorf("err")}}, defaultHandlers())
339-
// mockPolicyManager will return non-validating defualt policy
340+
}, &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{policyResult: fmt.Errorf("err")}}, HandlersVal: defaultHandlers()})
340341

341342
if err == nil {
342343
t.Fatal("Should have failed to construct configuration by policy")
@@ -347,9 +348,9 @@ func TestInvalidInitialConfigByPolicy(t *testing.T) {
347348
// it is rejected in a config update
348349
func TestConfigChangeViolatesPolicy(t *testing.T) {
349350
mpm := &mockPolicyManager{}
350-
cm, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
351+
cm, err := NewManagerImpl(&cb.ConfigurationEnvelope{
351352
Items: []*cb.SignedConfigurationItem{makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), defaultChain)},
352-
}, mpm, defaultHandlers())
353+
}, &mockconfigtx.Initializer{PolicyManagerVal: mpm, HandlersVal: defaultHandlers()})
353354

354355
if err != nil {
355356
t.Fatalf("Error constructing configuration manager: %s", err)
@@ -376,9 +377,9 @@ func TestConfigChangeViolatesPolicy(t *testing.T) {
376377
// as the policy may have changed, certs revoked, etc. since the config was adopted.
377378
func TestUnchangedConfigViolatesPolicy(t *testing.T) {
378379
mpm := &mockPolicyManager{}
379-
cm, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
380+
cm, err := NewManagerImpl(&cb.ConfigurationEnvelope{
380381
Items: []*cb.SignedConfigurationItem{makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), defaultChain)},
381-
}, mpm, defaultHandlers())
382+
}, &mockconfigtx.Initializer{PolicyManagerVal: mpm, HandlersVal: defaultHandlers()})
382383

383384
if err != nil {
384385
t.Fatalf("Error constructing configuration manager: %s", err)
@@ -420,15 +421,16 @@ func (fh failHandler) ProposeConfig(item *cb.ConfigurationItem) error {
420421
// that if the handler does not accept the config, it is rejected
421422
func TestInvalidProposal(t *testing.T) {
422423
handlers := defaultHandlers()
423-
cm, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
424+
initializer := &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{}}, HandlersVal: handlers}
425+
cm, err := NewManagerImpl(&cb.ConfigurationEnvelope{
424426
Items: []*cb.SignedConfigurationItem{makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), defaultChain)},
425-
}, &mockPolicyManager{&mockPolicy{}}, handlers)
427+
}, initializer)
426428

427429
if err != nil {
428430
t.Fatalf("Error constructing configuration manager: %s", err)
429431
}
430432

431-
cm.(*configurationManager).handlers[cb.ConfigurationItem_ConfigurationType(0)] = failHandler{}
433+
initializer.Handlers()[cb.ConfigurationItem_ConfigurationType(0)] = failHandler{}
432434

433435
newConfig := &cb.ConfigurationEnvelope{
434436
Items: []*cb.SignedConfigurationItem{makeSignedConfigurationItem("foo", "foo", 1, []byte("foo"), defaultChain)},
@@ -451,9 +453,9 @@ func TestMissingHeader(t *testing.T) {
451453
configItem := makeConfigurationItem("foo", "foo", 0, []byte("foo"), defaultChain)
452454
configItem.Header = nil
453455
data, _ := proto.Marshal(configItem)
454-
_, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
456+
_, err := NewManagerImpl(&cb.ConfigurationEnvelope{
455457
Items: []*cb.SignedConfigurationItem{&cb.SignedConfigurationItem{ConfigurationItem: data}},
456-
}, &mockPolicyManager{&mockPolicy{}}, handlers)
458+
}, &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{}}, HandlersVal: handlers})
457459

458460
if err == nil {
459461
t.Error("Should have errored creating the configuration manager because of the missing header")
@@ -463,9 +465,9 @@ func TestMissingHeader(t *testing.T) {
463465
// TestMissingChainID checks that a configuration item with a missing chainID causes the config to be rejected
464466
func TestMissingChainID(t *testing.T) {
465467
handlers := defaultHandlers()
466-
_, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
468+
_, err := NewManagerImpl(&cb.ConfigurationEnvelope{
467469
Items: []*cb.SignedConfigurationItem{makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), "")},
468-
}, &mockPolicyManager{&mockPolicy{}}, handlers)
470+
}, &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{}}, HandlersVal: handlers})
469471

470472
if err == nil {
471473
t.Error("Should have errored creating the configuration manager because of the missing header")
@@ -475,12 +477,12 @@ func TestMissingChainID(t *testing.T) {
475477
// TestMismatchedChainID checks that a configuration envelope with items with mixed chainIDs causes the config to be rejected
476478
func TestMismatchedChainID(t *testing.T) {
477479
handlers := defaultHandlers()
478-
_, err := NewConfigurationManager(&cb.ConfigurationEnvelope{
480+
_, err := NewManagerImpl(&cb.ConfigurationEnvelope{
479481
Items: []*cb.SignedConfigurationItem{
480482
makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), "chain1"),
481483
makeSignedConfigurationItem("foo", "foo", 0, []byte("foo"), "chain2"),
482484
},
483-
}, &mockPolicyManager{&mockPolicy{}}, handlers)
485+
}, &mockconfigtx.Initializer{PolicyManagerVal: &mockPolicyManager{&mockPolicy{}}, HandlersVal: handlers})
484486

485487
if err == nil {
486488
t.Error("Should have errored creating the configuration manager because of the missing header")

0 commit comments

Comments
 (0)