11/*
2- Copyright IBM Corp. 2016 All Rights Reserved.
2+ Copyright IBM Corp. All Rights Reserved.
33
4- Licensed under the Apache License, Version 2.0 (the "License");
5- you may not use this file except in compliance with the License.
6- You may obtain a copy of the License at
7-
8- http://www.apache.org/licenses/LICENSE-2.0
9-
10- Unless required by applicable law or agreed to in writing, software
11- distributed under the License is distributed on an "AS IS" BASIS,
12- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13- See the License for the specific language governing permissions and
14- limitations under the License.
4+ SPDX-License-Identifier: Apache-2.0
155*/
166
177package multichannel
@@ -23,6 +13,8 @@ import (
2313 "github.com/hyperledger/fabric/common/crypto"
2414 "github.com/hyperledger/fabric/common/ledger/blockledger"
2515 mockconfigtx "github.com/hyperledger/fabric/common/mocks/configtx"
16+ "github.com/hyperledger/fabric/common/tools/configtxgen/configtxgentest"
17+ "github.com/hyperledger/fabric/common/tools/configtxgen/encoder"
2618 genesisconfig "github.com/hyperledger/fabric/common/tools/configtxgen/localconfig"
2719 cb "github.com/hyperledger/fabric/protos/common"
2820 "github.com/hyperledger/fabric/protos/utils"
@@ -165,7 +157,9 @@ func TestWriteConfigBlock(t *testing.T) {
165157}
166158
167159func TestGoodWriteConfig (t * testing.T ) {
168- l := NewRAMLedger (10 )
160+ confSys := configtxgentest .Load (genesisconfig .SampleInsecureSoloProfile )
161+ genesisBlockSys := encoder .New (confSys ).GenesisBlock ()
162+ _ , l := newRAMLedgerAndFactory (10 , genesisconfig .TestChainID , genesisBlockSys )
169163
170164 bw := & BlockWriter {
171165 support : & mockBlockWriterSupport {
@@ -176,7 +170,7 @@ func TestGoodWriteConfig(t *testing.T) {
176170 }
177171
178172 ctx := makeConfigTx (genesisconfig .TestChainID , 1 )
179- block := cb .NewBlock (1 , genesisBlock .Header .Hash ())
173+ block := cb .NewBlock (1 , genesisBlockSys .Header .Hash ())
180174 block .Data .Data = [][]byte {utils .MarshalOrPanic (ctx )}
181175 consenterMetadata := []byte ("foo" )
182176 bw .WriteConfigBlock (block , consenterMetadata )
0 commit comments