Re: return type of chaincode functions using EvaluateTransaction


Matthew White
 

Hello – you can return bytes if you wish;

 

What errors did you encounter?

 

Thanks Matthew

 

From: fabric@... <fabric@...> On Behalf Of Nikos Karamolegkos
Sent: 27 September 2022 11:51
To: fabric <fabric@...>
Subject: [EXTERNAL] [Hyperledger Fabric] return type of chaincode functions using EvaluateTransaction

 

As I can see this functions returns car which is type *Car after unmarshal. Given that the EvaluateTransaction returns bytes can I bypass unmarshal and return carAsBytes from QueryCar  (i. e return type ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍

ZjQcmQRYFpfptBannerStart

This Message Is From an External Sender

This message came from outside your organization.

ZjQcmQRYFpfptBannerEnd

As I can see this functions returns car which is type *Car after unmarshal. Given that the EvaluateTransaction returns bytes can I bypass unmarshal and return carAsBytes from QueryCar  (i.e return type []byte) to the client and let the client do whatever needs? (unmarshal or no).

I am asking because I have tried that and it hadn't worked.

-- 
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)

Unless otherwise stated above:

IBM United Kingdom Limited
Registered in England and Wales with number 741598
Registered office: PO Box 41, North Harbour, Portsmouth, Hants. PO6 3AU

Join fabric@lists.hyperledger.org to automatically receive all group messages.