@@ -883,35 +883,43 @@ public CallResponse callAndGetResponse(
883
883
String from , String to , String abi , String functionName , byte [] data )
884
884
throws ContractCodecException , TransactionBaseException {
885
885
Call call = this .executeCall (from , to , data );
886
+ CallResponse callResponse = this .parseCallResponseStatus (call .getCallResult ());
886
887
ABIObject decodedResult =
887
888
this .contractCodec .decodeMethodAndGetOutputAbiObject (
888
889
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 ;
890
900
}
891
901
892
902
public CallResponse callAndGetResponse (
893
903
String from , String to , ABIDefinition abiDefinition , byte [] data )
894
904
throws ContractCodecException , TransactionBaseException {
895
905
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 );
900
907
}
901
908
902
909
public CallResponse callWithSignAndGetResponse (
903
910
String from , String to , ABIDefinition abiDefinition , byte [] data )
904
911
throws ContractCodecException , TransactionBaseException {
905
912
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 );
910
915
}
911
916
912
- public CallResponse getCallResponse (Call call , ABIObject decodedResult )
913
- throws TransactionBaseException {
917
+ public CallResponse getCallResponse (Call call , ABIDefinition abiDefinition )
918
+ throws TransactionBaseException , ContractCodecException {
914
919
CallResponse callResponse = this .parseCallResponseStatus (call .getCallResult ());
920
+ ABIObject decodedResult =
921
+ contractCodec .decodeMethodAndGetOutAbiObjectByABIDefinition (
922
+ abiDefinition , call .getCallResult ().getOutput ());
915
923
Pair <List <Object >, List <ABIObject >> outputObject =
916
924
ContractCodecTools .decodeJavaObjectAndGetOutputObject (decodedResult );
917
925
callResponse .setReturnObject (outputObject .getLeft ());
0 commit comments