Skip to content

Commit

Permalink
[FAB-9238] revoke test to use config yaml
Browse files Browse the repository at this point in the history
-As per current endpointConfig.ChannelPeers logic,
config backend needs extra set of keys to make channels.peers
attributes 'false'. So reverting custom backend in
revoke test for time being to make CI stable,
till endpointConfig.ChannelPeers logic is fixed.


Change-Id: I8b115ae57b258d68fffbdc6aab4371cfce79de1c
Signed-off-by: Sudesh Shetty <sudesh.shetty@securekey.com>
  • Loading branch information
sudeshrshetty committed Apr 13, 2018
1 parent 66ac24e commit f8fb6c2
Show file tree
Hide file tree
Showing 3 changed files with 463 additions and 9 deletions.
16 changes: 8 additions & 8 deletions pkg/fab/endpointconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,16 +437,16 @@ func (c *EndpointConfig) ChannelPeers(name string) ([]fab.ChannelPeer, error) {
chPeerKey := "channels." + name + ".peers." + peerName

// Default value for endorsing peer key is true
setEndorsingPeer(chPeerKey, c, chPeerConfig)
setEndorsingPeer(chPeerKey, c, &chPeerConfig)

// Default value for chaincode query key is true
setChaincodeQuery(chPeerKey, c, chPeerConfig)
setChaincodeQuery(chPeerKey, c, &chPeerConfig)

// Default value for ledger query key is true
setLedgerQuery(chPeerKey, c, chPeerConfig)
setLedgerQuery(chPeerKey, c, &chPeerConfig)

// Default value for event source key is true
setEventSource(chPeerKey, c, chPeerConfig)
setEventSource(chPeerKey, c, &chPeerConfig)

mspID, err := c.PeerMSPID(peerName)
if err != nil {
Expand All @@ -464,31 +464,31 @@ func (c *EndpointConfig) ChannelPeers(name string) ([]fab.ChannelPeer, error) {

}

func setEndorsingPeer(chPeerKey string, c *EndpointConfig, chPeerConfig fab.PeerChannelConfig) {
func setEndorsingPeer(chPeerKey string, c *EndpointConfig, chPeerConfig *fab.PeerChannelConfig) {
endorsingPeerKey := strings.ToLower(chPeerKey + ".endorsingPeer")
_, ok := c.backend.Lookup(endorsingPeerKey)
if !ok {
chPeerConfig.EndorsingPeer = true
}
}

func setEventSource(chPeerKey string, c *EndpointConfig, chPeerConfig fab.PeerChannelConfig) {
func setEventSource(chPeerKey string, c *EndpointConfig, chPeerConfig *fab.PeerChannelConfig) {
eventSourceKey := strings.ToLower(chPeerKey + ".eventSource")
_, ok := c.backend.Lookup(eventSourceKey)
if !ok {
chPeerConfig.EventSource = true
}
}

func setLedgerQuery(chPeerKey string, c *EndpointConfig, chPeerConfig fab.PeerChannelConfig) {
func setLedgerQuery(chPeerKey string, c *EndpointConfig, chPeerConfig *fab.PeerChannelConfig) {
ledgerQueryKey := strings.ToLower(chPeerKey + ".ledgerQuery")
_, ok := c.backend.Lookup(ledgerQueryKey)
if !ok {
chPeerConfig.LedgerQuery = true
}
}

func setChaincodeQuery(chPeerKey string, c *EndpointConfig, chPeerConfig fab.PeerChannelConfig) {
func setChaincodeQuery(chPeerKey string, c *EndpointConfig, chPeerConfig *fab.PeerChannelConfig) {
ccQueryKey := strings.ToLower(chPeerKey + ".chaincodeQuery")
_, ok := c.backend.Lookup(ccQueryKey)
if !ok {
Expand Down
Loading

0 comments on commit f8fb6c2

Please sign in to comment.