From 083ea4f4464691fc967a897bf267daaeea216343 Mon Sep 17 00:00:00 2001 From: VRamakrishna Date: Wed, 20 Dec 2023 18:02:09 +0000 Subject: [PATCH] fix(weaver-go-sdk): corrected membership API function signatures Modified the SDK functions to be compatible with the Weaver Fabric Interoperation Chaincode. Signed-off-by: VRamakrishna --- .../fabric/go-sdk/membershipmanager/membership_manager.go | 8 ++++---- weaver/sdks/fabric/go-sdk/readme.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/weaver/sdks/fabric/go-sdk/membershipmanager/membership_manager.go b/weaver/sdks/fabric/go-sdk/membershipmanager/membership_manager.go index 654be316e5..e7c0bfdaaf 100644 --- a/weaver/sdks/fabric/go-sdk/membershipmanager/membership_manager.go +++ b/weaver/sdks/fabric/go-sdk/membershipmanager/membership_manager.go @@ -35,12 +35,12 @@ import ( ) -func CreateLocalMembership(walletPath, userName, connectionProfilePath, channelId, weaverCCId string, mspIds []string) error { +func CreateLocalMembership(walletPath, userName, connectionProfilePath, securityDomain, channelId, weaverCCId string, mspIds []string) error { membership, err := GetMSPConfigurations(walletPath, userName, connectionProfilePath, channelId, mspIds) if err != nil { return err } - membership.SecurityDomain = "" // We don't need this as the Weaver chaincode will internally use a designated keyword + membership.SecurityDomain = securityDomain membershipBytes, err := protoV2.Marshal(membership) if err != nil { return err @@ -55,12 +55,12 @@ func CreateLocalMembership(walletPath, userName, connectionProfilePath, channelI return nil } -func UpdateLocalMembership(walletPath, userName, connectionProfilePath, channelId, weaverCCId string, mspIds []string) error { +func UpdateLocalMembership(walletPath, userName, connectionProfilePath, securityDomain, channelId, weaverCCId string, mspIds []string) error { membership, err := GetMSPConfigurations(walletPath, userName, connectionProfilePath, channelId, mspIds) if err != nil { return err } - membership.SecurityDomain = "" // We don't need this as the Weaver chaincode will internally use a designated keyword + membership.SecurityDomain = securityDomain membershipBytes, err := protoV2.Marshal(membership) if err != nil { return err diff --git a/weaver/sdks/fabric/go-sdk/readme.md b/weaver/sdks/fabric/go-sdk/readme.md index 843cb54a69..2224bda5bb 100644 --- a/weaver/sdks/fabric/go-sdk/readme.md +++ b/weaver/sdks/fabric/go-sdk/readme.md @@ -45,11 +45,11 @@ The [membership manager functions](./membershipmanager) are currently not covere fmt.Printf("%+v\n", membership) fmt.Printf("Create Local Membership: ") - err := CreateLocalMembership(walletPath, userName, connectionProfilePath, "mychannel", "interop", []string{"Org1MSP"}) + err := CreateLocalMembership(walletPath, userName, connectionProfilePath, "network1", "mychannel", "interop", []string{"Org1MSP"}) fmt.Println(err) fmt.Printf("Update Local Membership: ") - err = UpdateLocalMembership(walletPath, userName, connectionProfilePath, "mychannel", "interop", []string{"Org1MSP"}) + err = UpdateLocalMembership(walletPath, userName, connectionProfilePath, "network1", "mychannel", "interop", []string{"Org1MSP"}) fmt.Println(err) fmt.Printf("Read Local Membership: ")