Skip to content

Commit 90265a8

Browse files
committed
[FAB-9976] Remove ChaincodeProviderFactory
Dependencies on ChaincodeProvider are now explicit and are satisfied as function arguments or object dependencies. Change-Id: Iad1f2a9fd3a13710e5b33ad60431172212f7613d Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
1 parent 36bc31e commit 90265a8

20 files changed

+103
-154
lines changed

core/chaincode/ccproviderimpl.go

+9-34
Original file line numberDiff line numberDiff line change
@@ -24,39 +24,17 @@ import (
2424
pb "github.com/hyperledger/fabric/protos/peer"
2525
)
2626

27-
// ccProviderFactory implements the ccprovider.ChaincodeProviderFactory
28-
// interface and returns instances of ccprovider.ChaincodeProvider
29-
type ccProviderFactory struct {
27+
// ccProviderImpl is an implementation of the ccprovider.ChaincodeProvider interface
28+
type CCProviderImpl struct {
3029
cs *ChaincodeSupport
3130
}
3231

33-
// NewChaincodeProvider returns pointers to ccProviderImpl as an
34-
// implementer of the ccprovider.ChaincodeProvider interface
35-
func (c *ccProviderFactory) NewChaincodeProvider() ccprovider.ChaincodeProvider {
36-
return &ccProviderImpl{
37-
cs: c.cs,
38-
}
39-
}
40-
41-
// SideEffectInitialize should be called whenever NewChaincodeSupport is called.
42-
// Initialization by side effect is a terrible pattern, and we should make every
43-
// effort to remove this function, but it is being left as is to make the changeset
44-
// which includes it less invasive.
45-
// XXX TODO Remove me
46-
func SideEffectInitialize(cs *ChaincodeSupport) {
47-
ccprovider.RegisterChaincodeProviderFactory(&ccProviderFactory{
48-
cs: cs,
49-
})
50-
}
51-
52-
// ccProviderImpl is an implementation of the ccprovider.ChaincodeProvider interface
53-
type ccProviderImpl struct {
54-
cs *ChaincodeSupport
32+
func NewProvider(cs *ChaincodeSupport) *CCProviderImpl {
33+
return &CCProviderImpl{cs: cs}
5534
}
5635

5736
// GetContext returns a context for the supplied ledger, with the appropriate tx simulator
58-
func (c *ccProviderImpl) GetContext(ledger ledger.PeerLedger, txid string) (context.Context, ledger.TxSimulator, error) {
59-
var err error
37+
func (c *CCProviderImpl) GetContext(ledger ledger.PeerLedger, txid string) (context.Context, ledger.TxSimulator, error) {
6038
// get context for the chaincode execution
6139
txsim, err := ledger.NewTxSimulator(txid)
6240
if err != nil {
@@ -67,7 +45,7 @@ func (c *ccProviderImpl) GetContext(ledger ledger.PeerLedger, txid string) (cont
6745
}
6846

6947
// ExecuteChaincode executes the chaincode specified in the context with the specified arguments
70-
func (c *ccProviderImpl) ExecuteChaincode(ctxt context.Context, cccid *ccprovider.CCContext, args [][]byte) (*pb.Response, *pb.ChaincodeEvent, error) {
48+
func (c *CCProviderImpl) ExecuteChaincode(ctxt context.Context, cccid *ccprovider.CCContext, args [][]byte) (*pb.Response, *pb.ChaincodeEvent, error) {
7149
invocationSpec := &pb.ChaincodeInvocationSpec{
7250
ChaincodeSpec: &pb.ChaincodeSpec{
7351
Type: pb.ChaincodeSpec_GOLANG,
@@ -79,14 +57,11 @@ func (c *ccProviderImpl) ExecuteChaincode(ctxt context.Context, cccid *ccprovide
7957
}
8058

8159
// Execute executes the chaincode given context and spec (invocation or deploy)
82-
func (c *ccProviderImpl) Execute(ctxt context.Context, cccid *ccprovider.CCContext, spec ccprovider.ChaincodeSpecGetter) (*pb.Response, *pb.ChaincodeEvent, error) {
60+
func (c *CCProviderImpl) Execute(ctxt context.Context, cccid *ccprovider.CCContext, spec ccprovider.ChaincodeSpecGetter) (*pb.Response, *pb.ChaincodeEvent, error) {
8361
return c.cs.Execute(ctxt, cccid, spec)
8462
}
8563

8664
// Stop stops the chaincode given context and spec
87-
func (c *ccProviderImpl) Stop(ctxt context.Context, cccid *ccprovider.CCContext, spec *pb.ChaincodeDeploymentSpec) error {
88-
if c.cs != nil {
89-
return c.cs.Stop(ctxt, cccid, spec)
90-
}
91-
panic("ChaincodeSupport not initialized")
65+
func (c *CCProviderImpl) Stop(ctxt context.Context, cccid *ccprovider.CCContext, spec *pb.ChaincodeDeploymentSpec) error {
66+
return c.cs.Stop(ctxt, cccid, spec)
9267
}

core/chaincode/chaincode_support_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ func initMockPeer(chainIDs ...string) (*ChaincodeSupport, error) {
188188
),
189189
sccp,
190190
)
191-
SideEffectInitialize(chaincodeSupport)
192191

193192
// Mock policy checker
194193
policy.RegisterPolicyCheckerFactory(&mockPolicyCheckerFactory{})
195194

196-
for _, cc := range scc.CreateSysCCs(sccp) {
195+
ccp := &CCProviderImpl{cs: chaincodeSupport}
196+
for _, cc := range scc.CreateSysCCs(ccp, sccp) {
197197
sccp.RegisterSysCC(cc)
198198
}
199199

@@ -202,7 +202,7 @@ func initMockPeer(chainIDs ...string) (*ChaincodeSupport, error) {
202202
if err := peer.MockCreateChain(id); err != nil {
203203
return nil, err
204204
}
205-
sccp.DeploySysCCs(id)
205+
sccp.DeploySysCCs(id, ccp)
206206
// any chain other than the default testchainid does not have a MSP set up -> create one
207207
if id != util.GetTestChainID() {
208208
mspmgmt.XXXSetMSPManager(id, mspmgmt.GetManagerForChain(util.GetTestChainID()))

core/chaincode/exectransaction_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -137,23 +137,23 @@ func initPeer(chainIDs ...string) (net.Listener, *ChaincodeSupport, func(), erro
137137
),
138138
sccp,
139139
)
140-
SideEffectInitialize(chaincodeSupport)
141140
pb.RegisterChaincodeSupportServer(grpcServer, chaincodeSupport)
142141

143142
// Mock policy checker
144143
policy.RegisterPolicyCheckerFactory(&mockPolicyCheckerFactory{})
145144

146-
for _, cc := range scc.CreateSysCCs(sccp) {
145+
ccp := &CCProviderImpl{cs: chaincodeSupport}
146+
for _, cc := range scc.CreateSysCCs(ccp, sccp) {
147147
sccp.RegisterSysCC(cc)
148148
}
149149

150150
for _, id := range chainIDs {
151-
sccp.DeDeploySysCCs(id)
151+
sccp.DeDeploySysCCs(id, ccp)
152152
if err = peer.MockCreateChain(id); err != nil {
153153
closeListenerAndSleep(lis)
154154
return nil, nil, nil, err
155155
}
156-
sccp.DeploySysCCs(id)
156+
sccp.DeploySysCCs(id, ccp)
157157
// any chain other than the default testchainid does not have a MSP set up -> create one
158158
if id != util.GetTestChainID() {
159159
mspmgmt.XXXSetMSPManager(id, mspmgmt.GetManagerForChain(util.GetTestChainID()))

core/chaincode/systemchaincode_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,10 @@ func initSysCCTests() (*oldSysCCInfo, net.Listener, *ChaincodeSupport, error) {
167167
}
168168

169169
func deploySampleSysCC(t *testing.T, ctxt context.Context, chainID string, chaincodeSupport *ChaincodeSupport) error {
170-
chaincodeSupport.sccp.(*scc.Provider).DeploySysCCs(chainID)
170+
ccp := &CCProviderImpl{cs: chaincodeSupport}
171+
chaincodeSupport.sccp.(*scc.Provider).DeploySysCCs(chainID, ccp)
171172

172-
defer chaincodeSupport.sccp.(*scc.Provider).DeDeploySysCCs(chainID)
173+
defer chaincodeSupport.sccp.(*scc.Provider).DeDeploySysCCs(chainID, ccp)
173174

174175
url := "github.com/hyperledger/fabric/core/scc/sample_syscc"
175176

core/committer/txvalidator/validator.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/hyperledger/fabric/common/configtx"
1515
commonerrors "github.com/hyperledger/fabric/common/errors"
1616
"github.com/hyperledger/fabric/common/flogging"
17+
"github.com/hyperledger/fabric/core/common/ccprovider"
1718
"github.com/hyperledger/fabric/core/common/sysccprovider"
1819
"github.com/hyperledger/fabric/core/common/validation"
1920
"github.com/hyperledger/fabric/core/ledger"
@@ -90,11 +91,16 @@ type blockValidationResult struct {
9091
}
9192

9293
// NewTxValidator creates new transactions validator
93-
func NewTxValidator(support Support, sccp sysccprovider.SystemChaincodeProvider) Validator {
94+
func NewTxValidator(support Support, ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider) Validator {
9495
// Encapsulates interface implementation
9596
return &txValidator{
9697
support: support,
97-
vscc: newVSCCValidator(support, sccp)}
98+
vscc: &vsccValidatorImpl{
99+
support: support,
100+
ccprovider: ccp,
101+
sccprovider: sccp,
102+
},
103+
}
98104
}
99105

100106
func (v *txValidator) chainExists(chain string) bool {

core/committer/txvalidator/validator_test.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ func setupLedgerAndValidatorExplicit(t *testing.T, cpb *mockconfig.MockApplicati
6161
*semaphore.Weighted
6262
}{&mocktxvalidator.Support{LedgerVal: theLedger, ACVal: cpb}, semaphore.NewWeighted(10)}
6363
mp := (&scc.MocksccProviderFactory{}).NewSystemChaincodeProvider()
64-
theValidator := NewTxValidator(vcs, mp)
64+
ccprov := &ccprovider.MockCcProviderImpl{ExecuteResultProvider: executeChaincodeProvider}
65+
theValidator := NewTxValidator(vcs, ccprov, mp)
6566

6667
return theLedger, theValidator
6768
}
@@ -747,7 +748,8 @@ func TestLedgerIsNoAvailable(t *testing.T) {
747748
*semaphore.Weighted
748749
}{&mocktxvalidator.Support{LedgerVal: theLedger, ACVal: &mockconfig.MockApplicationCapabilities{}}, semaphore.NewWeighted(10)}
749750
mp := (&scc.MocksccProviderFactory{}).NewSystemChaincodeProvider()
750-
validator := NewTxValidator(vcs, mp)
751+
ccprov := &ccprovider.MockCcProviderImpl{ExecuteResultProvider: executeChaincodeProvider}
752+
validator := NewTxValidator(vcs, ccprov, mp)
751753

752754
ccID := "mycc"
753755
tx := getEnv(ccID, nil, createRWset(t, ccID), t)
@@ -776,7 +778,8 @@ func TestValidationInvalidEndorsing(t *testing.T) {
776778
*semaphore.Weighted
777779
}{&mocktxvalidator.Support{LedgerVal: theLedger, ACVal: &mockconfig.MockApplicationCapabilities{}}, semaphore.NewWeighted(10)}
778780
mp := (&scc.MocksccProviderFactory{}).NewSystemChaincodeProvider()
779-
validator := NewTxValidator(vcs, mp)
781+
ccprov := &ccprovider.MockCcProviderImpl{ExecuteResultProvider: executeChaincodeProvider}
782+
validator := NewTxValidator(vcs, ccprov, mp)
780783

781784
ccID := "mycc"
782785
tx := getEnv(ccID, nil, createRWset(t, ccID), t)
@@ -839,8 +842,6 @@ var executeChaincodeProvider = &ccExecuteChaincode{
839842
}
840843

841844
func TestMain(m *testing.M) {
842-
ccp.RegisterChaincodeProviderFactory(&ccprovider.MockCcProviderFactory{executeChaincodeProvider})
843-
844845
msptesttools.LoadMSPSetupForTesting()
845846

846847
var err error

core/committer/txvalidator/vscc_validator.go

-9
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,6 @@ type vsccValidatorImpl struct {
4141
sccprovider sysccprovider.SystemChaincodeProvider
4242
}
4343

44-
// newVSCCValidator creates new vscc validator
45-
func newVSCCValidator(support Support, sccp sysccprovider.SystemChaincodeProvider) *vsccValidatorImpl {
46-
return &vsccValidatorImpl{
47-
support: support,
48-
ccprovider: ccprovider.GetChaincodeProvider(),
49-
sccprovider: sccp,
50-
}
51-
}
52-
5344
// VSCCValidateTx executes vscc validation for transaction
5445
func (v *vsccValidatorImpl) VSCCValidateTx(payload *common.Payload, envBytes []byte) (error, peer.TxValidationCode) {
5546
logger.Debugf("VSCCValidateTx starts for bytes %p", envBytes)

core/common/ccprovider/ccprovider.go

-24
Original file line numberDiff line numberDiff line change
@@ -502,27 +502,3 @@ type ChaincodeProvider interface {
502502
// Stop stops the chaincode given context and deployment spec
503503
Stop(ctxt context.Context, cccid *CCContext, spec *pb.ChaincodeDeploymentSpec) error
504504
}
505-
506-
var ccFactory ChaincodeProviderFactory
507-
508-
// ChaincodeProviderFactory defines a factory interface so
509-
// that the actual implementation can be injected
510-
type ChaincodeProviderFactory interface {
511-
NewChaincodeProvider() ChaincodeProvider
512-
}
513-
514-
// RegisterChaincodeProviderFactory is to be called once to set
515-
// the factory that will be used to obtain instances of ChaincodeProvider
516-
func RegisterChaincodeProviderFactory(ccfact ChaincodeProviderFactory) {
517-
ccFactory = ccfact
518-
}
519-
520-
// GetChaincodeProvider returns instances of ChaincodeProvider;
521-
// the actual implementation is controlled by the factory that
522-
// is registered via RegisterChaincodeProviderFactory
523-
func GetChaincodeProvider() ChaincodeProvider {
524-
if ccFactory == nil {
525-
panic("The factory must be set first via RegisterChaincodeProviderFactory")
526-
}
527-
return ccFactory.NewChaincodeProvider()
528-
}

core/peer/peer.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"github.com/hyperledger/fabric/core/comm"
2525
"github.com/hyperledger/fabric/core/committer"
2626
"github.com/hyperledger/fabric/core/committer/txvalidator"
27+
"github.com/hyperledger/fabric/core/common/ccprovider"
2728
"github.com/hyperledger/fabric/core/common/privdata"
2829
"github.com/hyperledger/fabric/core/common/sysccprovider"
2930
"github.com/hyperledger/fabric/core/ledger"
@@ -174,7 +175,7 @@ var validationWorkersSemaphore *semaphore.Weighted
174175
// Initialize sets up any chains that the peer has from the persistence. This
175176
// function should be called at the start up when the ledger and gossip
176177
// ready
177-
func Initialize(init func(string), sccp sysccprovider.SystemChaincodeProvider) {
178+
func Initialize(init func(string), ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider) {
178179
nWorkers := viper.GetInt("peer.validatorPoolSize")
179180
if nWorkers <= 0 {
180181
nWorkers = runtime.NumCPU()
@@ -203,7 +204,7 @@ func Initialize(init func(string), sccp sysccprovider.SystemChaincodeProvider) {
203204
continue
204205
}
205206
// Create a chain if we get a valid ledger with config block
206-
if err = createChain(cid, ledger, cb, sccp); err != nil {
207+
if err = createChain(cid, ledger, cb, ccp, sccp); err != nil {
207208
peerLogger.Warningf("Failed to load chain %s(%s)", cid, err)
208209
peerLogger.Debugf("Error reloading chain %s with message %s. We continue to the next chain rather than abort.", cid, err)
209210
continue
@@ -252,7 +253,7 @@ func getCurrConfigBlockFromLedger(ledger ledger.PeerLedger) (*common.Block, erro
252253
}
253254

254255
// createChain creates a new chain object and insert it into the chains
255-
func createChain(cid string, ledger ledger.PeerLedger, cb *common.Block, sccp sysccprovider.SystemChaincodeProvider) error {
256+
func createChain(cid string, ledger ledger.PeerLedger, cb *common.Block, ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider) error {
256257
chanConf, err := retrievePersistedChannelConfig(ledger)
257258
if err != nil {
258259
return err
@@ -346,7 +347,7 @@ func createChain(cid string, ledger ledger.PeerLedger, cb *common.Block, sccp sy
346347
*chainSupport
347348
*semaphore.Weighted
348349
}{cs, validationWorkersSemaphore}
349-
validator := txvalidator.NewTxValidator(vcs, sccp)
350+
validator := txvalidator.NewTxValidator(vcs, ccp, sccp)
350351
c := committer.NewLedgerCommitterReactive(ledger, func(block *common.Block) error {
351352
chainID, err := utils.GetChainIDFromBlock(block)
352353
if err != nil {
@@ -387,7 +388,7 @@ func createChain(cid string, ledger ledger.PeerLedger, cb *common.Block, sccp sy
387388
}
388389

389390
// CreateChainFromBlock creates a new chain from config block
390-
func CreateChainFromBlock(cb *common.Block, sccp sysccprovider.SystemChaincodeProvider) error {
391+
func CreateChainFromBlock(cb *common.Block, ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider) error {
391392
cid, err := utils.GetChainIDFromBlock(cb)
392393
if err != nil {
393394
return err
@@ -398,7 +399,7 @@ func CreateChainFromBlock(cb *common.Block, sccp sysccprovider.SystemChaincodePr
398399
return fmt.Errorf("Cannot create ledger from genesis block, due to %s", err)
399400
}
400401

401-
return createChain(cid, l, cb, sccp)
402+
return createChain(cid, l, cb, ccp, sccp)
402403
}
403404

404405
// GetLedger returns the ledger of the chain with chain ID. Note that this

core/peer/peer_impl.go

+9-8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package peer
99
import (
1010
"github.com/hyperledger/fabric/common/channelconfig"
1111
"github.com/hyperledger/fabric/common/policies"
12+
"github.com/hyperledger/fabric/core/common/ccprovider"
1213
"github.com/hyperledger/fabric/core/common/sysccprovider"
1314
"github.com/hyperledger/fabric/core/ledger"
1415
"github.com/hyperledger/fabric/protos/common"
@@ -19,27 +20,27 @@ import (
1920
// on singletons in the package. This is a step towards moving from package
2021
// level data for the peer to instance level data.
2122
type Operations interface {
22-
CreateChainFromBlock(cb *common.Block, sccp sysccprovider.SystemChaincodeProvider) error
23+
CreateChainFromBlock(cb *common.Block, ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider) error
2324
GetChannelConfig(cid string) channelconfig.Resources
2425
GetChannelsInfo() []*pb.ChannelInfo
2526
GetCurrConfigBlock(cid string) *common.Block
2627
GetLedger(cid string) ledger.PeerLedger
2728
GetMSPIDs(cid string) []string
2829
GetPolicyManager(cid string) policies.Manager
2930
InitChain(cid string)
30-
Initialize(init func(string), sccp sysccprovider.SystemChaincodeProvider)
31+
Initialize(init func(string), ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider)
3132
}
3233

3334
type peerImpl struct {
34-
createChainFromBlock func(cb *common.Block, sccp sysccprovider.SystemChaincodeProvider) error
35+
createChainFromBlock func(cb *common.Block, ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider) error
3536
getChannelConfig func(cid string) channelconfig.Resources
3637
getChannelsInfo func() []*pb.ChannelInfo
3738
getCurrConfigBlock func(cid string) *common.Block
3839
getLedger func(cid string) ledger.PeerLedger
3940
getMSPIDs func(cid string) []string
4041
getPolicyManager func(cid string) policies.Manager
4142
initChain func(cid string)
42-
initialize func(init func(string), sccp sysccprovider.SystemChaincodeProvider)
43+
initialize func(init func(string), ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider)
4344
}
4445

4546
// Default provides in implementation of the Peer interface that provides
@@ -58,8 +59,8 @@ var Default Operations = &peerImpl{
5859

5960
var DefaultSupport Support = &supportImpl{operations: Default}
6061

61-
func (p *peerImpl) CreateChainFromBlock(cb *common.Block, sccp sysccprovider.SystemChaincodeProvider) error {
62-
return p.createChainFromBlock(cb, sccp)
62+
func (p *peerImpl) CreateChainFromBlock(cb *common.Block, ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider) error {
63+
return p.createChainFromBlock(cb, ccp, sccp)
6364
}
6465
func (p *peerImpl) GetChannelConfig(cid string) channelconfig.Resources {
6566
return p.getChannelConfig(cid)
@@ -70,6 +71,6 @@ func (p *peerImpl) GetLedger(cid string) ledger.PeerLedger { return p.getL
7071
func (p *peerImpl) GetMSPIDs(cid string) []string { return p.getMSPIDs(cid) }
7172
func (p *peerImpl) GetPolicyManager(cid string) policies.Manager { return p.getPolicyManager(cid) }
7273
func (p *peerImpl) InitChain(cid string) { p.initChain(cid) }
73-
func (p *peerImpl) Initialize(init func(string), sccp sysccprovider.SystemChaincodeProvider) {
74-
p.initialize(init, sccp)
74+
func (p *peerImpl) Initialize(init func(string), ccp ccprovider.ChaincodeProvider, sccp sysccprovider.SystemChaincodeProvider) {
75+
p.initialize(init, ccp, sccp)
7576
}

core/peer/peer_test.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/hyperledger/fabric/common/localmsp"
1616
mscc "github.com/hyperledger/fabric/common/mocks/scc"
1717
"github.com/hyperledger/fabric/core/comm"
18-
ccp "github.com/hyperledger/fabric/core/common/ccprovider"
1918
"github.com/hyperledger/fabric/core/deliverservice"
2019
"github.com/hyperledger/fabric/core/deliverservice/blocksprovider"
2120
"github.com/hyperledger/fabric/core/mocks/ccprovider"
@@ -82,10 +81,7 @@ func TestInitialize(t *testing.T) {
8281
cleanup := setupPeerFS(t)
8382
defer cleanup()
8483

85-
// we mock this because we can't import the chaincode package lest we create an import cycle
86-
ccp.RegisterChaincodeProviderFactory(&ccprovider.MockCcProviderFactory{})
87-
88-
Initialize(nil, (&mscc.MocksccProviderFactory{}).NewSystemChaincodeProvider())
84+
Initialize(nil, &ccprovider.MockCcProviderImpl{}, (&mscc.MocksccProviderFactory{}).NewSystemChaincodeProvider())
8985
}
9086

9187
func TestCreateChainFromBlock(t *testing.T) {
@@ -124,7 +120,7 @@ func TestCreateChainFromBlock(t *testing.T) {
124120
go grpcServer.Serve(socket)
125121
defer grpcServer.Stop()
126122

127-
err = CreateChainFromBlock(block, nil)
123+
err = CreateChainFromBlock(block, nil, nil)
128124
if err != nil {
129125
t.Fatalf("failed to create chain %s", err)
130126
}

0 commit comments

Comments
 (0)