@@ -15,15 +15,11 @@ import (
15
15
"github.com/hyperledger/fabric/common/channelconfig"
16
16
cc "github.com/hyperledger/fabric/common/config"
17
17
"github.com/hyperledger/fabric/common/configtx"
18
- configtxtest "github.com/hyperledger/fabric/common/configtx/test"
19
18
"github.com/hyperledger/fabric/common/deliver"
20
19
"github.com/hyperledger/fabric/common/flogging"
21
20
commonledger "github.com/hyperledger/fabric/common/ledger"
22
21
"github.com/hyperledger/fabric/common/ledger/blockledger"
23
- "github.com/hyperledger/fabric/common/ledger/blockledger/file"
24
- mockchannelconfig "github.com/hyperledger/fabric/common/mocks/config"
25
- mockconfigtx "github.com/hyperledger/fabric/common/mocks/configtx"
26
- mockpolicies "github.com/hyperledger/fabric/common/mocks/policies"
22
+ fileledger "github.com/hyperledger/fabric/common/ledger/blockledger/file"
27
23
"github.com/hyperledger/fabric/common/policies"
28
24
"github.com/hyperledger/fabric/common/resourcesconfig"
29
25
"github.com/hyperledger/fabric/core/comm"
@@ -169,14 +165,6 @@ var chains = struct {
169
165
list map [string ]* chain
170
166
}{list : make (map [string ]* chain )}
171
167
172
- //MockInitialize resets chains for test env
173
- func MockInitialize () {
174
- ledgermgmt .InitializeTestEnvWithCustomProcessors (ConfigTxProcessors )
175
- chains .list = nil
176
- chains .list = make (map [string ]* chain )
177
- chainInitializer = func (string ) { return }
178
- }
179
-
180
168
var chainInitializer func (string )
181
169
182
170
var mockMSPIDGetter func (string ) []string
@@ -436,36 +424,6 @@ func CreateChainFromBlock(cb *common.Block) error {
436
424
return createChain (cid , l , cb )
437
425
}
438
426
439
- // MockCreateChain used for creating a ledger for a chain for tests
440
- // without having to join
441
- func MockCreateChain (cid string ) error {
442
- var ledger ledger.PeerLedger
443
- var err error
444
-
445
- if ledger = GetLedger (cid ); ledger == nil {
446
- gb , _ := configtxtest .MakeGenesisBlock (cid )
447
- if ledger , err = ledgermgmt .CreateLedger (gb ); err != nil {
448
- return err
449
- }
450
- }
451
-
452
- chains .Lock ()
453
- defer chains .Unlock ()
454
-
455
- chains .list [cid ] = & chain {
456
- cs : & chainSupport {
457
- Resources : & mockchannelconfig.Resources {
458
- PolicyManagerVal : & mockpolicies.Manager {
459
- Policy : & mockpolicies.Policy {},
460
- },
461
- ConfigtxValidatorVal : & mockconfigtx.Validator {},
462
- },
463
- ledger : ledger },
464
- }
465
-
466
- return nil
467
- }
468
-
469
427
// GetLedger returns the ledger of the chain with chain ID. Note that this
470
428
// call returns nil if chain cid has not been created.
471
429
func GetLedger (cid string ) ledger.PeerLedger {
0 commit comments