diff --git a/CHANGELOG.md b/CHANGELOG.md index a15ad6604..edc7e4bcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### BREAKING CHANGES -* +* Change organization name [#2131](https://github.com/hyperledger-web3j/web3j/pull/2131) # [4.12.2](https://github.com/hyperledger/web3j/releases/tag/v4.12.2) (2024-09-18) diff --git a/README.md b/README.md index a37fa9146..4a5fbf7bb 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Web3j is a lightweight, highly modular, reactive, type safe Java and Android library for working with Smart Contracts and integrating with clients (nodes) on the Ethereum network: -![image](https://github.com/hyperledger/web3j-docs/blob/main/docs/img/web3j_network.png) +![image](https://github.com/hyperledger-web3j/web3j-docs/blob/main/docs/img/web3j_network.png) This allows you to work with the [Ethereum](https://www.ethereum.org/) blockchain, without the additional overhead of having to write your own diff --git a/build.gradle b/build.gradle index 3a8593914..fb2dbecd2 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,7 @@ description 'Web3j base project.' 'spotless' ].each { buildScript -> download { - src "https://raw.githubusercontent.com/hyperledger/web3j-build-tools/main/gradle/$buildScript/build.gradle" + src "https://raw.githubusercontent.com/hyperledger-web3j/web3j-build-tools/main/gradle/$buildScript/build.gradle" dest "$rootDir/gradle/$buildScript/build.gradle" overwrite false quiet true diff --git a/codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapper.java b/codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapper.java index 80435c5c4..4e905e15a 100644 --- a/codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapper.java +++ b/codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapper.java @@ -120,7 +120,7 @@ public class SolidityFunctionWrapper extends Generator { + "or the " + SolidityFunctionWrapperGenerator.class.getName() + " in the \n" - + "" + + "" + "codegen module to update.\n"; private final boolean useNativeJavaTypes; @@ -422,8 +422,7 @@ private FieldSpec createEventDefinition( String name, List parameters, Map eventsCount, - AbiDefinition event - ) { + AbiDefinition event) { CodeBlock initializer = buildVariableLengthEventInitializer(name, parameters); @@ -460,8 +459,7 @@ List buildFunctionDefinitions( methodSpecs.addAll(buildFunctions(functionDefinition, useUpperCase)); } else if (functionDefinition.getType().equals(TYPE_EVENT)) { methodSpecs.addAll( - buildEventFunctions(functionDefinition, classBuilder, eventsCount) - ); + buildEventFunctions(functionDefinition, classBuilder, eventsCount)); } } return methodSpecs; @@ -1955,8 +1953,7 @@ private static String getEventFromLogFunctionName(String functionName) { List buildEventFunctions( AbiDefinition functionDefinition, TypeSpec.Builder classBuilder, - Map eventsCount - ) + Map eventsCount) throws ClassNotFoundException { List inputs = functionDefinition.getInputs(); @@ -1985,9 +1982,8 @@ List buildEventFunctions( String functionName = functionDefinition.getName(); - classBuilder.addField(createEventDefinition( - functionName, parameters, eventsCount, functionDefinition - )); + classBuilder.addField( + createEventDefinition(functionName, parameters, eventsCount, functionDefinition)); functionName = functionDefinition.getName(); diff --git a/codegen/src/test/java/org/web3j/codegen/SolidityFunctionWrapperTest.java b/codegen/src/test/java/org/web3j/codegen/SolidityFunctionWrapperTest.java index 3624bd5b4..b907ab2d7 100644 --- a/codegen/src/test/java/org/web3j/codegen/SolidityFunctionWrapperTest.java +++ b/codegen/src/test/java/org/web3j/codegen/SolidityFunctionWrapperTest.java @@ -969,105 +969,105 @@ public void testBuildFunctionDuplicatedEventNames() throws Exception { Arrays.asList(firstEventDefinition, secondEventDefinition))); String expected = - "class testClass {\n" + - " public static final org.web3j.abi.datatypes.Event EVENTNAME1_EVENT = new org.web3j.abi.datatypes.Event(\"eventName\", \n" + - " java.util.Arrays.>asList(new org.web3j.abi.TypeReference() {}, new org.web3j.abi.TypeReference() {}));\n" + - " ;\n" + - "\n" + - " public static final org.web3j.abi.datatypes.Event EVENTNAME_EVENT = new org.web3j.abi.datatypes.Event(\"eventName\", \n" + - " java.util.Arrays.>asList(new org.web3j.abi.TypeReference() {}, new org.web3j.abi.TypeReference() {}, new org.web3j.abi.TypeReference() {}));\n" + - " ;\n" + - "\n" + - " public static java.util.List getEventName1Events(\n" + - " org.web3j.protocol.core.methods.response.TransactionReceipt transactionReceipt) {\n" + - " java.util.List valueList = staticExtractEventParametersWithLog(EVENTNAME1_EVENT, transactionReceipt);\n" + - " java.util.ArrayList responses = new java.util.ArrayList(valueList.size());\n" + - " for (org.web3j.tx.Contract.EventValuesWithLog eventValues : valueList) {\n" + - " EventName1EventResponse typedResponse = new EventName1EventResponse();\n" + - " typedResponse.log = eventValues.getLog();\n" + - " typedResponse.action = (java.lang.String) eventValues.getNonIndexedValues().get(0).getValue();\n" + - " typedResponse.pauseState = (java.lang.Boolean) eventValues.getNonIndexedValues().get(1).getValue();\n" + - " responses.add(typedResponse);\n" + - " }\n" + - " return responses;\n" + - " }\n" + - "\n" + - " public static EventName1EventResponse getEventName1EventFromLog(\n" + - " org.web3j.protocol.core.methods.response.Log log) {\n" + - " org.web3j.tx.Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(EVENTNAME1_EVENT, log);\n" + - " EventName1EventResponse typedResponse = new EventName1EventResponse();\n" + - " typedResponse.log = log;\n" + - " typedResponse.action = (java.lang.String) eventValues.getNonIndexedValues().get(0).getValue();\n" + - " typedResponse.pauseState = (java.lang.Boolean) eventValues.getNonIndexedValues().get(1).getValue();\n" + - " return typedResponse;\n" + - " }\n" + - "\n" + - " public io.reactivex.Flowable eventName1EventFlowable(\n" + - " org.web3j.protocol.core.methods.request.EthFilter filter) {\n" + - " return web3j.ethLogFlowable(filter).map(log -> getEventName1EventFromLog(log));\n" + - " }\n" + - "\n" + - " public io.reactivex.Flowable eventName1EventFlowable(\n" + - " org.web3j.protocol.core.DefaultBlockParameter startBlock,\n" + - " org.web3j.protocol.core.DefaultBlockParameter endBlock) {\n" + - " org.web3j.protocol.core.methods.request.EthFilter filter = new org.web3j.protocol.core.methods.request.EthFilter(startBlock, endBlock, getContractAddress());\n" + - " filter.addSingleTopic(org.web3j.abi.EventEncoder.encode(EVENTNAME1_EVENT));\n" + - " return eventName1EventFlowable(filter);\n" + - " }\n" + - "\n" + - " public static java.util.List getEventNameEvents(\n" + - " org.web3j.protocol.core.methods.response.TransactionReceipt transactionReceipt) {\n" + - " java.util.List valueList = staticExtractEventParametersWithLog(EVENTNAME_EVENT, transactionReceipt);\n" + - " java.util.ArrayList responses = new java.util.ArrayList(valueList.size());\n" + - " for (org.web3j.tx.Contract.EventValuesWithLog eventValues : valueList) {\n" + - " EventNameEventResponse typedResponse = new EventNameEventResponse();\n" + - " typedResponse.log = eventValues.getLog();\n" + - " typedResponse.cToken = (java.lang.String) eventValues.getNonIndexedValues().get(0).getValue();\n" + - " typedResponse.action = (java.lang.String) eventValues.getNonIndexedValues().get(1).getValue();\n" + - " typedResponse.pauseState = (java.lang.Boolean) eventValues.getNonIndexedValues().get(2).getValue();\n" + - " responses.add(typedResponse);\n" + - " }\n" + - " return responses;\n" + - " }\n" + - "\n" + - " public static EventNameEventResponse getEventNameEventFromLog(\n" + - " org.web3j.protocol.core.methods.response.Log log) {\n" + - " org.web3j.tx.Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(EVENTNAME_EVENT, log);\n" + - " EventNameEventResponse typedResponse = new EventNameEventResponse();\n" + - " typedResponse.log = log;\n" + - " typedResponse.cToken = (java.lang.String) eventValues.getNonIndexedValues().get(0).getValue();\n" + - " typedResponse.action = (java.lang.String) eventValues.getNonIndexedValues().get(1).getValue();\n" + - " typedResponse.pauseState = (java.lang.Boolean) eventValues.getNonIndexedValues().get(2).getValue();\n" + - " return typedResponse;\n" + - " }\n" + - "\n" + - " public io.reactivex.Flowable eventNameEventFlowable(\n" + - " org.web3j.protocol.core.methods.request.EthFilter filter) {\n" + - " return web3j.ethLogFlowable(filter).map(log -> getEventNameEventFromLog(log));\n" + - " }\n" + - "\n" + - " public io.reactivex.Flowable eventNameEventFlowable(\n" + - " org.web3j.protocol.core.DefaultBlockParameter startBlock,\n" + - " org.web3j.protocol.core.DefaultBlockParameter endBlock) {\n" + - " org.web3j.protocol.core.methods.request.EthFilter filter = new org.web3j.protocol.core.methods.request.EthFilter(startBlock, endBlock, getContractAddress());\n" + - " filter.addSingleTopic(org.web3j.abi.EventEncoder.encode(EVENTNAME_EVENT));\n" + - " return eventNameEventFlowable(filter);\n" + - " }\n" + - "\n" + - " public static class EventName1EventResponse extends org.web3j.protocol.core.methods.response.BaseEventResponse {\n" + - " public java.lang.String action;\n" + - "\n" + - " public java.lang.Boolean pauseState;\n" + - " }\n" + - "\n" + - " public static class EventNameEventResponse extends org.web3j.protocol.core.methods.response.BaseEventResponse {\n" + - " public java.lang.String cToken;\n" + - "\n" + - " public java.lang.String action;\n" + - "\n" + - " public java.lang.Boolean pauseState;\n" + - " }\n" + - "}\n"; + "class testClass {\n" + + " public static final org.web3j.abi.datatypes.Event EVENTNAME1_EVENT = new org.web3j.abi.datatypes.Event(\"eventName\", \n" + + " java.util.Arrays.>asList(new org.web3j.abi.TypeReference() {}, new org.web3j.abi.TypeReference() {}));\n" + + " ;\n" + + "\n" + + " public static final org.web3j.abi.datatypes.Event EVENTNAME_EVENT = new org.web3j.abi.datatypes.Event(\"eventName\", \n" + + " java.util.Arrays.>asList(new org.web3j.abi.TypeReference() {}, new org.web3j.abi.TypeReference() {}, new org.web3j.abi.TypeReference() {}));\n" + + " ;\n" + + "\n" + + " public static java.util.List getEventName1Events(\n" + + " org.web3j.protocol.core.methods.response.TransactionReceipt transactionReceipt) {\n" + + " java.util.List valueList = staticExtractEventParametersWithLog(EVENTNAME1_EVENT, transactionReceipt);\n" + + " java.util.ArrayList responses = new java.util.ArrayList(valueList.size());\n" + + " for (org.web3j.tx.Contract.EventValuesWithLog eventValues : valueList) {\n" + + " EventName1EventResponse typedResponse = new EventName1EventResponse();\n" + + " typedResponse.log = eventValues.getLog();\n" + + " typedResponse.action = (java.lang.String) eventValues.getNonIndexedValues().get(0).getValue();\n" + + " typedResponse.pauseState = (java.lang.Boolean) eventValues.getNonIndexedValues().get(1).getValue();\n" + + " responses.add(typedResponse);\n" + + " }\n" + + " return responses;\n" + + " }\n" + + "\n" + + " public static EventName1EventResponse getEventName1EventFromLog(\n" + + " org.web3j.protocol.core.methods.response.Log log) {\n" + + " org.web3j.tx.Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(EVENTNAME1_EVENT, log);\n" + + " EventName1EventResponse typedResponse = new EventName1EventResponse();\n" + + " typedResponse.log = log;\n" + + " typedResponse.action = (java.lang.String) eventValues.getNonIndexedValues().get(0).getValue();\n" + + " typedResponse.pauseState = (java.lang.Boolean) eventValues.getNonIndexedValues().get(1).getValue();\n" + + " return typedResponse;\n" + + " }\n" + + "\n" + + " public io.reactivex.Flowable eventName1EventFlowable(\n" + + " org.web3j.protocol.core.methods.request.EthFilter filter) {\n" + + " return web3j.ethLogFlowable(filter).map(log -> getEventName1EventFromLog(log));\n" + + " }\n" + + "\n" + + " public io.reactivex.Flowable eventName1EventFlowable(\n" + + " org.web3j.protocol.core.DefaultBlockParameter startBlock,\n" + + " org.web3j.protocol.core.DefaultBlockParameter endBlock) {\n" + + " org.web3j.protocol.core.methods.request.EthFilter filter = new org.web3j.protocol.core.methods.request.EthFilter(startBlock, endBlock, getContractAddress());\n" + + " filter.addSingleTopic(org.web3j.abi.EventEncoder.encode(EVENTNAME1_EVENT));\n" + + " return eventName1EventFlowable(filter);\n" + + " }\n" + + "\n" + + " public static java.util.List getEventNameEvents(\n" + + " org.web3j.protocol.core.methods.response.TransactionReceipt transactionReceipt) {\n" + + " java.util.List valueList = staticExtractEventParametersWithLog(EVENTNAME_EVENT, transactionReceipt);\n" + + " java.util.ArrayList responses = new java.util.ArrayList(valueList.size());\n" + + " for (org.web3j.tx.Contract.EventValuesWithLog eventValues : valueList) {\n" + + " EventNameEventResponse typedResponse = new EventNameEventResponse();\n" + + " typedResponse.log = eventValues.getLog();\n" + + " typedResponse.cToken = (java.lang.String) eventValues.getNonIndexedValues().get(0).getValue();\n" + + " typedResponse.action = (java.lang.String) eventValues.getNonIndexedValues().get(1).getValue();\n" + + " typedResponse.pauseState = (java.lang.Boolean) eventValues.getNonIndexedValues().get(2).getValue();\n" + + " responses.add(typedResponse);\n" + + " }\n" + + " return responses;\n" + + " }\n" + + "\n" + + " public static EventNameEventResponse getEventNameEventFromLog(\n" + + " org.web3j.protocol.core.methods.response.Log log) {\n" + + " org.web3j.tx.Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(EVENTNAME_EVENT, log);\n" + + " EventNameEventResponse typedResponse = new EventNameEventResponse();\n" + + " typedResponse.log = log;\n" + + " typedResponse.cToken = (java.lang.String) eventValues.getNonIndexedValues().get(0).getValue();\n" + + " typedResponse.action = (java.lang.String) eventValues.getNonIndexedValues().get(1).getValue();\n" + + " typedResponse.pauseState = (java.lang.Boolean) eventValues.getNonIndexedValues().get(2).getValue();\n" + + " return typedResponse;\n" + + " }\n" + + "\n" + + " public io.reactivex.Flowable eventNameEventFlowable(\n" + + " org.web3j.protocol.core.methods.request.EthFilter filter) {\n" + + " return web3j.ethLogFlowable(filter).map(log -> getEventNameEventFromLog(log));\n" + + " }\n" + + "\n" + + " public io.reactivex.Flowable eventNameEventFlowable(\n" + + " org.web3j.protocol.core.DefaultBlockParameter startBlock,\n" + + " org.web3j.protocol.core.DefaultBlockParameter endBlock) {\n" + + " org.web3j.protocol.core.methods.request.EthFilter filter = new org.web3j.protocol.core.methods.request.EthFilter(startBlock, endBlock, getContractAddress());\n" + + " filter.addSingleTopic(org.web3j.abi.EventEncoder.encode(EVENTNAME_EVENT));\n" + + " return eventNameEventFlowable(filter);\n" + + " }\n" + + "\n" + + " public static class EventName1EventResponse extends org.web3j.protocol.core.methods.response.BaseEventResponse {\n" + + " public java.lang.String action;\n" + + "\n" + + " public java.lang.Boolean pauseState;\n" + + " }\n" + + "\n" + + " public static class EventNameEventResponse extends org.web3j.protocol.core.methods.response.BaseEventResponse {\n" + + " public java.lang.String cToken;\n" + + "\n" + + " public java.lang.String action;\n" + + "\n" + + " public java.lang.Boolean pauseState;\n" + + " }\n" + + "}\n"; assertEquals(builder.build().toString(), (expected)); } diff --git a/codegen/src/test/resources/solidity/abifuncs/build/java/AbiFuncs.java b/codegen/src/test/resources/solidity/abifuncs/build/java/AbiFuncs.java index 91f06ea71..a53ce8016 100644 --- a/codegen/src/test/resources/solidity/abifuncs/build/java/AbiFuncs.java +++ b/codegen/src/test/resources/solidity/abifuncs/build/java/AbiFuncs.java @@ -19,7 +19,7 @@ *

