Skip to content

Commit 57a9ff3

Browse files
committed
fix: return Error for not implemented functions
Signed-off-by: osamamagdy <osamamagdy174@gmail.com>
1 parent 171ea9c commit 57a9ff3

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

ecc_go/chaincode/enclave_go/shim.go

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/hyperledger/fabric-chaincode-go/shim"
1414
"github.com/hyperledger/fabric-private-chaincode/internal/utils"
1515
pb "github.com/hyperledger/fabric-protos-go/peer"
16-
"github.com/pkg/errors"
1716
timestamp "google.golang.org/protobuf/types/known/timestamppb"
1817
)
1918

@@ -180,11 +179,7 @@ func (f *FpcStubInterface) SplitCompositeKey(compositeKey string) (string, []str
180179
}
181180

182181
func (f *FpcStubInterface) GetQueryResult(query string) (shim.StateQueryIteratorInterface, error) {
183-
it, err := f.stub.GetQueryResult(query)
184-
if err != nil {
185-
return it, errors.Wrap(err, "stub.GetQueryResult call error")
186-
}
187-
return it, nil
182+
return nil, fmt.Errorf("function not yet supported")
188183
}
189184

190185
func (f *FpcStubInterface) GetQueryResultWithPagination(query string, pageSize int32, bookmark string) (shim.StateQueryIteratorInterface, *pb.QueryResponseMetadata, error) {
@@ -240,7 +235,7 @@ func (f *FpcStubInterface) GetCreator() ([]byte, error) {
240235
}
241236

242237
func (f *FpcStubInterface) GetTransient() (map[string][]byte, error) {
243-
return nil, nil
238+
return nil, fmt.Errorf("function not yet supported")
244239
}
245240

246241
func (f *FpcStubInterface) GetBinding() ([]byte, error) {
@@ -273,10 +268,5 @@ func (s *FpcStubInterface) GetTxTimestamp() (*timestamp.Timestamp, error) {
273268
}
274269

275270
func (f *FpcStubInterface) SetEvent(name string, payload []byte) error {
276-
if name == "" {
277-
return errors.New("event name can not be empty string")
278-
}
279-
fmt.Println("Trying to set event name: ", name, "\n with payload: ", payload)
280-
fmt.Println("NO event is bieng set as function is not implemented yet")
281-
return nil
271+
return fmt.Errorf("function not yet supported")
282272
}

0 commit comments

Comments
 (0)