From 82dce72bca8beda6e5d7a34f34fec761db201cae Mon Sep 17 00:00:00 2001 From: osamamagdy Date: Wed, 23 Oct 2024 00:54:00 +0300 Subject: [PATCH] fix: fix linting errors Signed-off-by: osamamagdy --- samples/application/ccapi/common/resmgnt.go | 3 +++ samples/application/ccapi/handlers/qscc.go | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/samples/application/ccapi/common/resmgnt.go b/samples/application/ccapi/common/resmgnt.go index 301b8761e..47e5a2915 100644 --- a/samples/application/ccapi/common/resmgnt.go +++ b/samples/application/ccapi/common/resmgnt.go @@ -28,6 +28,7 @@ type fabricLedgerClient struct { // 1. Get sdk // 2. Use sdk to create a ClientProvider () // 3. From client provider create resmgmt Client +// // You can then use this .Client to call for specific functionalities func NewFabricResmgmtClient(orgName, userName string, opts ...resmgmt.ClientOption) (*fabricResmgtmClient, error) { sdk, err := GetSDK() @@ -58,6 +59,7 @@ func NewFabricResmgmtClient(orgName, userName string, opts ...resmgmt.ClientOpti // 1. Get sdk // 2. Use sdk to create a ChannelProvider () // 3. From channel provider create channel Client +// // You can then use this .Client to call for specific functionalities func NewFabricChClient(channelName, userName, orgName string) (*fabricChannelClient, error) { sdk, err := GetSDK() @@ -87,6 +89,7 @@ func NewFabricChClient(channelName, userName, orgName string) (*fabricChannelCli // 1. Get sdk // 2. Use sdk to create a ChannelProvider () // 3. From channel provider create ledger Client +// // You can then use this .Client to call for specific functionalities func NewFabricLedgerClient(channelName, user, orgName string) (*fabricLedgerClient, error) { sdk, err := GetSDK() diff --git a/samples/application/ccapi/handlers/qscc.go b/samples/application/ccapi/handlers/qscc.go index d999d3934..b217e864d 100644 --- a/samples/application/ccapi/handlers/qscc.go +++ b/samples/application/ccapi/handlers/qscc.go @@ -4,7 +4,7 @@ import ( "encoding/hex" "fmt" "net/http" - + "github.com/gin-gonic/gin" "github.com/hyperledger-labs/ccapi/chaincode" "github.com/hyperledger-labs/ccapi/common" @@ -25,7 +25,7 @@ func QueryQSCC(c *gin.Context) { case "getBlockByNumber": getBlockByNumber(c, channelName) case "getBlockByHash": - getBlockByHash(c, channelName) + getBlockByHash(c, channelName) case "getTransactionByID": getTransactionByID(c, channelName) case "getChainInfo": @@ -147,7 +147,7 @@ func getBlockByHash(c *gin.Context, channelName string) { } result, err := chaincode.QueryGateway(channelName, "qscc", "GetBlockByHash", user, []string{channelName, string(hashBytes)}) - + if err != nil { err, status := common.ParseError(err) common.Abort(c, status, err) @@ -448,4 +448,4 @@ func decodeProcessedTransaction(t []byte) (map[string]interface{}, error) { } return processedTransactionMap, nil -} \ No newline at end of file +}