Do not modify! *

Please use the web3j command line tools, * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the - * codegen module to update. + * codegen module to update. * *

Generated with web3j version none. */ diff --git a/codegen/src/test/resources/solidity/arrayofstructandstruct/build/java/ArrayOfStructAndStruct.java b/codegen/src/test/resources/solidity/arrayofstructandstruct/build/java/ArrayOfStructAndStruct.java index b83887fdf..846de8c9d 100644 --- a/codegen/src/test/resources/solidity/arrayofstructandstruct/build/java/ArrayOfStructAndStruct.java +++ b/codegen/src/test/resources/solidity/arrayofstructandstruct/build/java/ArrayOfStructAndStruct.java @@ -23,7 +23,7 @@ *

Do not modify! *

Please use the web3j command line tools, * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the - * codegen module to update. + * codegen module to update. * *

Generated with web3j version none. */ diff --git a/codegen/src/test/resources/solidity/arrayofstructclassgeneration/build/java/ArrayOfStructClassGeneration.java b/codegen/src/test/resources/solidity/arrayofstructclassgeneration/build/java/ArrayOfStructClassGeneration.java index 09ee07c65..a8fa90921 100644 --- a/codegen/src/test/resources/solidity/arrayofstructclassgeneration/build/java/ArrayOfStructClassGeneration.java +++ b/codegen/src/test/resources/solidity/arrayofstructclassgeneration/build/java/ArrayOfStructClassGeneration.java @@ -23,7 +23,7 @@ *

