From 162beb7c1247c7ac7b01ce476ecce14a4867a35a Mon Sep 17 00:00:00 2001 From: Frank Li Date: Tue, 15 Feb 2022 16:12:44 +1000 Subject: [PATCH] add trace call many --- .../web3j/protocol/parity/JsonRpc2_0Parity.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/parity/src/main/java/org/web3j/protocol/parity/JsonRpc2_0Parity.java b/parity/src/main/java/org/web3j/protocol/parity/JsonRpc2_0Parity.java index 570874526..d5f8b6cc3 100644 --- a/parity/src/main/java/org/web3j/protocol/parity/JsonRpc2_0Parity.java +++ b/parity/src/main/java/org/web3j/protocol/parity/JsonRpc2_0Parity.java @@ -15,6 +15,7 @@ import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; @@ -324,6 +325,21 @@ public Request traceCall( ParityFullTraceResponse.class); } + public Request traceCallMany( + Collection transactions, List traces, DefaultBlockParameter blockParameter) { + List transactionPayload = + transactions + .stream() + .map(transaction -> Arrays.asList(transaction, traces)) + .collect(Collectors.toList()); + + return new Request<>( + "trace_callMany", + Arrays.asList(transactionPayload, blockParameter), + web3jService, + ParityFullTraceResponse.class); + } + @Override public Request traceRawTransaction( String data, List traceTypes) {