@@ -883,35 +883,43 @@ public CallResponse callAndGetResponse(
883883 String from , String to , String abi , String functionName , byte [] data )
884884 throws ContractCodecException , TransactionBaseException {
885885 Call call = this .executeCall (from , to , data );
886+ CallResponse callResponse = this .parseCallResponseStatus (call .getCallResult ());
886887 ABIObject decodedResult =
887888 this .contractCodec .decodeMethodAndGetOutputAbiObject (
888889 abi , functionName , call .getCallResult ().getOutput ());
889- return getCallResponse (call , decodedResult );
890+ Pair <List <Object >, List <ABIObject >> outputObject =
891+ ContractCodecTools .decodeJavaObjectAndGetOutputObject (decodedResult );
892+ callResponse .setReturnObject (outputObject .getLeft ());
893+ callResponse .setReturnABIObject (outputObject .getRight ());
894+ try {
895+ callResponse .setResults (ContractCodecTools .getABIObjectTypeListResult (decodedResult ));
896+ } catch (Exception ignored ) {
897+ log .error ("decode results failed, ignored. value: {}" , decodedResult );
898+ }
899+ return callResponse ;
890900 }
891901
892902 public CallResponse callAndGetResponse (
893903 String from , String to , ABIDefinition abiDefinition , byte [] data )
894904 throws ContractCodecException , TransactionBaseException {
895905 Call call = this .executeCall (from , to , data );
896- ABIObject abiObject =
897- contractCodec .decodeMethodAndGetOutAbiObjectByABIDefinition (
898- abiDefinition , call .getCallResult ().getOutput ());
899- return getCallResponse (call , abiObject );
906+ return getCallResponse (call , abiDefinition );
900907 }
901908
902909 public CallResponse callWithSignAndGetResponse (
903910 String from , String to , ABIDefinition abiDefinition , byte [] data )
904911 throws ContractCodecException , TransactionBaseException {
905912 Call call = this .executeCallWithSign (from , to , data );
906- ABIObject abiObject =
907- contractCodec .decodeMethodAndGetOutAbiObjectByABIDefinition (
908- abiDefinition , call .getCallResult ().getOutput ());
909- return getCallResponse (call , abiObject );
913+
914+ return getCallResponse (call , abiDefinition );
910915 }
911916
912- public CallResponse getCallResponse (Call call , ABIObject decodedResult )
913- throws TransactionBaseException {
917+ public CallResponse getCallResponse (Call call , ABIDefinition abiDefinition )
918+ throws TransactionBaseException , ContractCodecException {
914919 CallResponse callResponse = this .parseCallResponseStatus (call .getCallResult ());
920+ ABIObject decodedResult =
921+ contractCodec .decodeMethodAndGetOutAbiObjectByABIDefinition (
922+ abiDefinition , call .getCallResult ().getOutput ());
915923 Pair <List <Object >, List <ABIObject >> outputObject =
916924 ContractCodecTools .decodeJavaObjectAndGetOutputObject (decodedResult );
917925 callResponse .setReturnObject (outputObject .getLeft ());
0 commit comments