Do not modify! *

Please use the web3j command line tools, * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the - * codegen module to update. + * codegen module to update. * *

Generated with web3j version none. */ diff --git a/codegen/src/test/resources/solidity/arraysinstruct/build/java/ArraysInStruct.java b/codegen/src/test/resources/solidity/arraysinstruct/build/java/ArraysInStruct.java index 93c6c8860..a34f67dff 100644 --- a/codegen/src/test/resources/solidity/arraysinstruct/build/java/ArraysInStruct.java +++ b/codegen/src/test/resources/solidity/arraysinstruct/build/java/ArraysInStruct.java @@ -33,7 +33,7 @@ *

Do not modify! *

Please use the web3j command line tools, * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the - * codegen module to update. + * codegen module to update. * *

Generated with web3j version none. */ diff --git a/codegen/src/test/resources/solidity/eventparameters/build/java/EventParameters.java b/codegen/src/test/resources/solidity/eventparameters/build/java/EventParameters.java index d96d977d8..6b19e6a32 100644 --- a/codegen/src/test/resources/solidity/eventparameters/build/java/EventParameters.java +++ b/codegen/src/test/resources/solidity/eventparameters/build/java/EventParameters.java @@ -31,7 +31,7 @@ *

Do not modify! *

Please use the web3j command line tools, * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the - * codegen module to update. + * codegen module to update. * *

