Skip to content

Commit

Permalink
fix(weaver-go-sdk): corrected membership API function signatures
Browse files Browse the repository at this point in the history
Modified the SDK functions to be compatible with the Weaver Fabric Interoperation Chaincode.

Signed-off-by: VRamakrishna <vramakr2@in.ibm.com>
  • Loading branch information
VRamakrishna authored and sandeepnRES committed Dec 21, 2023
1 parent 85ed20c commit 083ea4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions weaver/sdks/fabric/go-sdk/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: ")
Expand Down

0 comments on commit 083ea4f

Please sign in to comment.