Skip to content

Commit

Permalink
Merge "[FAB-1363] Move ChainID method to ConsenterSupport"
Browse files Browse the repository at this point in the history
  • Loading branch information
christo4ferris authored and Gerrit Code Review committed Dec 13, 2016
2 parents 005ed03 + 5992373 commit 679f635
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 8 additions & 0 deletions orderer/mocks/multichain/multichain.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ type ConsenterSupport struct {

// Batches is the channel which WriteBlock writes data to
Batches chan []*cb.Envelope

// ChainIDVal is the value returned by ChainID()
ChainIDVal string
}

// BlockCutter returns BlockCutterVal
Expand All @@ -57,3 +60,8 @@ func (mcs *ConsenterSupport) WriteBlock(data []*cb.Envelope, metadata [][]byte,
logger.Debugf("mockWriter: attempting to write batch")
mcs.Batches <- data
}

// ChainID returns the chain ID this specific consenter instance is associated with
func (mcs *ConsenterSupport) ChainID() string {
return mcs.ChainIDVal
}
4 changes: 1 addition & 3 deletions orderer/multichain/chainsupport.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type ConsenterSupport interface {
BlockCutter() blockcutter.Receiver
SharedConfig() sharedconfig.Manager
WriteBlock(data []*cb.Envelope, metadata [][]byte, committers []filter.Committer)
ChainID() string // ChainID returns the chain ID this specific consenter instance is associated with
}

// ChainSupport provides a wrapper for the resources backing a chain
Expand All @@ -68,9 +69,6 @@ type ChainSupport interface {
deliver.Support
ConsenterSupport

// ChainID returns the ChainID for this chain support
ChainID() string

// ConfigTxManager returns the corresponding configtx.Manager for this chain
ConfigTxManager() configtx.Manager
}
Expand Down

0 comments on commit 679f635

Please sign in to comment.