Generated with web3j version none. */ diff --git a/codegen/src/test/resources/solidity/metacoin/build/java/MetaCoin.java b/codegen/src/test/resources/solidity/metacoin/build/java/MetaCoin.java index ec5e3dd75..df3b7d243 100644 --- a/codegen/src/test/resources/solidity/metacoin/build/java/MetaCoin.java +++ b/codegen/src/test/resources/solidity/metacoin/build/java/MetaCoin.java @@ -31,7 +31,7 @@ *

Do not modify! *

Please use the web3j command line tools, * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the - * codegen module to update. + * codegen module to update. * *

Generated with web3j version none. */ diff --git a/codegen/src/test/resources/solidity/onlyinarraystruct/build/java/OnlyInArrayStruct.java b/codegen/src/test/resources/solidity/onlyinarraystruct/build/java/OnlyInArrayStruct.java index 530bd9006..04b8e071e 100644 --- a/codegen/src/test/resources/solidity/onlyinarraystruct/build/java/OnlyInArrayStruct.java +++ b/codegen/src/test/resources/solidity/onlyinarraystruct/build/java/OnlyInArrayStruct.java @@ -24,7 +24,7 @@ *

Do not modify! *

Please use the web3j command line tools, * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the - * codegen module to update. + * codegen module to update. * *

