Skip to content

Commit

Permalink
[FAB-7053] Make ChannelConfig public
Browse files Browse the repository at this point in the history
Change-Id: Iec27835c81bd2df94dd2ef8af7b00389471f26a2
Signed-off-by: Dennis Kuhnert <dennis.kuhnert@sap.com>
  • Loading branch information
Dennis Kuhnert committed Nov 20, 2017
1 parent a5e3c16 commit a218800
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions api/apifabclient/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type Channel interface {
Initialize(data []byte) error
IsInitialized() bool
LoadConfigUpdateEnvelope(data []byte) error
ChannelConfig() (*common.ConfigEnvelope, error)
SendInstantiateProposal(chaincodeName string, args [][]byte, chaincodePath string, chaincodeVersion string, chaincodePolicy *common.SignaturePolicyEnvelope, targets []txn.ProposalProcessor) ([]*txn.TransactionProposalResponse, txn.TransactionID, error)
SendUpgradeProposal(chaincodeName string, args [][]byte, chaincodePath string, chaincodeVersion string, chaincodePolicy *common.SignaturePolicyEnvelope, targets []txn.ProposalProcessor) ([]*txn.TransactionProposalResponse, txn.TransactionID, error)

Expand Down
16 changes: 7 additions & 9 deletions pkg/fabric-client/channel/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (c *Channel) Initialize(configUpdate []byte) error {
return nil
}

configEnvelope, err := c.channelConfig()
configEnvelope, err := c.ChannelConfig()
if err != nil {
return errors.WithMessage(err, "channel configuration retrieval from orderer failed")
}
Expand Down Expand Up @@ -119,14 +119,12 @@ func (c *Channel) initializeFromConfig(configItems *configItems) error {
return nil
}

/**
* Queries for the current config block for this channel.
* This transaction will be made to the orderer.
* @returns {ConfigEnvelope} Object containing the configuration items.
* @see /protos/orderer/ab.proto
* @see /protos/common/configtx.proto
*/
func (c *Channel) channelConfig() (*common.ConfigEnvelope, error) {
// ChannelConfig queries for the current config block for this channel.
// This transaction will be made to the orderer.
// @returns {ConfigEnvelope} Object containing the configuration items.
// @see /protos/orderer/ab.proto
// @see /protos/common/configtx.proto
func (c *Channel) ChannelConfig() (*common.ConfigEnvelope, error) {
logger.Debugf("channelConfig - start for channel %s", c.name)

// Get the newest block
Expand Down

0 comments on commit a218800

Please sign in to comment.