Skip to content

Commit

Permalink
lint: make checks
Browse files Browse the repository at this point in the history
Signed-off-by: chenchanglew <[email protected]>
  • Loading branch information
chenchanglew committed Jun 12, 2024
1 parent 8fb8b84 commit 6583c84
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ecc_go/chaincode/enclave_go/skvs_stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package enclave_go

import (
"crypto/sha256"
"fmt"

"github.com/hyperledger/fabric-chaincode-go/shim"
"github.com/hyperledger/fabric-private-chaincode/internal/protos"
Expand All @@ -30,7 +31,7 @@ func (e *skvsStub) ChaincodeInvoke(stub shim.ChaincodeStubInterface, chaincodeRe

signedProposal, err := stub.GetSignedProposal()
if err != nil {
shim.Error(err.Error())
return nil, fmt.Errorf("cannot get signed proposal: %s", err.Error())
}

if err := e.verifySignedProposal(stub, chaincodeRequestMessageBytes); err != nil {
Expand Down
6 changes: 5 additions & 1 deletion ecc_go/chaincode/enclave_go/skvs_stub_Interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func (s *SkvsStubInterface) InitSKVS() error {
logger.Warningf("SKVS has default value, loading current value.")

err = json.Unmarshal(value, &s.allDataOld)
if err != nil {
logger.Errorf("SKVS Json unmarshal error: %s", err)
return err
}
err = json.Unmarshal(value, &s.allDataNew)
if err != nil {
logger.Errorf("SKVS Json unmarshal error: %s", err)
Expand All @@ -65,7 +69,7 @@ func (s *SkvsStubInterface) InitSKVS() error {
func (s *SkvsStubInterface) GetState(key string) ([]byte, error) {
logger.Warningf("Calling Get State (Start), key: %s, alldataOld: %s", key, s.allDataOld)
value, found := s.allDataOld[key]
if found != true {
if !found {
return nil, errors.New("skvs allDataOld key not found")
}
logger.Warningf("Calling Get State (End), key: %s, value: %x", key, value)
Expand Down
1 change: 1 addition & 0 deletions ecc_go/chaincode/singleKVS.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
var logger = flogging.MustGetLogger("enclave_go")

func NewSkvsChaincode(cc shim.Chaincode) *chaincode.EnclaveChaincode {
logger.Info("Creating new SKVS Chaincode")
ecc := &chaincode.EnclaveChaincode{
Enclave: enclave_go.NewSkvsStub(cc),
Validator: endorsement.NewValidator(),
Expand Down

0 comments on commit 6583c84

Please sign in to comment.