Generated with web3j version none. */ diff --git a/codegen/src/test/resources/solidity/sameinnerstructname/build/java/SameInnerStructName.java b/codegen/src/test/resources/solidity/sameinnerstructname/build/java/SameInnerStructName.java index 7db11907a..777e2fbc4 100644 --- a/codegen/src/test/resources/solidity/sameinnerstructname/build/java/SameInnerStructName.java +++ b/codegen/src/test/resources/solidity/sameinnerstructname/build/java/SameInnerStructName.java @@ -23,7 +23,7 @@ *

Do not modify! *

Please use the web3j command line tools, * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the - * codegen module to update. + * codegen module to update. * *

Generated with web3j version none. */ diff --git a/codegen/src/test/resources/solidity/staticarrayofstructsinstruct/build/java/StaticArrayOfStructsInStruct.java b/codegen/src/test/resources/solidity/staticarrayofstructsinstruct/build/java/StaticArrayOfStructsInStruct.java index d26e911d9..0b5c6155c 100644 --- a/codegen/src/test/resources/solidity/staticarrayofstructsinstruct/build/java/StaticArrayOfStructsInStruct.java +++ b/codegen/src/test/resources/solidity/staticarrayofstructsinstruct/build/java/StaticArrayOfStructsInStruct.java @@ -27,7 +27,7 @@ *

