Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit a218800

Browse files
author
Dennis Kuhnert
committed
[FAB-7053] Make ChannelConfig public
Change-Id: Iec27835c81bd2df94dd2ef8af7b00389471f26a2 Signed-off-by: Dennis Kuhnert <dennis.kuhnert@sap.com>
1 parent a5e3c16 commit a218800

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

api/apifabclient/channel.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type Channel interface {
3131
Initialize(data []byte) error
3232
IsInitialized() bool
3333
LoadConfigUpdateEnvelope(data []byte) error
34+
ChannelConfig() (*common.ConfigEnvelope, error)
3435
SendInstantiateProposal(chaincodeName string, args [][]byte, chaincodePath string, chaincodeVersion string, chaincodePolicy *common.SignaturePolicyEnvelope, targets []txn.ProposalProcessor) ([]*txn.TransactionProposalResponse, txn.TransactionID, error)
3536
SendUpgradeProposal(chaincodeName string, args [][]byte, chaincodePath string, chaincodeVersion string, chaincodePolicy *common.SignaturePolicyEnvelope, targets []txn.ProposalProcessor) ([]*txn.TransactionProposalResponse, txn.TransactionID, error)
3637

pkg/fabric-client/channel/config.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (c *Channel) Initialize(configUpdate []byte) error {
5252
return nil
5353
}
5454

55-
configEnvelope, err := c.channelConfig()
55+
configEnvelope, err := c.ChannelConfig()
5656
if err != nil {
5757
return errors.WithMessage(err, "channel configuration retrieval from orderer failed")
5858
}
@@ -119,14 +119,12 @@ func (c *Channel) initializeFromConfig(configItems *configItems) error {
119119
return nil
120120
}
121121

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

132130
// Get the newest block

0 commit comments

Comments
 (0)