Skip to content

Commit

Permalink
Fix unused variable error
Browse files Browse the repository at this point in the history
Change-Id: Ibfcbd0a3543f9e20fa05677b0bb32e6d353cb3bd
Signed-off-by: Gabor Hosszu <gabor@digitalasset.com>
  • Loading branch information
gaborh-da committed Sep 2, 2016
1 parent 294af0d commit 1f5e832
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/chaincode/go/asset_management/asset_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type AssetManagementChaincode struct {
// Init method will be called during deployment.
// The deploy transaction metadata is supposed to contain the administrator cert
func (t *AssetManagementChaincode) Init(stub shim.ChaincodeStubInterface) ([]byte, error) {
function, args := stub.GetFunctionAndParameters()
_, args := stub.GetFunctionAndParameters()
myLogger.Debug("Init Chaincode...")
if len(args) != 0 {
return nil, errors.New("Incorrect number of arguments. Expecting 0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type AssetManagementChaincode struct {

// Init initialization
func (t *AssetManagementChaincode) Init(stub shim.ChaincodeStubInterface) ([]byte, error) {
function, args := stub.GetFunctionAndParameters()
_, args := stub.GetFunctionAndParameters()
myLogger.Info("[AssetManagementChaincode] Init")
if len(args) != 0 {
return nil, errors.New("Incorrect number of arguments. Expecting 0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"time"

"encoding/base64"
"io/ioutil"
"os"
"path/filepath"

Expand All @@ -33,6 +32,7 @@ import (
"github.com/hyperledger/fabric/core/container"
"github.com/hyperledger/fabric/core/crypto"
"github.com/hyperledger/fabric/core/ledger"
"github.com/hyperledger/fabric/core/util"
"github.com/hyperledger/fabric/membersrvc/ca"
pb "github.com/hyperledger/fabric/protos"
"github.com/op/go-logging"
Expand Down Expand Up @@ -180,7 +180,7 @@ func deploy(admCert crypto.CertificateHandler) error {
spec := &pb.ChaincodeSpec{
Type: 1,
ChaincodeID: &pb.ChaincodeID{Name: "mycc"},
CtorMsg: &pb.ChaincodeInput{Function: "init", Args: []string{}},
CtorMsg: &pb.ChaincodeInput{Args: util.ToChaincodeArgs("init")},
Metadata: []byte("assigner"),
ConfidentialityLevel: pb.ConfidentialityLevel_PUBLIC,
}
Expand Down Expand Up @@ -224,7 +224,7 @@ func assignOwnership(assigner crypto.Client, asset string, newOwnerCert crypto.C
}

newOwner := base64.StdEncoding.EncodeToString(newOwnerCert.GetCertificate())
chaincodeInput := &pb.ChaincodeInput{Function: "assign", Args: []string{asset, newOwner}}
chaincodeInput := &pb.ChaincodeInput{Args: util.ToChaincodeArgs("assign", asset, newOwner)}

// Prepare spec and submit
spec := &pb.ChaincodeSpec{
Expand Down Expand Up @@ -270,7 +270,7 @@ func transferOwnership(owner crypto.Client, ownerCert crypto.CertificateHandler,
}

newOwner := base64.StdEncoding.EncodeToString(newOwnerCert.GetCertificate())
chaincodeInput := &pb.ChaincodeInput{Function: "transfer", Args: []string{asset, newOwner}}
chaincodeInput := &pb.ChaincodeInput{Args: util.ToChaincodeArgs("transfer", asset, newOwner)}

// Prepare spec and submit
spec := &pb.ChaincodeSpec{
Expand Down Expand Up @@ -304,7 +304,7 @@ func transferOwnership(owner crypto.Client, ownerCert crypto.CertificateHandler,
}

func whoIsTheOwner(asset string) ([]byte, error) {
chaincodeInput := &pb.ChaincodeInput{Function: "query", Args: []string{asset}}
chaincodeInput := &pb.ChaincodeInput{Args: util.ToChaincodeArgs("query", asset)}

// Prepare spec and submit
spec := &pb.ChaincodeSpec{
Expand Down Expand Up @@ -364,7 +364,6 @@ func setup() {
}

func initMembershipSrvc() {
ca.LogInit(ioutil.Discard, os.Stdout, os.Stdout, os.Stderr, os.Stdout)
ca.CacheConfiguration() // Cache configuration
aca = ca.NewACA()
eca = ca.NewECA()
Expand Down

0 comments on commit 1f5e832

Please sign in to comment.