-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-9661] Selection based on Fabric's Discovery
Selection Service implementation using Fabric's Discovery Service. Change-Id: I11ebac5ddb397ead8fb5bec01e461697bd5a7d41 Signed-off-by: Bob Stasyszyn <[email protected]>
- Loading branch information
1 parent
aedc226
commit 1fed320
Showing
13 changed files
with
951 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package fabricselection | ||
|
||
import "github.com/hyperledger/fabric-sdk-go/pkg/common/providers/fab" | ||
import "encoding/json" | ||
|
||
type cacheKey struct { | ||
chaincodes []*fab.ChaincodeCall | ||
} | ||
|
||
func newCacheKey(chaincodes []*fab.ChaincodeCall) *cacheKey { | ||
return &cacheKey{chaincodes: chaincodes} | ||
} | ||
|
||
func (k *cacheKey) String() string { | ||
bytes, err := json.Marshal(k.chaincodes) | ||
if err != nil { | ||
logger.Errorf("unexpected error marshalling chaincodes: %s", err) | ||
return "" | ||
} | ||
return string(bytes) | ||
} |
Oops, something went wrong.