| | |
| | | import okhttp3.Response; |
| | | import org.springframework.data.repository.query.ParameterOutOfBoundsException; |
| | | import org.springframework.util.Base64Utils; |
| | | import org.web3j.abi.FunctionReturnDecoder; |
| | | import org.web3j.abi.TypeReference; |
| | | import org.web3j.abi.datatypes.Address; |
| | | import org.web3j.abi.datatypes.Type; |
| | | import org.web3j.abi.datatypes.generated.Uint256; |
| | | import org.web3j.crypto.Credentials; |
| | | import org.web3j.protocol.Web3j; |
| | | import org.web3j.protocol.core.DefaultBlockParameter; |
| | |
| | | import java.net.URISyntaxException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.rmi.activation.UnknownObjectException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | assert chain != null; |
| | | EthFilter filter = getFilter(startBlock, null, chain.getContractAddress()); |
| | | web3j.ethLogFlowable(filter).subscribe(log -> { |
| | | // List<TypeReference<Type>> arr = new ArrayList<>(); |
| | | // |
| | | // List<TypeReference<Type>> indexedParameters = event.getIndexedParameters(); |
| | | // |
| | | // for(int i = 0; i < indexedParameters.size(); ++i) { |
| | | // Type value = FunctionReturnDecoder.decodeIndexedValue((String)topics.get(i + 1), (TypeReference)indexedParameters.get(i)); |
| | | // indexedValues.add(value); |
| | | // } |
| | | |
| | | List outputParameters1 = new ArrayList<TypeReference<Type>>(); |
| | | outputParameters1.add(new TypeReference<Uint256>() {}); |
| | | |
| | | List outputParameters = new ArrayList<TypeReference<Type>>(); |
| | | outputParameters.add(new TypeReference<Address>() {}); |
| | | List decode = FunctionReturnDecoder.decode(log.getTopics().get(0), outputParameters); |
| | | List decode1 = FunctionReturnDecoder.decode(log.getTopics().get(1), outputParameters); |
| | | List decode2 = FunctionReturnDecoder.decode(log.getTopics().get(2), outputParameters); |
| | | List decode3 = FunctionReturnDecoder.decode(log.getData(), outputParameters1); |
| | | System.out.println(111); |
| | | }); |
| | | } catch (Exception e) { |