Do not modify! *

Please use the web3j command line tools, * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the - * codegen module to update. + * codegen module to update. * *

Generated with web3j version none. */ diff --git a/core/src/main/java/org/web3j/protocol/admin/methods/response/TxPoolContent.java b/core/src/main/java/org/web3j/protocol/admin/methods/response/TxPoolContent.java index 6a27b41c7..6c1d3e2f0 100644 --- a/core/src/main/java/org/web3j/protocol/admin/methods/response/TxPoolContent.java +++ b/core/src/main/java/org/web3j/protocol/admin/methods/response/TxPoolContent.java @@ -19,7 +19,6 @@ import java.util.List; import java.util.Map; import java.util.function.Function; -import java.util.stream.Collectors; import org.web3j.protocol.core.Response; import org.web3j.protocol.core.methods.response.Transaction; @@ -49,17 +48,11 @@ public Map> getQueued() { } public List getPendingTransactions() { - return pending.values().stream() - .map(Map::values) - .flatMap(Collection::stream) - .toList(); + return pending.values().stream().map(Map::values).flatMap(Collection::stream).toList(); } public List getQueuedTransactions() { - return queued.values().stream() - .map(Map::values) - .flatMap(Collection::stream) - .toList(); + return queued.values().stream().map(Map::values).flatMap(Collection::stream).toList(); } private static Map immutableCopy(Map map, Function valueMapper) { diff --git a/core/src/main/java/org/web3j/protocol/core/methods/response/EthFeeHistory.java b/core/src/main/java/org/web3j/protocol/core/methods/response/EthFeeHistory.java index 0b7bbc687..823b7ecd0 100644 --- a/core/src/main/java/org/web3j/protocol/core/methods/response/EthFeeHistory.java +++ b/core/src/main/java/org/web3j/protocol/core/methods/response/EthFeeHistory.java @@ -15,7 +15,6 @@ import java.io.IOException; import java.math.BigInteger; import java.util.List; -import java.util.stream.Collectors; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; @@ -76,9 +75,7 @@ public List> getReward() { return reward.stream() .map( rewardPercentile -> - rewardPercentile.stream() - .map(Numeric::decodeQuantity) - .toList()) + rewardPercentile.stream().map(Numeric::decodeQuantity).toList()) .toList(); } diff --git a/core/src/main/java/org/web3j/protocol/deserializer/KeepAsJsonDeserialzier.java b/core/src/main/java/org/web3j/protocol/deserializer/KeepAsJsonDeserialzier.java index a83fcb23d..45885be10 100644 --- a/core/src/main/java/org/web3j/protocol/deserializer/KeepAsJsonDeserialzier.java +++ b/core/src/main/java/org/web3j/protocol/deserializer/KeepAsJsonDeserialzier.java @@ -15,7 +15,6 @@ import java.io.IOException; import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.TreeNode; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; @@ -23,8 +22,7 @@ public class KeepAsJsonDeserialzier extends JsonDeserializer { @Override - public String deserialize(JsonParser jp, DeserializationContext ctxt) - throws IOException { + public String deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { TreeNode tree = jp.getCodec().readTree(jp); return tree.toString(); diff --git a/core/src/main/java/org/web3j/protocol/websocket/WebSocketService.java b/core/src/main/java/org/web3j/protocol/websocket/WebSocketService.java index 3df455f31..afeb5989a 100644 --- a/core/src/main/java/org/web3j/protocol/websocket/WebSocketService.java +++ b/core/src/main/java/org/web3j/protocol/websocket/WebSocketService.java @@ -374,8 +374,7 @@ private void sendReplyToListener(WebSocketRequest request, Object reply) { request.getOnReply().complete(reply); } - private void sendExceptionToListener( - String replyStr, WebSocketRequest request, Exception e) { + private void sendExceptionToListener(String replyStr, WebSocketRequest request, Exception e) { request.getOnReply() .completeExceptionally( new IOException( diff --git a/core/src/main/java/org/web3j/tx/response/EmptyTransactionReceipt.java b/core/src/main/java/org/web3j/tx/response/EmptyTransactionReceipt.java index 3f4a24088..6f919b300 100644 --- a/core/src/main/java/org/web3j/tx/response/EmptyTransactionReceipt.java +++ b/core/src/main/java/org/web3j/tx/response/EmptyTransactionReceipt.java @@ -28,7 +28,7 @@ public EmptyTransactionReceipt(String transactionHash) { super(); this.setTransactionHash(transactionHash); } - + private UnsupportedOperationException unsupportedOperation() { return new UnsupportedOperationException( "Empty transaction receipt, only transaction hash is available"); diff --git a/core/src/test/java/org/web3j/protocol/BatchTester.java b/core/src/test/java/org/web3j/protocol/BatchTester.java index c3402d415..64b7f38fb 100644 --- a/core/src/test/java/org/web3j/protocol/BatchTester.java +++ b/core/src/test/java/org/web3j/protocol/BatchTester.java @@ -104,12 +104,12 @@ public okhttp3.Response intercept(Chain chain) throws IOException { } return new okhttp3.Response.Builder() - .request(chain.request()) - .protocol(Protocol.HTTP_2) - .code(200) - .body(ResponseBody.create(jsonResponse, JSON_MEDIA_TYPE)) - .message("") - .build(); + .request(chain.request()) + .protocol(Protocol.HTTP_2) + .code(200) + .body(ResponseBody.create(jsonResponse, JSON_MEDIA_TYPE)) + .message("") + .build(); } public void setJsonResponse(String jsonResponse) { diff --git a/core/src/test/java/org/web3j/protocol/RequestTester.java b/core/src/test/java/org/web3j/protocol/RequestTester.java index c62e9b1ef..8c3f1b921 100644 --- a/core/src/test/java/org/web3j/protocol/RequestTester.java +++ b/core/src/test/java/org/web3j/protocol/RequestTester.java @@ -71,16 +71,16 @@ public okhttp3.Response intercept(Chain chain) throws IOException { Request request = chain.request(); this.requestBody = request.body(); return new okhttp3.Response.Builder() - .request(chain.request()) - .protocol(Protocol.HTTP_2) - .code(200) - .body( - ResponseBody.create( - "{\"jsonrpc\":\"2.0\",\"method\":\"\"," - + "\"params\":[],\"id\":1}", - JSON_MEDIA_TYPE)) - .message("") - .build(); + .request(chain.request()) + .protocol(Protocol.HTTP_2) + .code(200) + .body( + ResponseBody.create( + "{\"jsonrpc\":\"2.0\",\"method\":\"\"," + + "\"params\":[],\"id\":1}", + JSON_MEDIA_TYPE)) + .message("") + .build(); } public RequestBody getRequestBody() { diff --git a/core/src/test/java/org/web3j/protocol/ResponseTester.java b/core/src/test/java/org/web3j/protocol/ResponseTester.java index bde0546e1..3a587fcd4 100644 --- a/core/src/test/java/org/web3j/protocol/ResponseTester.java +++ b/core/src/test/java/org/web3j/protocol/ResponseTester.java @@ -75,12 +75,12 @@ public okhttp3.Response intercept(Chain chain) throws IOException { } return new okhttp3.Response.Builder() - .body(ResponseBody.create(jsonResponse, JSON_MEDIA_TYPE)) - .request(chain.request()) - .protocol(Protocol.HTTP_2) - .code(200) - .message("") - .build(); + .body(ResponseBody.create(jsonResponse, JSON_MEDIA_TYPE)) + .request(chain.request()) + .protocol(Protocol.HTTP_2) + .code(200) + .message("") + .build(); } } } diff --git a/core/src/test/java/org/web3j/protocol/core/BatchTest.java b/core/src/test/java/org/web3j/protocol/core/BatchTest.java index a82be5906..3d724e1a3 100644 --- a/core/src/test/java/org/web3j/protocol/core/BatchTest.java +++ b/core/src/test/java/org/web3j/protocol/core/BatchTest.java @@ -86,8 +86,8 @@ void testBatchResponse() throws Exception { assertTrue(response.getResponses().get(1) instanceof Web3Sha3); Web3Sha3 web3Sha3 = (Web3Sha3) response.getResponses().get(1); assertEquals( - "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad", - web3Sha3.getResult()); + "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad", + web3Sha3.getResult()); assertTrue(response.getResponses().get(2) instanceof NetVersion); NetVersion netVersion = (NetVersion) response.getResponses().get(2); diff --git a/core/src/test/java/org/web3j/protocol/core/filters/FilterTester.java b/core/src/test/java/org/web3j/protocol/core/filters/FilterTester.java index 957da3177..c36138589 100644 --- a/core/src/test/java/org/web3j/protocol/core/filters/FilterTester.java +++ b/core/src/test/java/org/web3j/protocol/core/filters/FilterTester.java @@ -20,7 +20,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; import com.fasterxml.jackson.databind.ObjectMapper; import io.reactivex.Flowable; diff --git a/core/src/test/java/org/web3j/tx/FastRawTransactionManagerTest.java b/core/src/test/java/org/web3j/tx/FastRawTransactionManagerTest.java index 210e79d1a..33844e82d 100644 --- a/core/src/test/java/org/web3j/tx/FastRawTransactionManagerTest.java +++ b/core/src/test/java/org/web3j/tx/FastRawTransactionManagerTest.java @@ -12,7 +12,6 @@ */ package org.web3j.tx; -import java.io.IOException; import java.math.BigInteger; import org.junit.jupiter.api.BeforeEach;