Skip to content

Commit 5b0424a

Browse files
adecaroalexandrosfilios
authored andcommitted
Introduce Configure function to the ordering service
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
1 parent fe76156 commit 5b0424a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

platform/fabric/core/generic/committer/committer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ type CommitTx struct {
7575
type TransactionHandler = func(ctx context.Context, block *common.BlockMetadata, tx CommitTx) (*FinalityEvent, error)
7676

7777
type OrderingService interface {
78-
SetConfigOrderers(o channelconfig.Orderer, orderers []*grpc.ConnectionConfig) error
78+
Configure(consensusType string, orderers []*grpc.ConnectionConfig) error
7979
}
8080

8181
type Committer struct {
@@ -904,7 +904,7 @@ func (c *Committer) applyBundle(bundle *channelconfig.Bundle) error {
904904
}
905905
if len(newOrderers) != 0 {
906906
c.logger.Debugf("[Channel: %s] Updating the list of orderers: (%d) found", c.ChannelConfig.ID(), len(newOrderers))
907-
return c.OrderingService.SetConfigOrderers(ordererConfig, newOrderers)
907+
return c.OrderingService.Configure(ordererConfig.ConsensusType(), newOrderers)
908908
}
909909
c.logger.Infof("[Channel: %s] No orderers found in Channel config", c.ChannelConfig.ID())
910910

platform/fabric/core/generic/ordering/ordering.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ import (
1414
"github.com/hyperledger-labs/fabric-smart-client/platform/common/services/logging"
1515
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/core/generic/metrics"
1616
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/driver"
17-
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/flogging"
1817
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/grpc"
1918
"github.com/hyperledger-labs/fabric-smart-client/platform/view/view"
2019
common2 "github.com/hyperledger/fabric-protos-go/common"
21-
"github.com/hyperledger/fabric/common/channelconfig"
2220
"github.com/pkg/errors"
2321
"go.uber.org/zap/zapcore"
2422
context2 "golang.org/x/net/context"
@@ -138,8 +136,8 @@ func (o *Service) SetConsensusType(consensusType ConsensusType) error {
138136
return nil
139137
}
140138

141-
func (f *Service) SetConfigOrderers(o channelconfig.Orderer, orderers []*grpc.ConnectionConfig) error {
142-
if err := f.SetConsensusType(o.ConsensusType()); err != nil {
139+
func (f *Service) Configure(consensusType string, orderers []*grpc.ConnectionConfig) error {
140+
if err := f.SetConsensusType(consensusType); err != nil {
143141
return errors.WithMessagef(err, "failed to set consensus type from channel config")
144142
}
145143
if err := f.ConfigService.SetConfigOrderers(orderers); err != nil {

0 commit comments

Comments
 (0)