From 380737e6d7d314566cec767cfe5952dfce775271 Mon Sep 17 00:00:00 2001 From: dalaocu Date: Fri, 17 Jul 2020 15:39:21 +0800 Subject: [PATCH 1/3] add interface of tx module --- .gitignore | 8 +- .../org/fisco/bcos/sdk/model/Constructor.java | 120 ++++++++++++++++++ .../org/fisco/bcos/sdk/model/Function.java | 27 ++++ .../impl/executor/TransactionBuilder.java | 37 ++++++ .../impl/executor/TransactionDecoder.java | 106 ++++++++++++++++ .../impl/executor/TransactionEncoder.java | 29 +++++ .../core/impl/executor/TransactionPusher.java | 56 ++++++++ .../core/impl/executor/TransactionSigner.java | 70 ++++++++++ .../core/impl/function/FunctionBuilder.java | 37 ++++++ .../core/impl/function/FunctionEncoder.java | 43 +++++++ .../impl/function/FunctionReturnDecoder.java | 27 ++++ .../executor/TransactionBuilderInterface.java | 44 +++++++ .../executor/TransactionDecoderInterface.java | 63 +++++++++ .../executor/TransactionEncoderInterface.java | 32 +++++ .../executor/TransactionPusherInterface.java | 42 ++++++ .../executor/TransactionSignerInterface.java | 32 +++++ .../function/FunctionBuilderInterface.java | 35 +++++ .../function/FunctionEncoderInterface.java | 33 +++++ .../FunctionReturnDecoderInterface.java | 29 +++++ .../bcos/sdk/transaction/domain/EventLog.java | 19 +++ .../transaction/domain/EventResultEntity.java | 19 +++ .../domain/InputAndOutputResult.java | 19 +++ .../domain/TransactionResponse.java | 19 +++ .../transaction/domain/dto/CallRequest.java | 80 ++++++++++++ .../transaction/domain/dto/CallResponse.java | 41 ++++++ .../transaction/domain/dto/CommonRequest.java | 43 +++++++ .../domain/dto/CommonResponse.java | 57 +++++++++ .../domain/dto/TransactionRequest.java | 57 +++++++++ .../domain/dto/TransactionResponse.java | 95 ++++++++++++++ .../manager/TransactionManager.java | 79 ++++++++++++ .../manager/TransactionManagerInterface.java | 50 ++++++++ .../sdk/transaction/tools/ContractLoader.java | 94 ++++++++++++++ .../transaction/tools/SolTypeConverter.java | 32 +++++ 33 files changed, 1573 insertions(+), 1 deletion(-) create mode 100644 src/main/java/org/fisco/bcos/sdk/model/Constructor.java create mode 100644 src/main/java/org/fisco/bcos/sdk/model/Function.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionBuilder.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionDecoder.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionEncoder.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionPusher.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionSigner.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionBuilder.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionEncoder.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionReturnDecoder.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionBuilderInterface.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionDecoderInterface.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionEncoderInterface.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionPusherInterface.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionSignerInterface.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionBuilderInterface.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionEncoderInterface.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionReturnDecoderInterface.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/domain/EventLog.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/domain/EventResultEntity.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/domain/InputAndOutputResult.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/domain/TransactionResponse.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallRequest.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallResponse.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonRequest.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonResponse.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionRequest.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionResponse.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManager.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManagerInterface.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/tools/ContractLoader.java create mode 100644 src/main/java/org/fisco/bcos/sdk/transaction/tools/SolTypeConverter.java diff --git a/.gitignore b/.gitignore index 51494ea33..cc788f2f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ .gradle/ .idea/ -build \ No newline at end of file +build + +## eclipse ## +.classpath +.project +.settings/ +bin/ diff --git a/src/main/java/org/fisco/bcos/sdk/model/Constructor.java b/src/main/java/org/fisco/bcos/sdk/model/Constructor.java new file mode 100644 index 000000000..34fc1c559 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/model/Constructor.java @@ -0,0 +1,120 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.model; + +import java.util.List; + +/** + * Constructor + * + * @Description: Constructor + * @author maojiayu + * @data Jul 17, 2020 2:36:50 PM + * + */ +public class Constructor { + + private String contractName; + private List params; + private String binary; + private String abi; + private String data; + + /** + * @param contractName + * @param params + * @param binary + * @param abi + * @param data + */ + public Constructor(String contractName, List params, String binary, String abi, String data) { + this.contractName = contractName; + this.params = params; + this.binary = binary; + this.abi = abi; + this.data = data; + } + + /** + * @return the contractName + */ + public String getContractName() { + return contractName; + } + + /** + * @param contractName the contractName to set + */ + public void setContractName(String contractName) { + this.contractName = contractName; + } + + /** + * @return the params + */ + public List getParams() { + return params; + } + + /** + * @param params the params to set + */ + public void setParams(List params) { + this.params = params; + } + + /** + * @return the binary + */ + public String getBinary() { + return binary; + } + + /** + * @param binary the binary to set + */ + public void setBinary(String binary) { + this.binary = binary; + } + + /** + * @return the abi + */ + public String getAbi() { + return abi; + } + + /** + * @param abi the abi to set + */ + public void setAbi(String abi) { + this.abi = abi; + } + + /** + * @return the data + */ + public String getData() { + return data; + } + + /** + * @param data the data to set + */ + public void setData(String data) { + this.data = data; + } + +} diff --git a/src/main/java/org/fisco/bcos/sdk/model/Function.java b/src/main/java/org/fisco/bcos/sdk/model/Function.java new file mode 100644 index 000000000..360c04f44 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/model/Function.java @@ -0,0 +1,27 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.model; + +/** + * Function + * + * @Description: Function + * @author maojiayu + * @data Jul 17, 2020 2:36:36 PM + * + */ +public class Function { + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionBuilder.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionBuilder.java new file mode 100644 index 000000000..bff74eb92 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionBuilder.java @@ -0,0 +1,37 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.impl.executor; + +import java.math.BigInteger; + +import org.fisco.bcos.sdk.client.response.BcosTransaction; +import org.fisco.bcos.sdk.transaction.core.interf.executor.TransactionBuilderInterface; + +public class TransactionBuilder implements TransactionBuilderInterface { + + @Override + public BcosTransaction createTransaction(BigInteger gasPrice, BigInteger gasLimit, String to, String data, + BigInteger value, BigInteger chainId, BigInteger groupId, String extraData) { + // TODO Auto-generated method stub + return null; + } + + @Override + public BcosTransaction createTransaction(String to, String data, BigInteger groupId) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionDecoder.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionDecoder.java new file mode 100644 index 000000000..2e616517a --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionDecoder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.impl.executor; + +import java.util.List; +import java.util.Map; + +import org.fisco.bcos.sdk.client.response.BcosTransaction; +import org.fisco.bcos.sdk.client.response.BcosTransactionReceipt; +import org.fisco.bcos.sdk.transaction.core.interf.executor.TransactionDecoderInterface; +import org.fisco.bcos.sdk.transaction.domain.EventLog; +import org.fisco.bcos.sdk.transaction.domain.EventResultEntity; +import org.fisco.bcos.sdk.transaction.domain.InputAndOutputResult; +import org.fisco.bcos.sdk.transaction.domain.TransactionResponse; + +public class TransactionDecoder implements TransactionDecoderInterface { + + @Override + public BcosTransaction decodeRlp(String hex) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String decodeCall(String abi, String output) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String decodeOutputReturnJson(String contractName, String input, String output) { + // TODO Auto-generated method stub + return null; + } + + @Override + public InputAndOutputResult decodeOutputReturnObject(String contractName, String input, String output) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String decodeEventReturnJson(String contractName, BcosTransactionReceipt transactionReceipt) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Map>> decodeEventReturnObject(String contractName, + BcosTransactionReceipt transactionReceipt) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String decodeEventReturnJson(String contractName, List logList) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Map>> decodeEventReturnObject(String contractName, + List logList) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String decodeEventReturnJson(String contractName, String eventName, List logList) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Map>> decodeEventReturnObject(String contractName, String eventName, + List logList) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String decodeReceiptMessage(String input) { + // TODO Auto-generated method stub + return null; + } + + @Override + public TransactionResponse decodeTransactionReceipt(String contractName, + BcosTransactionReceipt transactionReceipt) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionEncoder.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionEncoder.java new file mode 100644 index 000000000..58200dbf9 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionEncoder.java @@ -0,0 +1,29 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.impl.executor; + +import org.fisco.bcos.sdk.client.response.BcosTransaction; +import org.fisco.bcos.sdk.crypto.signature.SignatureResult; +import org.fisco.bcos.sdk.transaction.core.interf.executor.TransactionEncoderInterface; + +public class TransactionEncoder implements TransactionEncoderInterface { + + @Override + public byte[] encode(BcosTransaction transaction, SignatureResult signature) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionPusher.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionPusher.java new file mode 100644 index 000000000..8e4e5e635 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionPusher.java @@ -0,0 +1,56 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.impl.executor; + +import java.util.concurrent.CompletableFuture; + +import org.fisco.bcos.sdk.client.RespCallback; +import org.fisco.bcos.sdk.client.response.BcosTransactionReceipt; +import org.fisco.bcos.sdk.client.response.Call; +import org.fisco.bcos.sdk.transaction.core.interf.executor.TransactionPusherInterface; + +public class TransactionPusher implements TransactionPusherInterface { + + @Override + public void pushOnly(String signedTransaction) { + // TODO Auto-generated method stub + + } + + @Override + public BcosTransactionReceipt push(String signedTransaction) { + // TODO Auto-generated method stub + return null; + } + + @Override + public BcosTransactionReceipt push(String signedTransaction, RespCallback callback) { + // TODO Auto-generated method stub + return null; + } + + @Override + public CompletableFuture pushAsync(String signedTransaction) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Call push(String from, String to, String encodedFunction) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionSigner.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionSigner.java new file mode 100644 index 000000000..28741929a --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionSigner.java @@ -0,0 +1,70 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.impl.executor; + +import org.fisco.bcos.sdk.client.response.BcosTransaction; +import org.fisco.bcos.sdk.crypto.keypair.CryptoKeyPair; +import org.fisco.bcos.sdk.transaction.core.interf.executor.TransactionSignerInterface; + +public class TransactionSigner implements TransactionSignerInterface { + + private int encryptType; + private CryptoKeyPair cryptoKeyPair; + + /** + * @param encryptType + * @param cryptoKeyPair + */ + public TransactionSigner(int encryptType, CryptoKeyPair cryptoKeyPair) { + super(); + this.encryptType = encryptType; + this.cryptoKeyPair = cryptoKeyPair; + } + + @Override + public byte[] sign(BcosTransaction bcosTransaction) { + // TODO Auto-generated method stub + return null; + } + + /** + * @return the encryptType + */ + public int getEncryptType() { + return encryptType; + } + + /** + * @param encryptType the encryptType to set + */ + public void setEncryptType(int encryptType) { + this.encryptType = encryptType; + } + + /** + * @return the cryptoKeyPair + */ + public CryptoKeyPair getCryptoKeyPair() { + return cryptoKeyPair; + } + + /** + * @param cryptoKeyPair the cryptoKeyPair to set + */ + public void setCryptoKeyPair(CryptoKeyPair cryptoKeyPair) { + this.cryptoKeyPair = cryptoKeyPair; + } + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionBuilder.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionBuilder.java new file mode 100644 index 000000000..43fdefac7 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionBuilder.java @@ -0,0 +1,37 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.impl.function; + +import java.util.List; + +import org.fisco.bcos.sdk.model.Constructor; +import org.fisco.bcos.sdk.model.Function; +import org.fisco.bcos.sdk.transaction.core.interf.function.FunctionBuilderInterface; + +public class FunctionBuilder implements FunctionBuilderInterface { + + @Override + public Function buildFunction(String contractName, String contractAddress, String functionName, List args) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Constructor buildConstructor(String contractName, List args) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionEncoder.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionEncoder.java new file mode 100644 index 000000000..b457576ec --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionEncoder.java @@ -0,0 +1,43 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.impl.function; + +import org.fisco.bcos.sdk.model.Constructor; +import org.fisco.bcos.sdk.model.Function; +import org.fisco.bcos.sdk.transaction.core.interf.function.FunctionEncoderInterface; + +/** + * FunctionEncoder + * + * @Description: FunctionEncoder + * @author maojiayu + * @data Jul 17, 2020 2:47:58 PM + * + */ +public class FunctionEncoder implements FunctionEncoderInterface { + + @Override + public String encodeFunction(Function function) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String encodeConstructor(Constructor constuctor) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionReturnDecoder.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionReturnDecoder.java new file mode 100644 index 000000000..1a58b5a05 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionReturnDecoder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.impl.function; + +import org.fisco.bcos.sdk.transaction.core.interf.function.FunctionReturnDecoderInterface; + +public class FunctionReturnDecoder implements FunctionReturnDecoderInterface { + + @Override + public String decodeCall(String rawInput, String abi) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionBuilderInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionBuilderInterface.java new file mode 100644 index 000000000..395b2a388 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionBuilderInterface.java @@ -0,0 +1,44 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.interf.executor; + +import java.math.BigInteger; + +import org.fisco.bcos.sdk.client.response.BcosTransaction; + +/** + * TransactionBuilderInterface + * + * @Description: TransactionBuilderInterface + * @author maojiayu + * @data Jul 17, 2020 11:02:36 AM + * + */ +public interface TransactionBuilderInterface { + + public BcosTransaction createTransaction(BigInteger gasPrice, BigInteger gasLimit, String to, String data, + BigInteger value, BigInteger chainId, BigInteger groupId, String extraData); + + /** + * Create fisco bcos transaction for short + * + * @param to, target address + * @param data, encoded data + * @param groupId + * @return BcosTransaction + */ + public BcosTransaction createTransaction(String to, String data, BigInteger groupId); + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionDecoderInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionDecoderInterface.java new file mode 100644 index 000000000..5e7d49f64 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionDecoderInterface.java @@ -0,0 +1,63 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.interf.executor; + +import java.util.List; +import java.util.Map; + +import org.fisco.bcos.sdk.client.response.BcosTransaction; +import org.fisco.bcos.sdk.client.response.BcosTransactionReceipt; +import org.fisco.bcos.sdk.transaction.domain.EventLog; +import org.fisco.bcos.sdk.transaction.domain.EventResultEntity; +import org.fisco.bcos.sdk.transaction.domain.InputAndOutputResult; +import org.fisco.bcos.sdk.transaction.domain.TransactionResponse; + +/** + * TransactionDecoderInterface + * + * @Description: TransactionDecoderInterface + * @author maojiayu + * @data Jul 17, 2020 11:38:41 AM + * + */ +public interface TransactionDecoderInterface { + + public BcosTransaction decodeRlp(String hex); + + public String decodeCall(String abi, String output); + + public String decodeOutputReturnJson(String contractName, String input, String output); + + public InputAndOutputResult decodeOutputReturnObject(String contractName, String input, String output); + + public String decodeEventReturnJson(String contractName, BcosTransactionReceipt transactionReceipt); + + public Map>> decodeEventReturnObject(String contractName, + BcosTransactionReceipt transactionReceipt); + + public String decodeEventReturnJson(String contractName, List logList); + + public Map>> decodeEventReturnObject(String contractName, + List logList); + + public String decodeEventReturnJson(String contractName, String eventName, List logList); + + public Map>> decodeEventReturnObject(String contractName, String eventName, + List logList); + + public String decodeReceiptMessage(String input); + + public TransactionResponse decodeTransactionReceipt(String contractName, BcosTransactionReceipt transactionReceipt); +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionEncoderInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionEncoderInterface.java new file mode 100644 index 000000000..082940297 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionEncoderInterface.java @@ -0,0 +1,32 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.interf.executor; + +import org.fisco.bcos.sdk.client.response.BcosTransaction; +import org.fisco.bcos.sdk.crypto.signature.SignatureResult; + +/** + * TransactionEncoderInterface + * + * @Description: TransactionEncoderInterface + * @author maojiayu + * @data Jul 17, 2020 11:59:49 AM + * + */ +public interface TransactionEncoderInterface { + + byte[] encode(BcosTransaction transaction, SignatureResult signature); + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionPusherInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionPusherInterface.java new file mode 100644 index 000000000..0a8c76a4c --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionPusherInterface.java @@ -0,0 +1,42 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.interf.executor; + +import java.util.concurrent.CompletableFuture; + +import org.fisco.bcos.sdk.client.RespCallback; +import org.fisco.bcos.sdk.client.response.BcosTransactionReceipt; +import org.fisco.bcos.sdk.client.response.Call; + +/** + * TransactionPusher + * + * @Description: TransactionPusherInterface + * @author maojiayu + * @data Jul 17, 2020 2:13:39 PM + * + */ +public interface TransactionPusherInterface { + + public void pushOnly(String signedTransaction); + + public BcosTransactionReceipt push(String signedTransaction); + + public BcosTransactionReceipt push(String signedTransaction, RespCallback callback); + + public CompletableFuture pushAsync(String signedTransaction); + + public Call push(String from, String to, String encodedFunction); +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionSignerInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionSignerInterface.java new file mode 100644 index 000000000..e39d40a5e --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionSignerInterface.java @@ -0,0 +1,32 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.interf.executor; + +import org.fisco.bcos.sdk.client.response.BcosTransaction; + +/** + * TransactionSignerInterface + * + * @Description: TransactionSignerInterface + * @author maojiayu + * @data Jul 17, 2020 11:11:24 AM + * + */ +public interface TransactionSignerInterface { + + byte[] sign(BcosTransaction bcosTransaction); + + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionBuilderInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionBuilderInterface.java new file mode 100644 index 000000000..bc75bd5e0 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionBuilderInterface.java @@ -0,0 +1,35 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.interf.function; + +import java.util.List; + +import org.fisco.bcos.sdk.model.Constructor; +import org.fisco.bcos.sdk.model.Function; + +/** + * FunctionBuilderInterface + * + * @Description: FunctionBuilderInterface + * @author maojiayu + * @data Jul 17, 2020 2:34:36 PM + * + */ +public interface FunctionBuilderInterface { + + public Function buildFunction(String contractName, String contractAddress, String functionName, List args); + + public Constructor buildConstructor(String contractName, List args); +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionEncoderInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionEncoderInterface.java new file mode 100644 index 000000000..5ff09d28e --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionEncoderInterface.java @@ -0,0 +1,33 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.interf.function; + +import org.fisco.bcos.sdk.model.Constructor; +import org.fisco.bcos.sdk.model.Function; + +/** + * FunctionEncoderInterface + * + * @Description: FunctionEncoderInterface + * @author maojiayu + * @data Jul 17, 2020 2:46:31 PM + * + */ +public interface FunctionEncoderInterface { + + public String encodeFunction(Function function); + + public String encodeConstructor(Constructor constuctor); +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionReturnDecoderInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionReturnDecoderInterface.java new file mode 100644 index 000000000..a90b07a3b --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionReturnDecoderInterface.java @@ -0,0 +1,29 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.core.interf.function; + +/** + * FunctionReturnDecoder + * + * @Description: FunctionReturnDecoderInterface + * @author maojiayu + * @data Jul 17, 2020 2:48:54 PM + * + */ +public interface FunctionReturnDecoderInterface { + + public String decodeCall(String rawInput, String abi); + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/EventLog.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/EventLog.java new file mode 100644 index 000000000..9186b3ff1 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/EventLog.java @@ -0,0 +1,19 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.domain; + +public class EventLog { + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/EventResultEntity.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/EventResultEntity.java new file mode 100644 index 000000000..af15c821b --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/EventResultEntity.java @@ -0,0 +1,19 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.domain; + +public class EventResultEntity { + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/InputAndOutputResult.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/InputAndOutputResult.java new file mode 100644 index 000000000..c0a387adf --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/InputAndOutputResult.java @@ -0,0 +1,19 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.domain; + +public class InputAndOutputResult { + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/TransactionResponse.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/TransactionResponse.java new file mode 100644 index 000000000..84efddf15 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/TransactionResponse.java @@ -0,0 +1,19 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.domain; + +public class TransactionResponse { + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallRequest.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallRequest.java new file mode 100644 index 000000000..102e6e483 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallRequest.java @@ -0,0 +1,80 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.domain.dto; + +/** + * CallRequest + * + * @Description: CallRequest + * @author maojiayu + * @data Jul 17, 2020 3:09:48 PM + * + */ +public class CallRequest extends CommonRequest { + private String from; + private String to; + private String encodedFunction; + private String abi; + + /** + * @return the from + */ + public String getFrom() { + return from; + } + /** + * @param from the from to set + */ + public void setFrom(String from) { + this.from = from; + } + /** + * @return the to + */ + public String getTo() { + return to; + } + /** + * @param to the to to set + */ + public void setTo(String to) { + this.to = to; + } + /** + * @return the encodedFunction + */ + public String getEncodedFunction() { + return encodedFunction; + } + /** + * @param encodedFunction the encodedFunction to set + */ + public void setEncodedFunction(String encodedFunction) { + this.encodedFunction = encodedFunction; + } + /** + * @return the abi + */ + public String getAbi() { + return abi; + } + /** + * @param abi the abi to set + */ + public void setAbi(String abi) { + this.abi = abi; + } + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallResponse.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallResponse.java new file mode 100644 index 000000000..9c0f27bb3 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallResponse.java @@ -0,0 +1,41 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.domain.dto; + +/** + * CallResponse + * + * @Description: CallResponse + * @author maojiayu + * @data Jul 17, 2020 3:20:06 PM + * + */ +public class CallResponse extends CommonResponse { + private String values; + + /** + * @return the values + */ + public String getValues() { + return values; + } + + /** + * @param values the values to set + */ + public void setValues(String values) { + this.values = values; + } +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonRequest.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonRequest.java new file mode 100644 index 000000000..c6bcc3ff0 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonRequest.java @@ -0,0 +1,43 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.domain.dto; + +/** + * CommonTransactionRequest + * + * @Description: CommonRequest + * @author maojiayu + * @data Jul 17, 2020 3:07:28 PM + * + */ +public class CommonRequest { + + private int groupId; + + /** + * @return the groupId + */ + public int getGroupId() { + return groupId; + } + + /** + * @param groupId the groupId to set + */ + public void setGroupId(int groupId) { + this.groupId = groupId; + } + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonResponse.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonResponse.java new file mode 100644 index 000000000..0ca6c8249 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonResponse.java @@ -0,0 +1,57 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.domain.dto; + +/** + * CommonResponse + * + * @Description: CommonResponse + * @author maojiayu + * @data Jul 17, 2020 3:15:35 PM + * + */ +public class CommonResponse { + private int returnCode; + private String returnMessage; + + /** + * @return the returnCode + */ + public int getReturnCode() { + return returnCode; + } + + /** + * @param returnCode the returnCode to set + */ + public void setReturnCode(int returnCode) { + this.returnCode = returnCode; + } + + /** + * @return the returnMessage + */ + public String getReturnMessage() { + return returnMessage; + } + + /** + * @param returnMessage the returnMessage to set + */ + public void setReturnMessage(String returnMessage) { + this.returnMessage = returnMessage; + } + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionRequest.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionRequest.java new file mode 100644 index 000000000..e76aec21c --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionRequest.java @@ -0,0 +1,57 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.domain.dto; + +/** + * TransactionRequest + * + * @Description: TransactionRequest + * @author maojiayu + * @data Jul 17, 2020 3:08:41 PM + * + */ +public class TransactionRequest extends CommonRequest { + private String contractName; + private String signedData; + + /** + * @return the contractName + */ + public String getContractName() { + return contractName; + } + + /** + * @param contractName the contractName to set + */ + public void setContractName(String contractName) { + this.contractName = contractName; + } + + /** + * @return the signedData + */ + public String getSignedData() { + return signedData; + } + + /** + * @param signedData the signedData to set + */ + public void setSignedData(String signedData) { + this.signedData = signedData; + } + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionResponse.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionResponse.java new file mode 100644 index 000000000..86444f18a --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionResponse.java @@ -0,0 +1,95 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.domain.dto; + +import org.fisco.bcos.sdk.client.response.BcosTransactionReceipt; + +/** + * TransactionResponse + * + * @Description: TransactionResponse + * @author maojiayu + * @data Jul 17, 2020 3:16:51 PM + * + */ +public class TransactionResponse extends CommonResponse { + private BcosTransactionReceipt bcosTransactionReceipt; + private String contractAddress; + private String values; + private String events; + private String receiptMessages; + /** + * @return the bcosTransactionReceipt + */ + public BcosTransactionReceipt getBcosTransactionReceipt() { + return bcosTransactionReceipt; + } + /** + * @param bcosTransactionReceipt the bcosTransactionReceipt to set + */ + public void setBcosTransactionReceipt(BcosTransactionReceipt bcosTransactionReceipt) { + this.bcosTransactionReceipt = bcosTransactionReceipt; + } + /** + * @return the contractAddress + */ + public String getContractAddress() { + return contractAddress; + } + /** + * @param contractAddress the contractAddress to set + */ + public void setContractAddress(String contractAddress) { + this.contractAddress = contractAddress; + } + /** + * @return the values + */ + public String getValues() { + return values; + } + /** + * @param values the values to set + */ + public void setValues(String values) { + this.values = values; + } + /** + * @return the events + */ + public String getEvents() { + return events; + } + /** + * @param events the events to set + */ + public void setEvents(String events) { + this.events = events; + } + /** + * @return the receiptMessages + */ + public String getReceiptMessages() { + return receiptMessages; + } + /** + * @param receiptMessages the receiptMessages to set + */ + public void setReceiptMessages(String receiptMessages) { + this.receiptMessages = receiptMessages; + } + + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManager.java b/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManager.java new file mode 100644 index 000000000..7d1280894 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManager.java @@ -0,0 +1,79 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.manager; + +import java.util.concurrent.CompletableFuture; + +import org.fisco.bcos.sdk.client.RespCallback; +import org.fisco.bcos.sdk.client.response.BcosTransactionReceipt; +import org.fisco.bcos.sdk.transaction.domain.dto.CallRequest; +import org.fisco.bcos.sdk.transaction.domain.dto.CallResponse; +import org.fisco.bcos.sdk.transaction.domain.dto.TransactionRequest; +import org.fisco.bcos.sdk.transaction.domain.dto.TransactionResponse; + +/** + * TransactionManager + * + * @Description: TransactionManager + * @author maojiayu + * @data Jul 17, 2020 3:23:19 PM + * + */ +public class TransactionManager implements TransactionManagerInterface { + + @Override + public TransactionResponse deploy(TransactionRequest transactionRequest) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void sendTransactionOnly(TransactionRequest transactionRequest) { + // TODO Auto-generated method stub + + } + + @Override + public TransactionResponse sendTransaction(TransactionRequest transactionRequest) { + // TODO Auto-generated method stub + return null; + } + + @Override + public BcosTransactionReceipt sendTransaction(int groupId, String signedTransaction, + RespCallback callback) { + // TODO Auto-generated method stub + return null; + } + + @Override + public CompletableFuture sendTransactionAsync(TransactionRequest transactionRequest) { + // TODO Auto-generated method stub + return null; + } + + @Override + public CallResponse sendCall(CallRequest callRequest) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getCurrentExternalAccountAddress() { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManagerInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManagerInterface.java new file mode 100644 index 000000000..bd2428982 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManagerInterface.java @@ -0,0 +1,50 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.manager; + +import java.util.concurrent.CompletableFuture; + +import org.fisco.bcos.sdk.client.RespCallback; +import org.fisco.bcos.sdk.client.response.BcosTransactionReceipt; +import org.fisco.bcos.sdk.transaction.domain.dto.CallRequest; +import org.fisco.bcos.sdk.transaction.domain.dto.CallResponse; +import org.fisco.bcos.sdk.transaction.domain.dto.TransactionRequest; +import org.fisco.bcos.sdk.transaction.domain.dto.TransactionResponse; + +/** + * TransactionManagerInterface + * + * @Description: TransactionManagerInterface + * @author maojiayu + * @data Jul 17, 2020 2:59:21 PM + * + */ +public interface TransactionManagerInterface { + + public TransactionResponse deploy(TransactionRequest transactionRequest); + + public void sendTransactionOnly(TransactionRequest transactionRequest); + + public TransactionResponse sendTransaction(TransactionRequest transactionRequest); + + public BcosTransactionReceipt sendTransaction(int groupId, String signedTransaction, + RespCallback callback); + + public CompletableFuture sendTransactionAsync(TransactionRequest transactionRequest); + + public CallResponse sendCall(CallRequest callRequest); + + public String getCurrentExternalAccountAddress(); +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/tools/ContractLoader.java b/src/main/java/org/fisco/bcos/sdk/transaction/tools/ContractLoader.java new file mode 100644 index 000000000..888a5644c --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/tools/ContractLoader.java @@ -0,0 +1,94 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.tools; + +import org.apache.commons.lang3.tuple.Pair; + +/** + * ContractLoader + * + * @Description: ContractLoader + * @author maojiayu + * @data Jul 17, 2020 3:24:40 PM + * + */ +public class ContractLoader { + private int readType; + private String path; + + /** + * @param readType + * @param path + */ + public ContractLoader(int readType, String path) { + super(); + this.readType = readType; + this.path = path; + } + + public String getABIByContractName(String contractName) { + // TODO + return null; + } + + public String getBinaryByContractName(String contractName) { + // TODO + return null; + } + + public Pair getABIAndBinaryByContractName(String contractName) { + // TODO + return null; + } + + // TODO + /* + * public AbiDefinition getConstructorABIByContractName(String contractName) { + * + * } + * + * public List getFunctionABIListByContractName(String contractName) { + * + * } + */ + + /** + * @return the readType + */ + public int getReadType() { + return readType; + } + + /** + * @param readType the readType to set + */ + public void setReadType(int readType) { + this.readType = readType; + } + + /** + * @return the path + */ + public String getPath() { + return path; + } + + /** + * @param path the path to set + */ + public void setPath(String path) { + this.path = path; + } +} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/tools/SolTypeConverter.java b/src/main/java/org/fisco/bcos/sdk/transaction/tools/SolTypeConverter.java new file mode 100644 index 000000000..560567573 --- /dev/null +++ b/src/main/java/org/fisco/bcos/sdk/transaction/tools/SolTypeConverter.java @@ -0,0 +1,32 @@ +/* + * Copyright 2014-2020 [fisco-dev] + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * + */ +package org.fisco.bcos.sdk.transaction.tools; + +/** + * SolTypeConverter + * + * @Description: SolTypeConverter + * @author maojiayu + * @data Jul 17, 2020 3:35:09 PM + * + */ +public class SolTypeConverter { + + // TODO + /* + * public static List convertToSolType(AbiDefinition abiDefinition, List javaArgs) {} + */ + +} From 19f8a0f631cd32e762955f1986cc4e27ca3360b1 Mon Sep 17 00:00:00 2001 From: dalaocu Date: Mon, 20 Jul 2020 14:36:43 +0800 Subject: [PATCH 2/3] rename ambiguous class name Constructor -> SolidityConstructor Function -> SolidityFunction --- .../model/{Constructor.java => SolidityConstructor.java} | 6 +++--- .../sdk/model/{Function.java => SolidityFunction.java} | 4 ++-- .../transaction/core/impl/function/FunctionBuilder.java | 8 ++++---- .../transaction/core/impl/function/FunctionEncoder.java | 8 ++++---- .../core/interf/function/FunctionBuilderInterface.java | 8 ++++---- .../core/interf/function/FunctionEncoderInterface.java | 8 ++++---- 6 files changed, 21 insertions(+), 21 deletions(-) rename src/main/java/org/fisco/bcos/sdk/model/{Constructor.java => SolidityConstructor.java} (92%) rename src/main/java/org/fisco/bcos/sdk/model/{Function.java => SolidityFunction.java} (91%) diff --git a/src/main/java/org/fisco/bcos/sdk/model/Constructor.java b/src/main/java/org/fisco/bcos/sdk/model/SolidityConstructor.java similarity index 92% rename from src/main/java/org/fisco/bcos/sdk/model/Constructor.java rename to src/main/java/org/fisco/bcos/sdk/model/SolidityConstructor.java index 34fc1c559..5dcbc0ce0 100644 --- a/src/main/java/org/fisco/bcos/sdk/model/Constructor.java +++ b/src/main/java/org/fisco/bcos/sdk/model/SolidityConstructor.java @@ -19,12 +19,12 @@ /** * Constructor * - * @Description: Constructor + * @Description: SolidityConstructor * @author maojiayu * @data Jul 17, 2020 2:36:50 PM * */ -public class Constructor { +public class SolidityConstructor { private String contractName; private List params; @@ -39,7 +39,7 @@ public class Constructor { * @param abi * @param data */ - public Constructor(String contractName, List params, String binary, String abi, String data) { + public SolidityConstructor(String contractName, List params, String binary, String abi, String data) { this.contractName = contractName; this.params = params; this.binary = binary; diff --git a/src/main/java/org/fisco/bcos/sdk/model/Function.java b/src/main/java/org/fisco/bcos/sdk/model/SolidityFunction.java similarity index 91% rename from src/main/java/org/fisco/bcos/sdk/model/Function.java rename to src/main/java/org/fisco/bcos/sdk/model/SolidityFunction.java index 360c04f44..3731b2093 100644 --- a/src/main/java/org/fisco/bcos/sdk/model/Function.java +++ b/src/main/java/org/fisco/bcos/sdk/model/SolidityFunction.java @@ -17,11 +17,11 @@ /** * Function * - * @Description: Function + * @Description: SolidityFunction * @author maojiayu * @data Jul 17, 2020 2:36:36 PM * */ -public class Function { +public class SolidityFunction { } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionBuilder.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionBuilder.java index 43fdefac7..90530c86a 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionBuilder.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionBuilder.java @@ -16,20 +16,20 @@ import java.util.List; -import org.fisco.bcos.sdk.model.Constructor; -import org.fisco.bcos.sdk.model.Function; +import org.fisco.bcos.sdk.model.SolidityConstructor; +import org.fisco.bcos.sdk.model.SolidityFunction; import org.fisco.bcos.sdk.transaction.core.interf.function.FunctionBuilderInterface; public class FunctionBuilder implements FunctionBuilderInterface { @Override - public Function buildFunction(String contractName, String contractAddress, String functionName, List args) { + public SolidityFunction buildFunction(String contractName, String contractAddress, String functionName, List args) { // TODO Auto-generated method stub return null; } @Override - public Constructor buildConstructor(String contractName, List args) { + public SolidityConstructor buildConstructor(String contractName, List args) { // TODO Auto-generated method stub return null; } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionEncoder.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionEncoder.java index b457576ec..6c0cacbc7 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionEncoder.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionEncoder.java @@ -14,8 +14,8 @@ */ package org.fisco.bcos.sdk.transaction.core.impl.function; -import org.fisco.bcos.sdk.model.Constructor; -import org.fisco.bcos.sdk.model.Function; +import org.fisco.bcos.sdk.model.SolidityConstructor; +import org.fisco.bcos.sdk.model.SolidityFunction; import org.fisco.bcos.sdk.transaction.core.interf.function.FunctionEncoderInterface; /** @@ -29,13 +29,13 @@ public class FunctionEncoder implements FunctionEncoderInterface { @Override - public String encodeFunction(Function function) { + public String encodeFunction(SolidityFunction solidityFunction) { // TODO Auto-generated method stub return null; } @Override - public String encodeConstructor(Constructor constuctor) { + public String encodeConstructor(SolidityConstructor constuctor) { // TODO Auto-generated method stub return null; } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionBuilderInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionBuilderInterface.java index bc75bd5e0..480c469aa 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionBuilderInterface.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionBuilderInterface.java @@ -16,8 +16,8 @@ import java.util.List; -import org.fisco.bcos.sdk.model.Constructor; -import org.fisco.bcos.sdk.model.Function; +import org.fisco.bcos.sdk.model.SolidityConstructor; +import org.fisco.bcos.sdk.model.SolidityFunction; /** * FunctionBuilderInterface @@ -29,7 +29,7 @@ */ public interface FunctionBuilderInterface { - public Function buildFunction(String contractName, String contractAddress, String functionName, List args); + public SolidityFunction buildFunction(String contractName, String contractAddress, String functionName, List args); - public Constructor buildConstructor(String contractName, List args); + public SolidityConstructor buildConstructor(String contractName, List args); } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionEncoderInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionEncoderInterface.java index 5ff09d28e..3607405e8 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionEncoderInterface.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionEncoderInterface.java @@ -14,8 +14,8 @@ */ package org.fisco.bcos.sdk.transaction.core.interf.function; -import org.fisco.bcos.sdk.model.Constructor; -import org.fisco.bcos.sdk.model.Function; +import org.fisco.bcos.sdk.model.SolidityConstructor; +import org.fisco.bcos.sdk.model.SolidityFunction; /** * FunctionEncoderInterface @@ -27,7 +27,7 @@ */ public interface FunctionEncoderInterface { - public String encodeFunction(Function function); + public String encodeFunction(SolidityFunction solidityFunction); - public String encodeConstructor(Constructor constuctor); + public String encodeConstructor(SolidityConstructor constuctor); } From 0ba06c0ed087df213888419ab3554db41ec6d3b6 Mon Sep 17 00:00:00 2001 From: dalaocu Date: Mon, 20 Jul 2020 15:10:38 +0800 Subject: [PATCH 3/3] format --- .../bcos/sdk/model/SolidityConstructor.java | 48 +++++-------------- .../bcos/sdk/model/SolidityFunction.java | 8 +--- .../impl/executor/TransactionBuilder.java | 13 +++-- .../impl/executor/TransactionDecoder.java | 27 ++++++----- .../impl/executor/TransactionEncoder.java | 1 - .../core/impl/executor/TransactionPusher.java | 2 - .../core/impl/executor/TransactionSigner.java | 17 ++----- .../core/impl/function/FunctionBuilder.java | 5 +- .../core/impl/function/FunctionEncoder.java | 5 +- .../impl/function/FunctionReturnDecoder.java | 1 - .../executor/TransactionBuilderInterface.java | 19 ++++---- .../executor/TransactionDecoderInterface.java | 29 +++++------ .../executor/TransactionEncoderInterface.java | 7 +-- .../executor/TransactionPusherInterface.java | 5 +- .../executor/TransactionSignerInterface.java | 8 +--- .../function/FunctionBuilderInterface.java | 8 ++-- .../function/FunctionEncoderInterface.java | 4 +- .../FunctionReturnDecoderInterface.java | 5 +- .../bcos/sdk/transaction/domain/EventLog.java | 4 +- .../transaction/domain/EventResultEntity.java | 4 +- .../domain/InputAndOutputResult.java | 4 +- .../domain/TransactionResponse.java | 4 +- .../transaction/domain/dto/CallRequest.java | 39 ++++----------- .../transaction/domain/dto/CallResponse.java | 12 ++--- .../transaction/domain/dto/CommonRequest.java | 13 ++--- .../domain/dto/CommonResponse.java | 21 ++------ .../domain/dto/TransactionRequest.java | 21 ++------ .../domain/dto/TransactionResponse.java | 46 +++++------------- .../manager/TransactionManager.java | 13 ++--- .../manager/TransactionManagerInterface.java | 12 ++--- .../sdk/transaction/tools/ContractLoader.java | 26 ++++------ .../transaction/tools/SolTypeConverter.java | 4 +- 32 files changed, 141 insertions(+), 294 deletions(-) diff --git a/src/main/java/org/fisco/bcos/sdk/model/SolidityConstructor.java b/src/main/java/org/fisco/bcos/sdk/model/SolidityConstructor.java index 5dcbc0ce0..66b31ab94 100644 --- a/src/main/java/org/fisco/bcos/sdk/model/SolidityConstructor.java +++ b/src/main/java/org/fisco/bcos/sdk/model/SolidityConstructor.java @@ -17,12 +17,10 @@ import java.util.List; /** - * Constructor + * Constructor @Description: SolidityConstructor * - * @Description: SolidityConstructor * @author maojiayu * @data Jul 17, 2020 2:36:50 PM - * */ public class SolidityConstructor { @@ -39,7 +37,8 @@ public class SolidityConstructor { * @param abi * @param data */ - public SolidityConstructor(String contractName, List params, String binary, String abi, String data) { + public SolidityConstructor( + String contractName, List params, String binary, String abi, String data) { this.contractName = contractName; this.params = params; this.binary = binary; @@ -47,74 +46,53 @@ public SolidityConstructor(String contractName, List params, String bina this.data = data; } - /** - * @return the contractName - */ + /** @return the contractName */ public String getContractName() { return contractName; } - /** - * @param contractName the contractName to set - */ + /** @param contractName the contractName to set */ public void setContractName(String contractName) { this.contractName = contractName; } - /** - * @return the params - */ + /** @return the params */ public List getParams() { return params; } - /** - * @param params the params to set - */ + /** @param params the params to set */ public void setParams(List params) { this.params = params; } - /** - * @return the binary - */ + /** @return the binary */ public String getBinary() { return binary; } - /** - * @param binary the binary to set - */ + /** @param binary the binary to set */ public void setBinary(String binary) { this.binary = binary; } - /** - * @return the abi - */ + /** @return the abi */ public String getAbi() { return abi; } - /** - * @param abi the abi to set - */ + /** @param abi the abi to set */ public void setAbi(String abi) { this.abi = abi; } - /** - * @return the data - */ + /** @return the data */ public String getData() { return data; } - /** - * @param data the data to set - */ + /** @param data the data to set */ public void setData(String data) { this.data = data; } - } diff --git a/src/main/java/org/fisco/bcos/sdk/model/SolidityFunction.java b/src/main/java/org/fisco/bcos/sdk/model/SolidityFunction.java index 3731b2093..634e005df 100644 --- a/src/main/java/org/fisco/bcos/sdk/model/SolidityFunction.java +++ b/src/main/java/org/fisco/bcos/sdk/model/SolidityFunction.java @@ -15,13 +15,9 @@ package org.fisco.bcos.sdk.model; /** - * Function + * Function @Description: SolidityFunction * - * @Description: SolidityFunction * @author maojiayu * @data Jul 17, 2020 2:36:36 PM - * */ -public class SolidityFunction { - -} +public class SolidityFunction {} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionBuilder.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionBuilder.java index bff74eb92..cc8503920 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionBuilder.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionBuilder.java @@ -15,15 +15,21 @@ package org.fisco.bcos.sdk.transaction.core.impl.executor; import java.math.BigInteger; - import org.fisco.bcos.sdk.client.response.BcosTransaction; import org.fisco.bcos.sdk.transaction.core.interf.executor.TransactionBuilderInterface; public class TransactionBuilder implements TransactionBuilderInterface { @Override - public BcosTransaction createTransaction(BigInteger gasPrice, BigInteger gasLimit, String to, String data, - BigInteger value, BigInteger chainId, BigInteger groupId, String extraData) { + public BcosTransaction createTransaction( + BigInteger gasPrice, + BigInteger gasLimit, + String to, + String data, + BigInteger value, + BigInteger chainId, + BigInteger groupId, + String extraData) { // TODO Auto-generated method stub return null; } @@ -33,5 +39,4 @@ public BcosTransaction createTransaction(String to, String data, BigInteger grou // TODO Auto-generated method stub return null; } - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionDecoder.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionDecoder.java index 2e616517a..7eda63563 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionDecoder.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionDecoder.java @@ -16,7 +16,6 @@ import java.util.List; import java.util.Map; - import org.fisco.bcos.sdk.client.response.BcosTransaction; import org.fisco.bcos.sdk.client.response.BcosTransactionReceipt; import org.fisco.bcos.sdk.transaction.core.interf.executor.TransactionDecoderInterface; @@ -46,20 +45,22 @@ public String decodeOutputReturnJson(String contractName, String input, String o } @Override - public InputAndOutputResult decodeOutputReturnObject(String contractName, String input, String output) { + public InputAndOutputResult decodeOutputReturnObject( + String contractName, String input, String output) { // TODO Auto-generated method stub return null; } @Override - public String decodeEventReturnJson(String contractName, BcosTransactionReceipt transactionReceipt) { + public String decodeEventReturnJson( + String contractName, BcosTransactionReceipt transactionReceipt) { // TODO Auto-generated method stub return null; } @Override - public Map>> decodeEventReturnObject(String contractName, - BcosTransactionReceipt transactionReceipt) { + public Map>> decodeEventReturnObject( + String contractName, BcosTransactionReceipt transactionReceipt) { // TODO Auto-generated method stub return null; } @@ -71,21 +72,22 @@ public String decodeEventReturnJson(String contractName, List logList) } @Override - public Map>> decodeEventReturnObject(String contractName, - List logList) { + public Map>> decodeEventReturnObject( + String contractName, List logList) { // TODO Auto-generated method stub return null; } @Override - public String decodeEventReturnJson(String contractName, String eventName, List logList) { + public String decodeEventReturnJson( + String contractName, String eventName, List logList) { // TODO Auto-generated method stub return null; } @Override - public Map>> decodeEventReturnObject(String contractName, String eventName, - List logList) { + public Map>> decodeEventReturnObject( + String contractName, String eventName, List logList) { // TODO Auto-generated method stub return null; } @@ -97,10 +99,9 @@ public String decodeReceiptMessage(String input) { } @Override - public TransactionResponse decodeTransactionReceipt(String contractName, - BcosTransactionReceipt transactionReceipt) { + public TransactionResponse decodeTransactionReceipt( + String contractName, BcosTransactionReceipt transactionReceipt) { // TODO Auto-generated method stub return null; } - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionEncoder.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionEncoder.java index 58200dbf9..2699a6fe3 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionEncoder.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionEncoder.java @@ -25,5 +25,4 @@ public byte[] encode(BcosTransaction transaction, SignatureResult signature) { // TODO Auto-generated method stub return null; } - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionPusher.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionPusher.java index 8e4e5e635..ab25eafaa 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionPusher.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionPusher.java @@ -15,7 +15,6 @@ package org.fisco.bcos.sdk.transaction.core.impl.executor; import java.util.concurrent.CompletableFuture; - import org.fisco.bcos.sdk.client.RespCallback; import org.fisco.bcos.sdk.client.response.BcosTransactionReceipt; import org.fisco.bcos.sdk.client.response.Call; @@ -52,5 +51,4 @@ public Call push(String from, String to, String encodedFunction) { // TODO Auto-generated method stub return null; } - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionSigner.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionSigner.java index 28741929a..7732cb1d4 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionSigner.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/executor/TransactionSigner.java @@ -39,32 +39,23 @@ public byte[] sign(BcosTransaction bcosTransaction) { return null; } - /** - * @return the encryptType - */ + /** @return the encryptType */ public int getEncryptType() { return encryptType; } - /** - * @param encryptType the encryptType to set - */ + /** @param encryptType the encryptType to set */ public void setEncryptType(int encryptType) { this.encryptType = encryptType; } - /** - * @return the cryptoKeyPair - */ + /** @return the cryptoKeyPair */ public CryptoKeyPair getCryptoKeyPair() { return cryptoKeyPair; } - /** - * @param cryptoKeyPair the cryptoKeyPair to set - */ + /** @param cryptoKeyPair the cryptoKeyPair to set */ public void setCryptoKeyPair(CryptoKeyPair cryptoKeyPair) { this.cryptoKeyPair = cryptoKeyPair; } - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionBuilder.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionBuilder.java index 90530c86a..977c79a7d 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionBuilder.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionBuilder.java @@ -15,7 +15,6 @@ package org.fisco.bcos.sdk.transaction.core.impl.function; import java.util.List; - import org.fisco.bcos.sdk.model.SolidityConstructor; import org.fisco.bcos.sdk.model.SolidityFunction; import org.fisco.bcos.sdk.transaction.core.interf.function.FunctionBuilderInterface; @@ -23,7 +22,8 @@ public class FunctionBuilder implements FunctionBuilderInterface { @Override - public SolidityFunction buildFunction(String contractName, String contractAddress, String functionName, List args) { + public SolidityFunction buildFunction( + String contractName, String contractAddress, String functionName, List args) { // TODO Auto-generated method stub return null; } @@ -33,5 +33,4 @@ public SolidityConstructor buildConstructor(String contractName, List ar // TODO Auto-generated method stub return null; } - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionEncoder.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionEncoder.java index 6c0cacbc7..aafc95755 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionEncoder.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionEncoder.java @@ -19,12 +19,10 @@ import org.fisco.bcos.sdk.transaction.core.interf.function.FunctionEncoderInterface; /** - * FunctionEncoder + * FunctionEncoder @Description: FunctionEncoder * - * @Description: FunctionEncoder * @author maojiayu * @data Jul 17, 2020 2:47:58 PM - * */ public class FunctionEncoder implements FunctionEncoderInterface { @@ -39,5 +37,4 @@ public String encodeConstructor(SolidityConstructor constuctor) { // TODO Auto-generated method stub return null; } - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionReturnDecoder.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionReturnDecoder.java index 1a58b5a05..7b80ef3f1 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionReturnDecoder.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/impl/function/FunctionReturnDecoder.java @@ -23,5 +23,4 @@ public String decodeCall(String rawInput, String abi) { // TODO Auto-generated method stub return null; } - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionBuilderInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionBuilderInterface.java index 395b2a388..bcac88d7f 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionBuilderInterface.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionBuilderInterface.java @@ -15,30 +15,33 @@ package org.fisco.bcos.sdk.transaction.core.interf.executor; import java.math.BigInteger; - import org.fisco.bcos.sdk.client.response.BcosTransaction; /** - * TransactionBuilderInterface + * TransactionBuilderInterface @Description: TransactionBuilderInterface * - * @Description: TransactionBuilderInterface * @author maojiayu * @data Jul 17, 2020 11:02:36 AM - * */ public interface TransactionBuilderInterface { - public BcosTransaction createTransaction(BigInteger gasPrice, BigInteger gasLimit, String to, String data, - BigInteger value, BigInteger chainId, BigInteger groupId, String extraData); + public BcosTransaction createTransaction( + BigInteger gasPrice, + BigInteger gasLimit, + String to, + String data, + BigInteger value, + BigInteger chainId, + BigInteger groupId, + String extraData); /** * Create fisco bcos transaction for short - * + * * @param to, target address * @param data, encoded data * @param groupId * @return BcosTransaction */ public BcosTransaction createTransaction(String to, String data, BigInteger groupId); - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionDecoderInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionDecoderInterface.java index 5e7d49f64..3395f95cb 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionDecoderInterface.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionDecoderInterface.java @@ -16,7 +16,6 @@ import java.util.List; import java.util.Map; - import org.fisco.bcos.sdk.client.response.BcosTransaction; import org.fisco.bcos.sdk.client.response.BcosTransactionReceipt; import org.fisco.bcos.sdk.transaction.domain.EventLog; @@ -25,12 +24,10 @@ import org.fisco.bcos.sdk.transaction.domain.TransactionResponse; /** - * TransactionDecoderInterface + * TransactionDecoderInterface @Description: TransactionDecoderInterface * - * @Description: TransactionDecoderInterface * @author maojiayu * @data Jul 17, 2020 11:38:41 AM - * */ public interface TransactionDecoderInterface { @@ -40,24 +37,28 @@ public interface TransactionDecoderInterface { public String decodeOutputReturnJson(String contractName, String input, String output); - public InputAndOutputResult decodeOutputReturnObject(String contractName, String input, String output); + public InputAndOutputResult decodeOutputReturnObject( + String contractName, String input, String output); - public String decodeEventReturnJson(String contractName, BcosTransactionReceipt transactionReceipt); + public String decodeEventReturnJson( + String contractName, BcosTransactionReceipt transactionReceipt); - public Map>> decodeEventReturnObject(String contractName, - BcosTransactionReceipt transactionReceipt); + public Map>> decodeEventReturnObject( + String contractName, BcosTransactionReceipt transactionReceipt); public String decodeEventReturnJson(String contractName, List logList); - public Map>> decodeEventReturnObject(String contractName, - List logList); + public Map>> decodeEventReturnObject( + String contractName, List logList); - public String decodeEventReturnJson(String contractName, String eventName, List logList); + public String decodeEventReturnJson( + String contractName, String eventName, List logList); - public Map>> decodeEventReturnObject(String contractName, String eventName, - List logList); + public Map>> decodeEventReturnObject( + String contractName, String eventName, List logList); public String decodeReceiptMessage(String input); - public TransactionResponse decodeTransactionReceipt(String contractName, BcosTransactionReceipt transactionReceipt); + public TransactionResponse decodeTransactionReceipt( + String contractName, BcosTransactionReceipt transactionReceipt); } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionEncoderInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionEncoderInterface.java index 082940297..2f02d46cd 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionEncoderInterface.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionEncoderInterface.java @@ -18,15 +18,12 @@ import org.fisco.bcos.sdk.crypto.signature.SignatureResult; /** - * TransactionEncoderInterface + * TransactionEncoderInterface @Description: TransactionEncoderInterface * - * @Description: TransactionEncoderInterface * @author maojiayu * @data Jul 17, 2020 11:59:49 AM - * */ public interface TransactionEncoderInterface { - - byte[] encode(BcosTransaction transaction, SignatureResult signature); + byte[] encode(BcosTransaction transaction, SignatureResult signature); } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionPusherInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionPusherInterface.java index 0a8c76a4c..acc970520 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionPusherInterface.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionPusherInterface.java @@ -15,18 +15,15 @@ package org.fisco.bcos.sdk.transaction.core.interf.executor; import java.util.concurrent.CompletableFuture; - import org.fisco.bcos.sdk.client.RespCallback; import org.fisco.bcos.sdk.client.response.BcosTransactionReceipt; import org.fisco.bcos.sdk.client.response.Call; /** - * TransactionPusher + * TransactionPusher @Description: TransactionPusherInterface * - * @Description: TransactionPusherInterface * @author maojiayu * @data Jul 17, 2020 2:13:39 PM - * */ public interface TransactionPusherInterface { diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionSignerInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionSignerInterface.java index e39d40a5e..f162087c3 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionSignerInterface.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/executor/TransactionSignerInterface.java @@ -17,16 +17,12 @@ import org.fisco.bcos.sdk.client.response.BcosTransaction; /** - * TransactionSignerInterface + * TransactionSignerInterface @Description: TransactionSignerInterface * - * @Description: TransactionSignerInterface * @author maojiayu * @data Jul 17, 2020 11:11:24 AM - * */ public interface TransactionSignerInterface { - - byte[] sign(BcosTransaction bcosTransaction); - + byte[] sign(BcosTransaction bcosTransaction); } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionBuilderInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionBuilderInterface.java index 480c469aa..5fdfd6dfc 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionBuilderInterface.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionBuilderInterface.java @@ -15,21 +15,19 @@ package org.fisco.bcos.sdk.transaction.core.interf.function; import java.util.List; - import org.fisco.bcos.sdk.model.SolidityConstructor; import org.fisco.bcos.sdk.model.SolidityFunction; /** - * FunctionBuilderInterface + * FunctionBuilderInterface @Description: FunctionBuilderInterface * - * @Description: FunctionBuilderInterface * @author maojiayu * @data Jul 17, 2020 2:34:36 PM - * */ public interface FunctionBuilderInterface { - public SolidityFunction buildFunction(String contractName, String contractAddress, String functionName, List args); + public SolidityFunction buildFunction( + String contractName, String contractAddress, String functionName, List args); public SolidityConstructor buildConstructor(String contractName, List args); } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionEncoderInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionEncoderInterface.java index 3607405e8..4797ffced 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionEncoderInterface.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionEncoderInterface.java @@ -18,12 +18,10 @@ import org.fisco.bcos.sdk.model.SolidityFunction; /** - * FunctionEncoderInterface + * FunctionEncoderInterface @Description: FunctionEncoderInterface * - * @Description: FunctionEncoderInterface * @author maojiayu * @data Jul 17, 2020 2:46:31 PM - * */ public interface FunctionEncoderInterface { diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionReturnDecoderInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionReturnDecoderInterface.java index a90b07a3b..25a75062e 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionReturnDecoderInterface.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/core/interf/function/FunctionReturnDecoderInterface.java @@ -15,15 +15,12 @@ package org.fisco.bcos.sdk.transaction.core.interf.function; /** - * FunctionReturnDecoder + * FunctionReturnDecoder @Description: FunctionReturnDecoderInterface * - * @Description: FunctionReturnDecoderInterface * @author maojiayu * @data Jul 17, 2020 2:48:54 PM - * */ public interface FunctionReturnDecoderInterface { public String decodeCall(String rawInput, String abi); - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/EventLog.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/EventLog.java index 9186b3ff1..59b5b81ae 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/domain/EventLog.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/EventLog.java @@ -14,6 +14,4 @@ */ package org.fisco.bcos.sdk.transaction.domain; -public class EventLog { - -} +public class EventLog {} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/EventResultEntity.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/EventResultEntity.java index af15c821b..597fb3de6 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/domain/EventResultEntity.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/EventResultEntity.java @@ -14,6 +14,4 @@ */ package org.fisco.bcos.sdk.transaction.domain; -public class EventResultEntity { - -} +public class EventResultEntity {} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/InputAndOutputResult.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/InputAndOutputResult.java index c0a387adf..a469936a7 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/domain/InputAndOutputResult.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/InputAndOutputResult.java @@ -14,6 +14,4 @@ */ package org.fisco.bcos.sdk.transaction.domain; -public class InputAndOutputResult { - -} +public class InputAndOutputResult {} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/TransactionResponse.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/TransactionResponse.java index 84efddf15..1a00e5c35 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/domain/TransactionResponse.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/TransactionResponse.java @@ -14,6 +14,4 @@ */ package org.fisco.bcos.sdk.transaction.domain; -public class TransactionResponse { - -} +public class TransactionResponse {} diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallRequest.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallRequest.java index 102e6e483..c4d725ef7 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallRequest.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallRequest.java @@ -15,66 +15,47 @@ package org.fisco.bcos.sdk.transaction.domain.dto; /** - * CallRequest + * CallRequest @Description: CallRequest * - * @Description: CallRequest * @author maojiayu * @data Jul 17, 2020 3:09:48 PM - * */ public class CallRequest extends CommonRequest { private String from; private String to; private String encodedFunction; private String abi; - - /** - * @return the from - */ + + /** @return the from */ public String getFrom() { return from; } - /** - * @param from the from to set - */ + /** @param from the from to set */ public void setFrom(String from) { this.from = from; } - /** - * @return the to - */ + /** @return the to */ public String getTo() { return to; } - /** - * @param to the to to set - */ + /** @param to the to to set */ public void setTo(String to) { this.to = to; } - /** - * @return the encodedFunction - */ + /** @return the encodedFunction */ public String getEncodedFunction() { return encodedFunction; } - /** - * @param encodedFunction the encodedFunction to set - */ + /** @param encodedFunction the encodedFunction to set */ public void setEncodedFunction(String encodedFunction) { this.encodedFunction = encodedFunction; } - /** - * @return the abi - */ + /** @return the abi */ public String getAbi() { return abi; } - /** - * @param abi the abi to set - */ + /** @param abi the abi to set */ public void setAbi(String abi) { this.abi = abi; } - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallResponse.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallResponse.java index 9c0f27bb3..441e95312 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallResponse.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CallResponse.java @@ -15,26 +15,20 @@ package org.fisco.bcos.sdk.transaction.domain.dto; /** - * CallResponse + * CallResponse @Description: CallResponse * - * @Description: CallResponse * @author maojiayu * @data Jul 17, 2020 3:20:06 PM - * */ public class CallResponse extends CommonResponse { private String values; - /** - * @return the values - */ + /** @return the values */ public String getValues() { return values; } - /** - * @param values the values to set - */ + /** @param values the values to set */ public void setValues(String values) { this.values = values; } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonRequest.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonRequest.java index c6bcc3ff0..54cc8c99f 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonRequest.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonRequest.java @@ -15,29 +15,22 @@ package org.fisco.bcos.sdk.transaction.domain.dto; /** - * CommonTransactionRequest + * CommonTransactionRequest @Description: CommonRequest * - * @Description: CommonRequest * @author maojiayu * @data Jul 17, 2020 3:07:28 PM - * */ public class CommonRequest { private int groupId; - /** - * @return the groupId - */ + /** @return the groupId */ public int getGroupId() { return groupId; } - /** - * @param groupId the groupId to set - */ + /** @param groupId the groupId to set */ public void setGroupId(int groupId) { this.groupId = groupId; } - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonResponse.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonResponse.java index 0ca6c8249..08dc412c0 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonResponse.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/CommonResponse.java @@ -15,43 +15,32 @@ package org.fisco.bcos.sdk.transaction.domain.dto; /** - * CommonResponse + * CommonResponse @Description: CommonResponse * - * @Description: CommonResponse * @author maojiayu * @data Jul 17, 2020 3:15:35 PM - * */ public class CommonResponse { private int returnCode; private String returnMessage; - /** - * @return the returnCode - */ + /** @return the returnCode */ public int getReturnCode() { return returnCode; } - /** - * @param returnCode the returnCode to set - */ + /** @param returnCode the returnCode to set */ public void setReturnCode(int returnCode) { this.returnCode = returnCode; } - /** - * @return the returnMessage - */ + /** @return the returnMessage */ public String getReturnMessage() { return returnMessage; } - /** - * @param returnMessage the returnMessage to set - */ + /** @param returnMessage the returnMessage to set */ public void setReturnMessage(String returnMessage) { this.returnMessage = returnMessage; } - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionRequest.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionRequest.java index e76aec21c..17893e224 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionRequest.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionRequest.java @@ -15,43 +15,32 @@ package org.fisco.bcos.sdk.transaction.domain.dto; /** - * TransactionRequest + * TransactionRequest @Description: TransactionRequest * - * @Description: TransactionRequest * @author maojiayu * @data Jul 17, 2020 3:08:41 PM - * */ public class TransactionRequest extends CommonRequest { private String contractName; private String signedData; - /** - * @return the contractName - */ + /** @return the contractName */ public String getContractName() { return contractName; } - /** - * @param contractName the contractName to set - */ + /** @param contractName the contractName to set */ public void setContractName(String contractName) { this.contractName = contractName; } - /** - * @return the signedData - */ + /** @return the signedData */ public String getSignedData() { return signedData; } - /** - * @param signedData the signedData to set - */ + /** @param signedData the signedData to set */ public void setSignedData(String signedData) { this.signedData = signedData; } - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionResponse.java b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionResponse.java index 86444f18a..2110e59ca 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionResponse.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/domain/dto/TransactionResponse.java @@ -17,12 +17,10 @@ import org.fisco.bcos.sdk.client.response.BcosTransactionReceipt; /** - * TransactionResponse + * TransactionResponse @Description: TransactionResponse * - * @Description: TransactionResponse * @author maojiayu * @data Jul 17, 2020 3:16:51 PM - * */ public class TransactionResponse extends CommonResponse { private BcosTransactionReceipt bcosTransactionReceipt; @@ -30,66 +28,44 @@ public class TransactionResponse extends CommonResponse { private String values; private String events; private String receiptMessages; - /** - * @return the bcosTransactionReceipt - */ + /** @return the bcosTransactionReceipt */ public BcosTransactionReceipt getBcosTransactionReceipt() { return bcosTransactionReceipt; } - /** - * @param bcosTransactionReceipt the bcosTransactionReceipt to set - */ + /** @param bcosTransactionReceipt the bcosTransactionReceipt to set */ public void setBcosTransactionReceipt(BcosTransactionReceipt bcosTransactionReceipt) { this.bcosTransactionReceipt = bcosTransactionReceipt; } - /** - * @return the contractAddress - */ + /** @return the contractAddress */ public String getContractAddress() { return contractAddress; } - /** - * @param contractAddress the contractAddress to set - */ + /** @param contractAddress the contractAddress to set */ public void setContractAddress(String contractAddress) { this.contractAddress = contractAddress; } - /** - * @return the values - */ + /** @return the values */ public String getValues() { return values; } - /** - * @param values the values to set - */ + /** @param values the values to set */ public void setValues(String values) { this.values = values; } - /** - * @return the events - */ + /** @return the events */ public String getEvents() { return events; } - /** - * @param events the events to set - */ + /** @param events the events to set */ public void setEvents(String events) { this.events = events; } - /** - * @return the receiptMessages - */ + /** @return the receiptMessages */ public String getReceiptMessages() { return receiptMessages; } - /** - * @param receiptMessages the receiptMessages to set - */ + /** @param receiptMessages the receiptMessages to set */ public void setReceiptMessages(String receiptMessages) { this.receiptMessages = receiptMessages; } - - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManager.java b/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManager.java index 7d1280894..d8ae581ef 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManager.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManager.java @@ -15,7 +15,6 @@ package org.fisco.bcos.sdk.transaction.manager; import java.util.concurrent.CompletableFuture; - import org.fisco.bcos.sdk.client.RespCallback; import org.fisco.bcos.sdk.client.response.BcosTransactionReceipt; import org.fisco.bcos.sdk.transaction.domain.dto.CallRequest; @@ -24,12 +23,10 @@ import org.fisco.bcos.sdk.transaction.domain.dto.TransactionResponse; /** - * TransactionManager + * TransactionManager @Description: TransactionManager * - * @Description: TransactionManager * @author maojiayu * @data Jul 17, 2020 3:23:19 PM - * */ public class TransactionManager implements TransactionManagerInterface { @@ -52,14 +49,15 @@ public TransactionResponse sendTransaction(TransactionRequest transactionRequest } @Override - public BcosTransactionReceipt sendTransaction(int groupId, String signedTransaction, - RespCallback callback) { + public BcosTransactionReceipt sendTransaction( + int groupId, String signedTransaction, RespCallback callback) { // TODO Auto-generated method stub return null; } @Override - public CompletableFuture sendTransactionAsync(TransactionRequest transactionRequest) { + public CompletableFuture sendTransactionAsync( + TransactionRequest transactionRequest) { // TODO Auto-generated method stub return null; } @@ -75,5 +73,4 @@ public String getCurrentExternalAccountAddress() { // TODO Auto-generated method stub return null; } - } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManagerInterface.java b/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManagerInterface.java index bd2428982..59a19e283 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManagerInterface.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionManagerInterface.java @@ -15,7 +15,6 @@ package org.fisco.bcos.sdk.transaction.manager; import java.util.concurrent.CompletableFuture; - import org.fisco.bcos.sdk.client.RespCallback; import org.fisco.bcos.sdk.client.response.BcosTransactionReceipt; import org.fisco.bcos.sdk.transaction.domain.dto.CallRequest; @@ -24,12 +23,10 @@ import org.fisco.bcos.sdk.transaction.domain.dto.TransactionResponse; /** - * TransactionManagerInterface + * TransactionManagerInterface @Description: TransactionManagerInterface * - * @Description: TransactionManagerInterface * @author maojiayu * @data Jul 17, 2020 2:59:21 PM - * */ public interface TransactionManagerInterface { @@ -39,10 +36,11 @@ public interface TransactionManagerInterface { public TransactionResponse sendTransaction(TransactionRequest transactionRequest); - public BcosTransactionReceipt sendTransaction(int groupId, String signedTransaction, - RespCallback callback); + public BcosTransactionReceipt sendTransaction( + int groupId, String signedTransaction, RespCallback callback); - public CompletableFuture sendTransactionAsync(TransactionRequest transactionRequest); + public CompletableFuture sendTransactionAsync( + TransactionRequest transactionRequest); public CallResponse sendCall(CallRequest callRequest); diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/tools/ContractLoader.java b/src/main/java/org/fisco/bcos/sdk/transaction/tools/ContractLoader.java index 888a5644c..55a75dc5a 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/tools/ContractLoader.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/tools/ContractLoader.java @@ -17,12 +17,10 @@ import org.apache.commons.lang3.tuple.Pair; /** - * ContractLoader + * ContractLoader @Description: ContractLoader * - * @Description: ContractLoader * @author maojiayu * @data Jul 17, 2020 3:24:40 PM - * */ public class ContractLoader { private int readType; @@ -56,38 +54,30 @@ public Pair getABIAndBinaryByContractName(String contractName) { // TODO /* * public AbiDefinition getConstructorABIByContractName(String contractName) { - * + * * } - * + * * public List getFunctionABIListByContractName(String contractName) { - * + * * } */ - /** - * @return the readType - */ + /** @return the readType */ public int getReadType() { return readType; } - /** - * @param readType the readType to set - */ + /** @param readType the readType to set */ public void setReadType(int readType) { this.readType = readType; } - /** - * @return the path - */ + /** @return the path */ public String getPath() { return path; } - /** - * @param path the path to set - */ + /** @param path the path to set */ public void setPath(String path) { this.path = path; } diff --git a/src/main/java/org/fisco/bcos/sdk/transaction/tools/SolTypeConverter.java b/src/main/java/org/fisco/bcos/sdk/transaction/tools/SolTypeConverter.java index 560567573..5eef7c5eb 100644 --- a/src/main/java/org/fisco/bcos/sdk/transaction/tools/SolTypeConverter.java +++ b/src/main/java/org/fisco/bcos/sdk/transaction/tools/SolTypeConverter.java @@ -15,12 +15,10 @@ package org.fisco.bcos.sdk.transaction.tools; /** - * SolTypeConverter + * SolTypeConverter @Description: SolTypeConverter * - * @Description: SolTypeConverter * @author maojiayu * @data Jul 17, 2020 3:35:09 PM - * */ public class SolTypeConverter {