From 7ce9f38ffecbde3b6348bf2caa37c4185556267c Mon Sep 17 00:00:00 2001 From: ywy2090 <912554887@qq.com> Date: Fri, 4 Nov 2022 14:54:49 +0800 Subject: [PATCH 01/22] add extraData parasm for create raw transaction (#683) --- .../org/fisco/bcos/sdk/client/Client.java | 6 ++++ .../org/fisco/bcos/sdk/client/ClientImpl.java | 15 ++++++++ .../builder/TransactionBuilderService.java | 35 +++++++++++++++++-- .../encode/TransactionEncoderService.java | 2 +- .../manager/TransactionProcessor.java | 2 +- .../transaction/model/po/RawTransaction.java | 4 +-- 6 files changed, 57 insertions(+), 7 deletions(-) diff --git a/sdk-service/src/main/java/org/fisco/bcos/sdk/client/Client.java b/sdk-service/src/main/java/org/fisco/bcos/sdk/client/Client.java index 5f35b1bad..d3fd37a35 100644 --- a/sdk-service/src/main/java/org/fisco/bcos/sdk/client/Client.java +++ b/sdk-service/src/main/java/org/fisco/bcos/sdk/client/Client.java @@ -155,6 +155,12 @@ static Client build(Channel channel) { */ Integer getGroupId(); + /** @return */ + String getExtraData(); + + /** @param extraData */ + void setExtraData(String extraData); + /** * Ledger operation: send transaction * diff --git a/sdk-service/src/main/java/org/fisco/bcos/sdk/client/ClientImpl.java b/sdk-service/src/main/java/org/fisco/bcos/sdk/client/ClientImpl.java index 905efb9d9..761da2e39 100644 --- a/sdk-service/src/main/java/org/fisco/bcos/sdk/client/ClientImpl.java +++ b/sdk-service/src/main/java/org/fisco/bcos/sdk/client/ClientImpl.java @@ -73,6 +73,7 @@ public class ClientImpl implements Client { private final NodeVersion nodeVersion; private final GroupManagerService groupManagerService; private EventResource eventResource; + private String extraData = ""; protected ClientImpl( GroupManagerService groupManagerService, @@ -124,6 +125,20 @@ public Integer getGroupId() { return this.groupId; } + @Override + public String getExtraData() { + return extraData; + } + + @Override + public void setExtraData(String extraData) { + if (extraData != null) { + this.extraData = extraData; + } + + logger.info("setExtraData: {}", extraData); + } + @Override public SendTransaction sendRawTransaction(String signedTransactionData) { return this.jsonRpcService.sendRequestToGroup( diff --git a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/builder/TransactionBuilderService.java b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/builder/TransactionBuilderService.java index aaf4e0393..19bd01f6f 100644 --- a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/builder/TransactionBuilderService.java +++ b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/builder/TransactionBuilderService.java @@ -62,6 +62,35 @@ public static String createSignedTransaction( String functionName, List params) throws ABICodecException { + return createSignedTransaction( + cryptoSuite, groupId, chainId, blockLimit, abi, to, "", functionName, params); + } + + /** + * Create fisco bcos transaction + * + * @param cryptoSuite @See CryptoSuite + * @param groupId the group that need create transaction + * @param chainId default 1 + * @param blockLimit, cached limited block number + * @param abi, compiled contract abi + * @param to target address + * @param extraData + * @param functionName function name + * @param params object list of function paramater + * @return RawTransaction the signed transaction hexed string + */ + public static String createSignedTransaction( + CryptoSuite cryptoSuite, + int groupId, + int chainId, + BigInteger blockLimit, + String abi, + String to, + String extraData, + String functionName, + List params) + throws ABICodecException { ABICodec abiCodec = new ABICodec(cryptoSuite); String data = abiCodec.encodeMethod(abi, functionName, params); Random r = ThreadLocalRandom.current(); @@ -77,7 +106,7 @@ public static String createSignedTransaction( data, BigInteger.valueOf(chainId), BigInteger.valueOf(groupId), - ""); + extraData); TransactionEncoderService transactionEncoder = new TransactionEncoderService(cryptoSuite); return transactionEncoder.encodeAndSign(rawTransaction, cryptoSuite.getCryptoKeyPair()); } @@ -147,7 +176,7 @@ public RawTransaction createTransaction( BigInteger.ZERO, chainId, groupId, - null); + client.getExtraData()); } @Override @@ -162,7 +191,7 @@ public RawTransaction createTransaction( BigInteger.ZERO, chainId, groupId, - null); + client.getExtraData()); } /** @return the client */ diff --git a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/codec/encode/TransactionEncoderService.java b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/codec/encode/TransactionEncoderService.java index d3e5a3548..60f58c836 100644 --- a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/codec/encode/TransactionEncoderService.java +++ b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/codec/encode/TransactionEncoderService.java @@ -112,7 +112,7 @@ public static List asRlpValues( // add extra data!!! result.add(RlpString.create(rawTransaction.getFiscoChainId())); result.add(RlpString.create(rawTransaction.getGroupId())); - if (rawTransaction.getExtraData() == null) { + if (rawTransaction.getExtraData() == null || "".equals(rawTransaction.getExtraData())) { result.add(RlpString.create("")); } else { result.add( diff --git a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionProcessor.java b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionProcessor.java index 9d7b4c960..06e3e0fbc 100644 --- a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionProcessor.java +++ b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/manager/TransactionProcessor.java @@ -100,7 +100,7 @@ public String createSignedTransaction(String to, String data, CryptoKeyPair cryp BigInteger.ZERO, new BigInteger(this.chainId), BigInteger.valueOf(this.groupId), - ""); + client.getExtraData()); return transactionEncoder.encodeAndSign(rawTransaction, cryptoKeyPair); } } diff --git a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/model/po/RawTransaction.java b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/model/po/RawTransaction.java index 55578e434..321e2f53a 100644 --- a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/model/po/RawTransaction.java +++ b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/model/po/RawTransaction.java @@ -57,7 +57,7 @@ public static RawTransaction createContractTransaction( BigInteger gasLimit, BigInteger blockLimit, BigInteger value, - String init, + String data, BigInteger chainId, BigInteger groupId, String extraData) { @@ -69,7 +69,7 @@ public static RawTransaction createContractTransaction( blockLimit, "", value, - init, + data, chainId, groupId, extraData); From c7a8ad5f6c2a69374f8dc914fddd2e89d1a37c93 Mon Sep 17 00:00:00 2001 From: ywy2090 <912554887@qq.com> Date: Thu, 5 Jan 2023 14:46:27 +0800 Subject: [PATCH 02/22] update netty to 4.1.86 (#715) --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index a8c787bb0..2942778ec 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ ext { commonsLang3Version = "3.1" javapoetVersion = "1.7.0" picocliVersion = "3.6.0" - nettySMSSLContextVersion = "1.5.0" + nettySMSSLContextVersion = "1.5.1-SNAPSHOT" toml4jVersion = "0.7.2" bcprovJDK15onVersion = "1.60" webankJavaCryptoVersion = "1.0.2" @@ -36,7 +36,7 @@ ext { // integrationTest.mustRunAfter test allprojects { group = 'org.fisco-bcos.java-sdk' - version = '2.9.2' + version = '2.9.3-SNAPSHOT' apply plugin: 'maven' apply plugin: 'maven-publish' apply plugin: 'idea' From 85ac653e061784eda72fe97c7ab737829cbaf504 Mon Sep 17 00:00:00 2001 From: ywy2090 <912554887@qq.com> Date: Mon, 6 Feb 2023 11:03:17 +0800 Subject: [PATCH 03/22] update data-json to 2.14.2 version (#726) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 2942778ec..a83a64158 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ ext { ossrhPassword="xxx" } // jackson version - jacksonVersion = "2.13.4.2" + jacksonVersion = "2.14.2" commonsIOVersion = "2.4" commonsLang3Version = "3.1" javapoetVersion = "1.7.0" From f13854e8367cd996ad098d157394e2f9568592bb Mon Sep 17 00:00:00 2001 From: ywy2090 <912554887@qq.com> Date: Tue, 28 Mar 2023 14:11:17 +0800 Subject: [PATCH 04/22] =?UTF-8?q?abi=20support=20encode/decode=20bytes?= =?UTF-8?q?=E3=80=81bytesN=20data=20from=20or=20as=20hex=20string=20(#747)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/fisco/bcos/sdk/abi/ABICodec.java | 14 +++++ .../sdk/abi/wrapper/ABICodecJsonWrapper.java | 62 +++++++++++++++---- .../bcos/sdk/test/abi/ContractTypeTest.java | 61 +++++++++++++++++- 3 files changed, 122 insertions(+), 15 deletions(-) diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/ABICodec.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/ABICodec.java index 691c15ba1..aefc0ac15 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/ABICodec.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/ABICodec.java @@ -49,6 +49,20 @@ public ABICodec(CryptoSuite cryptoSuite) { abiDefinitionFactory = new ABIDefinitionFactory(cryptoSuite); } + public ABICodec(CryptoSuite cryptoSuite, boolean decodeBytesDataAsHexFormat) { + super(); + this.cryptoSuite = cryptoSuite; + abiDefinitionFactory = new ABIDefinitionFactory(cryptoSuite); + abiCodecJsonWrapper.setDecodeBytesDataAsHexFormat(decodeBytesDataAsHexFormat); + logger.info("decodeBytesDataAsHexFormat: {}", decodeBytesDataAsHexFormat); + } + + private boolean decodeBytesDataAsHexFormat = false; + + public boolean isDecodeBytesDataAsHexFormat() { + return decodeBytesDataAsHexFormat; + } + public CryptoSuite getCryptoSuite() { return cryptoSuite; } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecJsonWrapper.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecJsonWrapper.java index a09743bd1..0e3821a22 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecJsonWrapper.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecJsonWrapper.java @@ -32,6 +32,22 @@ public class ABICodecJsonWrapper { private ObjectMapper objectMapper = ObjectMapperFactory.getObjectMapper(); + public ABICodecJsonWrapper() {} + + public ABICodecJsonWrapper(boolean decodeBytesDataAsHexFormat) { + this.decodeBytesDataAsHexFormat = decodeBytesDataAsHexFormat; + } + + private boolean decodeBytesDataAsHexFormat = false; + + public boolean isDecodeBytesDataAsHexFormat() { + return decodeBytesDataAsHexFormat; + } + + public void setDecodeBytesDataAsHexFormat(boolean decodeBytesDataAsHexFormat) { + this.decodeBytesDataAsHexFormat = decodeBytesDataAsHexFormat; + } + private void errorReport(String path, String expected, String actual) throws InvalidParameterException { String errorMessage = @@ -294,6 +310,8 @@ public static byte[] tryDecodeInputData(String inputData) { } else { return Hex.decode(hexString); } + } else if (inputData.startsWith("0x")) { + return Hex.decode(inputData.substring(2)); } return null; } @@ -437,13 +455,23 @@ public JsonNode decode(ABIObject abiObject) { } case BYTES: { - return jsonNodeFactory.binaryNode( - abiObject.getBytesValue().getValue()); + byte[] value = abiObject.getBytesValue().getValue(); + if (decodeBytesDataAsHexFormat) { + return jsonNodeFactory.textNode("0x" + Hex.toHexString(value)); + } else { + return jsonNodeFactory.binaryNode( + abiObject.getBytesValue().getValue()); + } } case DBYTES: { - return jsonNodeFactory.binaryNode( - abiObject.getDynamicBytesValue().getValue()); + byte[] value = abiObject.getDynamicBytesValue().getValue(); + if (decodeBytesDataAsHexFormat) { + return jsonNodeFactory.textNode("0x" + Hex.toHexString(value)); + } else { + return jsonNodeFactory.binaryNode( + abiObject.getDynamicBytesValue().getValue()); + } } case STRING: { @@ -518,19 +546,27 @@ public List decode(ABIObject template, String buffer) { case BYTES: { byte[] value = ABICodecObject.formatBytesN(argObject); - byte[] base64Bytes = Base64.getEncoder().encode(value); - result.add(Base64EncodedDataPrefix + new String(base64Bytes)); + if (decodeBytesDataAsHexFormat) { + String hexString = Hex.toHexString(value); + result.add("0x" + hexString); + } else { + byte[] base64Bytes = Base64.getEncoder().encode(value); + result.add( + Base64EncodedDataPrefix + new String(base64Bytes)); + } break; } case DBYTES: { - byte[] base64Bytes = - Base64.getEncoder() - .encode( - argObject - .getDynamicBytesValue() - .getValue()); - result.add(Base64EncodedDataPrefix + new String(base64Bytes)); + byte[] value = argObject.getDynamicBytesValue().getValue(); + if (decodeBytesDataAsHexFormat) { + String hexString = Hex.toHexString(value); + result.add("0x" + hexString); + } else { + byte[] base64Bytes = Base64.getEncoder().encode(value); + result.add( + Base64EncodedDataPrefix + new String(base64Bytes)); + } break; } case STRING: diff --git a/sdk-abi/src/test/java/org/fisco/bcos/sdk/test/abi/ContractTypeTest.java b/sdk-abi/src/test/java/org/fisco/bcos/sdk/test/abi/ContractTypeTest.java index 9c1a1991f..e64c0f0e5 100644 --- a/sdk-abi/src/test/java/org/fisco/bcos/sdk/test/abi/ContractTypeTest.java +++ b/sdk-abi/src/test/java/org/fisco/bcos/sdk/test/abi/ContractTypeTest.java @@ -4,6 +4,8 @@ import java.util.Arrays; import java.util.Base64; import java.util.List; + +import org.bouncycastle.util.encoders.Hex; import org.fisco.bcos.sdk.abi.wrapper.ABICodecJsonWrapper; import org.fisco.bcos.sdk.abi.wrapper.ABIObject; import org.fisco.bcos.sdk.abi.wrapper.ABIObjectFactory; @@ -246,7 +248,7 @@ public void ContractFixedTypeCodecTest() throws IOException { String bytes1Base64 = Base64.getEncoder().encodeToString(bytes1.getBytes()); String bytes2 = "base64://" + Base64.getEncoder().encodeToString("HelloWorld 22222".getBytes()); String bytes3 = "base64://" + Base64.getEncoder().encodeToString("HelloWorld 33333".getBytes()); - String bytes32ValueHex = "hex://0x6162636465666768736466336577657277657272657772657765727765726565"; + String bytes32ValueHex = "0x6162636465666768736466336577657277657272657772657765727765726565"; String bytes32ValuePlain = "abcdefghsdf3ewerwerrewrewerweree"; String bytes32Base64 = "base64://YWJjZGVmZ2hzZGYzZXdlcndlcnJld3Jld2Vyd2VyZWU="; String bytes32PrettyString = "YWJjZGVmZ2hzZGYzZXdlcndlcnJld3Jld2Vyd2VyZWU="; @@ -260,6 +262,8 @@ public void ContractFixedTypeCodecTest() throws IOException { "[\"" + bytes1 + "\",\"" + bytes2 + "\",\"" + bytes3 + "\"]"); ABICodecJsonWrapper abiCodecJsonWrapper = new ABICodecJsonWrapper(); + // abiCodecJsonWrapper.setDecodeBytesDataAsHexFormat(true); + ABIObject encodeObject = abiCodecJsonWrapper.encode(inputObject, params); List decodeResult = abiCodecJsonWrapper.decode(outObject, encodeObject.encode()); @@ -294,7 +298,7 @@ public void ContractDynamicTypeCodecTest() throws IOException { String bytes2 = "base64://" + Base64.getEncoder().encodeToString("HelloWorld 22222".getBytes()); String bytes3 = "base64://" + Base64.getEncoder().encodeToString("HelloWorld 33333".getBytes()); - String bytes32ValueHex = "hex://0x6162636465666768736466336577657277657272657772657765727765726565"; + String bytes32ValueHex = "0x6162636465666768736466336577657277657272657772657765727765726565"; String bytes32ValuePlain = "abcdefghsdf3ewerwerrewrewerweree"; String bytes32Base64 = "base64://YWJjZGVmZ2hzZGYzZXdlcndlcnJld3Jld2Vyd2VyZWU="; String bytes32PrettyString = "YWJjZGVmZ2hzZGYzZXdlcndlcnJld3Jld2Vyd2VyZWU="; @@ -308,6 +312,8 @@ public void ContractDynamicTypeCodecTest() throws IOException { "[\"" + bytes1 + "\",\"" + bytes2 + "\",\"" + bytes3 + "\"]"); ABICodecJsonWrapper abiCodecJsonWrapper = new ABICodecJsonWrapper(); + // abiCodecJsonWrapper.setDecodeBytesDataAsHexFormat(true); + ABIObject encodeObject = abiCodecJsonWrapper.encode(inputObject, params); List decodeResult = abiCodecJsonWrapper.decode(outObject, encodeObject.encode()); @@ -327,6 +333,57 @@ public void ContractDynamicTypeCodecTest() throws IOException { "[ \"" + bytes1Base64 + "\", \"" + bytes2.substring("base64://".length()) + "\", \"" + bytes3.substring("base64://".length()) + "\" ]"); } + @Test + public void ContractDynamicTypeCodecTest0() throws IOException { + ABIObject inputObject = + ABIObjectFactory.createInputObject( + contractABIDefinition.getFunctions().get("setDynamicValue").get(0)); + + ABIObject outObject = + ABIObjectFactory.createOutputObject( + contractABIDefinition.getFunctions().get("getDynamicValue").get(0)); + + String bytes1 = "HelloWorld 11111"; + String bytes1Base64 = Base64.getEncoder().encodeToString(bytes1.getBytes()); + String bytes1Hex = "0x" + Hex.toHexString(bytes1.getBytes()); + String bytes2 = "0x" + Hex.toHexString("HelloWorld 22222".getBytes()); + String bytes3 = "0x" + Hex.toHexString("HelloWorld 33333".getBytes()); + + String bytes32ValueHex = "0x6162636465666768736466336577657277657272657772657765727765726565"; + String bytes32ValuePlain = "abcdefghsdf3ewerwerrewrewerweree"; + // String bytes32Base64 = "base64://YWJjZGVmZ2hzZGYzZXdlcndlcnJld3Jld2Vyd2VyZWU="; + String bytes32PrettyString = "YWJjZGVmZ2hzZGYzZXdlcndlcnJld3Jld2Vyd2VyZWU="; + List params = + Arrays.asList( + "[1,2,3]", + "[true,false,true]", + "[\"0xa\",\"0xb\",\"0xc\"]", + "[\"" + bytes32ValueHex + "\",\"" + bytes32ValuePlain + "\",\"" + bytes32ValueHex + "\"]", + "[\"a\",\"b\",\"c\"]", + "[\"" + bytes1 + "\",\"" + bytes2 + "\",\"" + bytes3 + "\"]"); + + ABICodecJsonWrapper abiCodecJsonWrapper = new ABICodecJsonWrapper(); + abiCodecJsonWrapper.setDecodeBytesDataAsHexFormat(true); + + ABIObject encodeObject = abiCodecJsonWrapper.encode(inputObject, params); + + List decodeResult = abiCodecJsonWrapper.decode(outObject, encodeObject.encode()); + + Assert.assertEquals(decodeResult.get(0), "[ 1, 2, 3 ]"); + Assert.assertEquals(decodeResult.get(1), "[ true, false, true ]"); + Assert.assertEquals( + decodeResult.get(2), + "[ \"0x000000000000000000000000000000000000000a\", \"0x000000000000000000000000000000000000000b\", \"0x000000000000000000000000000000000000000c\" ]"); + Assert.assertEquals( + decodeResult.get(3), + "[ \"" + bytes32ValueHex + "\", \"" + bytes32ValueHex + "\", \"" + bytes32ValueHex + "\" ]"); + + Assert.assertEquals(decodeResult.get(4), "[ \"a\", \"b\", \"c\" ]"); + Assert.assertEquals( + decodeResult.get(5), + "[ \"" + bytes1Hex + "\", \"" + bytes2 + "\", \"" + bytes3 + "\" ]"); + } + @Test public void ContractDynamicTypeEmptyParamsCodecTest() throws IOException { ABIObject inputObject = From 54fe637836c7c362efd15b7a46b07cbac8bc871f Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Wed, 17 May 2023 18:57:43 +0800 Subject: [PATCH 05/22] (codec): fix abiCodecObject int bug. (#776) --- .../java/org/fisco/bcos/sdk/abi/wrapper/ABICodecObject.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecObject.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecObject.java index c147f00ee..2c0197ddb 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecObject.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecObject.java @@ -216,7 +216,7 @@ public ABIObject encodeValue(ABIObject template, Object value) { abiObject.setNumericValue(new Int256((BigInteger) value)); } else if (NumberUtils.isNumber(value.toString())) { abiObject.setNumericValue( - new Uint256((new BigInteger(value.toString())))); + new Int256((new BigInteger(value.toString())))); } else { errorReport( " valueType mismatch", From 912b5abbfd11984707618d66b763914400b34eb9 Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Mon, 29 May 2023 19:57:48 +0800 Subject: [PATCH 06/22] (project): update dependencies version. (#784) --- build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index a83a64158..424dadf39 100644 --- a/build.gradle +++ b/build.gradle @@ -20,14 +20,14 @@ ext { commonsLang3Version = "3.1" javapoetVersion = "1.7.0" picocliVersion = "3.6.0" - nettySMSSLContextVersion = "1.5.1-SNAPSHOT" + nettySMSSLContextVersion = "1.5.1" toml4jVersion = "0.7.2" bcprovJDK15onVersion = "1.60" webankJavaCryptoVersion = "1.0.2" webankHsmCryptoVersion = "1.0.0-GMT0018" - slf4jVersion = "1.7.32" - junitVersion = "4.12" + slf4jVersion = "1.7.36" + junitVersion = '4.13.1' commonsCollections4Version = "4.4" guavaVersion = "29.0-jre" } @@ -36,7 +36,7 @@ ext { // integrationTest.mustRunAfter test allprojects { group = 'org.fisco-bcos.java-sdk' - version = '2.9.3-SNAPSHOT' + version = '2.9.3' apply plugin: 'maven' apply plugin: 'maven-publish' apply plugin: 'idea' From a913c308c592dd7fb3f60662cdb0ee358bfd7d13 Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Wed, 14 Jun 2023 19:30:44 +0800 Subject: [PATCH 07/22] (abi): fix bytes decode to hex string bug. (#785) --- .github/workflows/workflow.yml | 2 +- .../java/org/fisco/bcos/sdk/abi/ABICodec.java | 7 - .../sdk/abi/wrapper/ABICodecJsonWrapper.java | 7 +- .../manager/AssembleTxCodecTest.java | 441 ++++++++++++++++++ .../manager/ContractConstructorTest.java | 15 +- .../resources/ecdsa/abi/ComplexCodecTest.abi | 1 + .../resources/ecdsa/bin/ComplexCodecTest.bin | 1 + .../resources/gm/abi/ComplexCodecTest.abi | 1 + .../resources/gm/bin/ComplexCodecTest.bin | 1 + 9 files changed, 459 insertions(+), 17 deletions(-) create mode 100644 src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTxCodecTest.java create mode 100644 src/test/resources/ecdsa/abi/ComplexCodecTest.abi create mode 100644 src/test/resources/ecdsa/bin/ComplexCodecTest.bin create mode 100644 src/test/resources/gm/abi/ComplexCodecTest.abi create mode 100644 src/test/resources/gm/bin/ComplexCodecTest.bin diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index b1507c8a6..8e884390f 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-18.04, ubuntu-20.04, macos-latest] + os: [ubuntu-20.04, ubuntu-22.04, macos-latest] steps: - uses: actions/checkout@v2 with: diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/ABICodec.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/ABICodec.java index aefc0ac15..81583823c 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/ABICodec.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/ABICodec.java @@ -216,7 +216,6 @@ public String encodeMethodFromString(String ABI, String methodName, List for (ABIDefinition abiDefinition : methods) { if (abiDefinition.getInputs().size() == params.size()) { ABIObject inputABIObject = abiObjectFactory.createInputObject(abiDefinition); - ABICodecJsonWrapper abiCodecJsonWrapper = new ABICodecJsonWrapper(); try { String methodId = abiDefinition.getMethodId(cryptoSuite); return methodId + abiCodecJsonWrapper.encode(inputABIObject, params).encode(); @@ -242,7 +241,6 @@ public String encodeMethodByIdFromString(String ABI, String methodId, List decodeMethodToString(String ABI, String methodName, String o } for (ABIDefinition abiDefinition : methods) { ABIObject outputABIObject = abiObjectFactory.createOutputObject(abiDefinition); - ABICodecJsonWrapper abiCodecJsonWrapper = new ABICodecJsonWrapper(); try { return abiCodecJsonWrapper.decode(outputABIObject, output); } catch (Exception e) { @@ -473,7 +469,6 @@ public List decodeMethodByIdToString( } else { outputABIObject = abiObjectFactory.createInputObject(abiDefinition); } - ABICodecJsonWrapper abiCodecJsonWrapper = new ABICodecJsonWrapper(); try { return abiCodecJsonWrapper.decode(outputABIObject, data); } catch (UnsupportedOperationException e) { @@ -568,7 +563,6 @@ public List decodeEventToString(String ABI, String eventName, EventLog l } for (ABIDefinition abiDefinition : events) { ABIObject inputObject = abiObjectFactory.createEventInputObject(abiDefinition); - ABICodecJsonWrapper abiCodecJsonWrapper = new ABICodecJsonWrapper(); try { List params = new ArrayList<>(); if (!log.getData().equals("0x")) { @@ -592,7 +586,6 @@ public List decodeEventByTopicToString(String ABI, String eventTopic, Ev ABIDefinition abiDefinition = contractABIDefinition.getABIDefinitionByEventTopic(eventTopic); ABIObject inputObject = abiObjectFactory.createEventInputObject(abiDefinition); - ABICodecJsonWrapper abiCodecJsonWrapper = new ABICodecJsonWrapper(); try { List params = new ArrayList<>(); if (!log.getData().equals("0x")) { diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecJsonWrapper.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecJsonWrapper.java index 0e3821a22..4a2d5d076 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecJsonWrapper.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecJsonWrapper.java @@ -312,8 +312,13 @@ public static byte[] tryDecodeInputData(String inputData) { } } else if (inputData.startsWith("0x")) { return Hex.decode(inputData.substring(2)); + } else { + try { + return Hex.decode(inputData); + } catch (Exception ignored) { + return null; + } } - return null; } public ABIObject encode(ABIObject template, List inputs) throws IOException { diff --git a/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTxCodecTest.java b/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTxCodecTest.java new file mode 100644 index 000000000..8f40f4234 --- /dev/null +++ b/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTxCodecTest.java @@ -0,0 +1,441 @@ +package org.fisco.bcos.sdk.transaction.manager; + +import java.util.ArrayList; +import java.util.List; +import org.apache.commons.lang3.StringUtils; +import org.fisco.bcos.sdk.BcosSDK; +import org.fisco.bcos.sdk.abi.datatypes.*; +import org.fisco.bcos.sdk.abi.datatypes.generated.Bytes32; +import org.fisco.bcos.sdk.abi.wrapper.ABIObject; +import org.fisco.bcos.sdk.client.Client; +import org.fisco.bcos.sdk.crypto.keypair.CryptoKeyPair; +import org.fisco.bcos.sdk.model.ConstantConfig; +import org.fisco.bcos.sdk.transaction.model.dto.CallResponse; +import org.fisco.bcos.sdk.transaction.model.dto.TransactionResponse; +import org.fisco.bcos.sdk.transaction.tools.JsonUtils; +import org.fisco.bcos.sdk.utils.Hex; +import org.junit.Assert; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class AssembleTxCodecTest { + private static final String CONFIG_FILE = + "src/integration-test/resources/" + ConstantConfig.CONFIG_FILE_NAME; + private static final String ABI_FILE = "src/integration-test/resources/abi/"; + private static final String BIN_FILE = "src/integration-test/resources/bin/"; + + private static final String COMPLEX_CODEC_TEST = "ComplexCodecTest"; + + private final AssembleTransactionProcessor transactionProcessor; + + public AssembleTxCodecTest() throws Exception { + // init the sdk, and set the config options. + BcosSDK sdk = BcosSDK.build(CONFIG_FILE); + // group + Client client = sdk.getClient(1); + CryptoKeyPair cryptoKeyPair = client.getCryptoSuite().getCryptoKeyPair(); + transactionProcessor = + TransactionProcessorFactory.createAssembleTransactionProcessor( + client, cryptoKeyPair, ABI_FILE, BIN_FILE); + } + + @Test + public void test2ComplexCodecWithStringParams() throws Exception { + // test deploy with struct + List deployParams = new ArrayList<>(); + + deployParams.add( + "[[\"test\"],[\"ffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff\"]]"); + String abi = + transactionProcessor.getContractLoader().getABIByContractName(COMPLEX_CODEC_TEST); + String bin = + transactionProcessor + .getContractLoader() + .getBinaryByContractName(COMPLEX_CODEC_TEST); + TransactionResponse response = + transactionProcessor.deployAndGetResponseWithStringParams(abi, bin, deployParams); + Assert.assertEquals(response.getTransactionReceipt().getStatus(), "0x0"); + String contractAddress = response.getContractAddress(); + Assert.assertTrue(StringUtils.isNotBlank(response.getContractAddress())); + + // test call send struct get struct + { + List callParams = new ArrayList<>(); + // use no params method + CallResponse callResponse1 = + transactionProcessor.sendCallWithStringParams( + "0xf6f0484c6706bda3801a2713c31a883caab05e01", + contractAddress, + abi, + "getStructA", + callParams); + List returnObject = callResponse1.getReturnObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(callResponse1.getReturnABIObject().size(), 1); + System.out.println(JsonUtils.toJson(returnObject)); + + // use one params method + callParams.add( + "[[\"test2312312312312\"],[\"ffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff\"]]"); + CallResponse callResponse2 = + transactionProcessor.sendCallWithStringParams( + "0xf6f0484c6706bda3801a2713c31a883caab05e01", + contractAddress, + abi, + "getStructA", + callParams); + returnObject = callResponse2.getReturnObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(callResponse2.getReturnABIObject().size(), 1); + System.out.println(JsonUtils.toJson(returnObject)); + } + + // test bytes[][] set and get + { + List params = new ArrayList<>(); + params.add("[[\"0xabcd\"],[\"0x1234\"]]"); + TransactionResponse transactionResponse = + transactionProcessor.sendTransactionWithStringParamsAndGetResponse( + contractAddress, abi, "setBytesArrayArray", params); + Assert.assertEquals(transactionResponse.getTransactionReceipt().getStatus(), "0x0"); + List returnObject = transactionResponse.getReturnObject(); + List returnABIObject = transactionResponse.getReturnABIObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(returnABIObject.size(), 1); + } + + // test bytes32[][] set and get + { + List params = new ArrayList<>(); + params.add( + "[[\"0xffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff\",\"0xffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff\"],[\"0xffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff\"]]"); + + TransactionResponse transactionResponse = + transactionProcessor.sendTransactionWithStringParamsAndGetResponse( + contractAddress, abi, "setBytes32ArrayArray", params); + Assert.assertEquals(transactionResponse.getTransactionReceipt().getStatus(), "0x0"); + List returnObject = transactionResponse.getReturnObject(); + List returnABIObject = transactionResponse.getReturnABIObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(returnABIObject.size(), 1); + System.out.println("setBytes32ArrayArray, bytes32[][]"); + System.out.println(JsonUtils.toJson(returnObject)); + } + + // test bytes[2][] set and get + { + List params = new ArrayList<>(); + params.add( + "[[\"0xabcdef\",\"0xffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff\"],[\"0xffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff\",\"0x1234\"]]"); + + TransactionResponse transactionResponse = + transactionProcessor.sendTransactionWithStringParamsAndGetResponse( + contractAddress, abi, "setBytesStaticArrayArray", params); + Assert.assertEquals(transactionResponse.getTransactionReceipt().getStatus(), "0x0"); + List returnObject = transactionResponse.getReturnObject(); + List returnABIObject = transactionResponse.getReturnABIObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(returnABIObject.size(), 1); + System.out.println("setBytesStaticArrayArray, bytes[2][]"); + System.out.println(JsonUtils.toJson(returnObject)); + } + + // test bytes32[2][] set and get + { + List params = new ArrayList<>(); + params.add( + "[[\"0x1234567890123456789012345678901234567890123456789012345678901234\",\"0xffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff\"],[\"0x1234567890123456789012345678901234567890123456789012345678901234\",\"0xffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff\"],[\"0xffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff\",\"0x1234567890123456789012345678901234567890123456789012345678901234\"]]"); + TransactionResponse transactionResponse = + transactionProcessor.sendTransactionWithStringParamsAndGetResponse( + contractAddress, abi, "setBytes32StaticArrayArray", params); + Assert.assertEquals(transactionResponse.getTransactionReceipt().getStatus(), "0x0"); + List returnObject = transactionResponse.getReturnObject(); + List returnABIObject = transactionResponse.getReturnABIObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(returnABIObject.size(), 1); + System.out.println("setBytes32StaticArrayArray, bytes32[2][]"); + System.out.println(JsonUtils.toJson(returnObject)); + } + + // test struct set and get + { + List params = new ArrayList<>(); + params.add( + "[[\"12312314565456345test\"],[\"ffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff\"]]"); + + TransactionResponse transactionResponse = + transactionProcessor.sendTransactionWithStringParamsAndGetResponse( + contractAddress, abi, "buildStructB", params); + Assert.assertEquals(transactionResponse.getTransactionReceipt().getStatus(), "0x0"); + List returnObject = transactionResponse.getReturnObject(); + List returnABIObject = transactionResponse.getReturnABIObject(); + Assert.assertEquals(returnObject.size(), 2); + Assert.assertEquals(returnABIObject.size(), 2); + System.out.println("buildStructB, StructB, StructA[]"); + System.out.println(JsonUtils.toJsonWithException(returnObject)); + } + + // test static struct set and get + { + List params = new ArrayList<>(); + params.add("[-128,129,[32]]"); + // use static struct params, get single struct + + TransactionResponse transactionResponse = + transactionProcessor.sendTransactionWithStringParamsAndGetResponse( + contractAddress, abi, "buildStaticStruct", params); + Assert.assertEquals(transactionResponse.getTransactionReceipt().getStatus(), "0x0"); + List returnObject = transactionResponse.getReturnObject(); + List returnABIObject = transactionResponse.getReturnABIObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(returnABIObject.size(), 1); + System.out.println("buildStaticStruct, staticStruct"); + System.out.println(JsonUtils.toJsonWithException(returnObject)); + // use number params, get static struct list + + List params2 = new ArrayList<>(); + params2.add("-256"); + params2.add("12321421"); + TransactionResponse transactionResponse2 = + transactionProcessor.sendTransactionWithStringParamsAndGetResponse( + contractAddress, abi, "buildStaticStruct", params2); + Assert.assertEquals(transactionResponse.getTransactionReceipt().getStatus(), "0x0"); + returnObject = transactionResponse2.getReturnObject(); + returnABIObject = transactionResponse2.getReturnABIObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(returnABIObject.size(), 1); + System.out.println("buildStaticStruct, staticStruct[]"); + System.out.println(JsonUtils.toJsonWithException(returnObject)); + } + } + + @Test + public void test1ComplexCodecWithJavaObject() throws Exception { + // test deploy with struct + List deployParams = new ArrayList<>(); + { + // struct StructA { + // string[] value_str; + // bytes32[] bytes32_in_struct; + // } + List array = new ArrayList<>(); + array.add("test"); + List bytes = new ArrayList<>(); + byte[] b = Bytes32.DEFAULT.getValue(); + bytes.add(b); + List structA = new ArrayList<>(); + structA.add(array); + structA.add(bytes); + deployParams.add(structA); + } + TransactionResponse response = + transactionProcessor.deployByContractLoader(COMPLEX_CODEC_TEST, deployParams); + Assert.assertEquals(response.getTransactionReceipt().getStatus(), "0x0"); + String contractAddress = response.getContractAddress(); + Assert.assertTrue(StringUtils.isNotBlank(response.getContractAddress())); + + // test call get struct + { + // not params method + CallResponse callResponse1 = + transactionProcessor.sendCallByContractLoader( + COMPLEX_CODEC_TEST, contractAddress, "getStructA", new ArrayList<>()); + List returnObject = callResponse1.getReturnObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(callResponse1.getReturnABIObject().size(), 1); + System.out.println(JsonUtils.toJson(returnObject)); + + // struct StructA { + // string[] value_str; + // bytes32[] bytes32_in_struct; + // } + List callParams = new ArrayList<>(); + List array = new ArrayList<>(); + array.add("test31241233123"); + List bytes = new ArrayList<>(); + byte[] b = Bytes32.DEFAULT.getValue(); + byte[] b2 = Bytes32.DEFAULT.getValue(); + bytes.add(b); + bytes.add(b2); + List structA = new ArrayList<>(); + structA.add(array); + structA.add(bytes); + callParams.add(structA); + CallResponse callResponse2 = + transactionProcessor.sendCallByContractLoader( + COMPLEX_CODEC_TEST, contractAddress, "getStructA", callParams); + + returnObject = callResponse2.getReturnObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(callResponse2.getReturnABIObject().size(), 1); + System.out.println("getStructA:"); + System.out.println(JsonUtils.toJson(returnObject)); + } + + // test bytes[][] set and get + { + List params = new ArrayList<>(); + byte[] b = "1234".getBytes(); + List bs = new ArrayList<>(); + bs.add(b); + List> bss = new ArrayList<>(); + bss.add(bs); + params.add(bss); + + TransactionResponse transactionResponse = + transactionProcessor.sendTransactionAndGetResponseByContractLoader( + COMPLEX_CODEC_TEST, contractAddress, "setBytesArrayArray", params); + Assert.assertEquals(transactionResponse.getTransactionReceipt().getStatus(), "0x0"); + List returnObject = transactionResponse.getReturnObject(); + List returnABIObject = transactionResponse.getReturnABIObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(returnABIObject.size(), 1); + System.out.println("setBytesArrayArray, bytes[][]"); + System.out.println(JsonUtils.toJson(returnObject)); + } + + // test bytes32[][] set and get + { + List params = new ArrayList<>(); + byte[] b = + Hex.decode("ffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff"); + List bs = new ArrayList<>(); + bs.add(b); + List> bss = new ArrayList<>(); + bss.add(bs); + params.add(bss); + + TransactionResponse transactionResponse = + transactionProcessor.sendTransactionAndGetResponseByContractLoader( + COMPLEX_CODEC_TEST, contractAddress, "setBytes32ArrayArray", params); + Assert.assertEquals(transactionResponse.getTransactionReceipt().getStatus(), "0x0"); + List returnObject = transactionResponse.getReturnObject(); + List returnABIObject = transactionResponse.getReturnABIObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(returnABIObject.size(), 1); + System.out.println("setBytes32ArrayArray, bytes32[][]"); + System.out.println(JsonUtils.toJson(returnObject)); + } + + // test bytes[2][] set and get + { + List params = new ArrayList<>(); + byte[] b1 = + Hex.decode("ffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff"); + byte[] b2 = DynamicBytes.DEFAULT.getValue(); + List bs = new ArrayList<>(); + bs.add(b1); + bs.add(b2); + List> bss = new ArrayList<>(); + bss.add(bs); + params.add(bss); + + TransactionResponse transactionResponse = + transactionProcessor.sendTransactionAndGetResponseByContractLoader( + COMPLEX_CODEC_TEST, + contractAddress, + "setBytesStaticArrayArray", + params); + Assert.assertEquals(transactionResponse.getTransactionReceipt().getStatus(), "0x0"); + List returnObject = transactionResponse.getReturnObject(); + List returnABIObject = transactionResponse.getReturnABIObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(returnABIObject.size(), 1); + System.out.println("setBytesStaticArrayArray, bytes[2][]"); + System.out.println(JsonUtils.toJson(returnObject)); + } + + // test bytes32[2][] set and get + { + List params = new ArrayList<>(); + byte[] b1 = + Hex.decode("ffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff"); + byte[] b2 = Bytes32.DEFAULT.getValue(); + List bs = new ArrayList<>(); + bs.add(b1); + bs.add(b2); + List> bss = new ArrayList<>(); + bss.add(bs); + params.add(bss); + + TransactionResponse transactionResponse = + transactionProcessor.sendTransactionAndGetResponseByContractLoader( + COMPLEX_CODEC_TEST, + contractAddress, + "setBytes32StaticArrayArray", + params); + Assert.assertEquals(transactionResponse.getTransactionReceipt().getStatus(), "0x0"); + List returnObject = transactionResponse.getReturnObject(); + List returnABIObject = transactionResponse.getReturnABIObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(returnABIObject.size(), 1); + System.out.println("setBytes32StaticArrayArray, bytes32[2][]"); + System.out.println(JsonUtils.toJson(returnObject)); + } + + // test struct set and get + { + List params = new ArrayList<>(); + List array = new ArrayList<>(); + array.add("test2132131"); + List bytes32DynamicArray = new ArrayList<>(); + bytes32DynamicArray.add(Bytes32.DEFAULT.getValue()); + List structA = new ArrayList<>(); + structA.add(array); + structA.add(bytes32DynamicArray); + params.add(structA); + + TransactionResponse transactionResponse = + transactionProcessor.sendTransactionAndGetResponseByContractLoader( + COMPLEX_CODEC_TEST, contractAddress, "buildStructB", params); + Assert.assertEquals(transactionResponse.getTransactionReceipt().getStatus(), "0x0"); + List returnObject = transactionResponse.getReturnObject(); + List returnABIObject = transactionResponse.getReturnABIObject(); + Assert.assertEquals(returnObject.size(), 2); + Assert.assertEquals(returnABIObject.size(), 2); + System.out.println("buildStructB, StructB, StructA[]"); + System.out.println(JsonUtils.toJsonWithException(returnObject)); + } + + // test static struct set and get + { + List params = new ArrayList<>(); + List staticArray = new ArrayList<>(); + staticArray.add(1); + List struct = new ArrayList<>(); + struct.add(128); + struct.add(127); + struct.add(staticArray); + params.add(struct); + + // use static struct params, get single struct + TransactionResponse transactionResponse = + transactionProcessor.sendTransactionAndGetResponseByContractLoader( + COMPLEX_CODEC_TEST, contractAddress, "buildStaticStruct", params); + Assert.assertEquals(transactionResponse.getTransactionReceipt().getStatus(), "0x0"); + List returnObject = transactionResponse.getReturnObject(); + List returnABIObject = transactionResponse.getReturnABIObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(returnABIObject.size(), 1); + System.out.println("buildStaticStruct, staticStruct"); + System.out.println(JsonUtils.toJsonWithException(returnObject)); + + // use number params, get static struct list + List params2 = new ArrayList<>(); + params2.add(256); + params2.add(288); + TransactionResponse transactionResponse2 = + transactionProcessor.sendTransactionAndGetResponseByContractLoader( + COMPLEX_CODEC_TEST, contractAddress, "buildStaticStruct", params); + Assert.assertEquals(transactionResponse2.getTransactionReceipt().getStatus(), "0x0"); + returnObject = transactionResponse2.getReturnObject(); + returnABIObject = transactionResponse2.getReturnABIObject(); + Assert.assertEquals(returnObject.size(), 1); + Assert.assertEquals(returnABIObject.size(), 1); + System.out.println("buildStaticStruct, staticStruct[]"); + System.out.println(JsonUtils.toJsonWithException(returnObject)); + } + } +} diff --git a/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/ContractConstructorTest.java b/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/ContractConstructorTest.java index cc059c189..335a2f8c2 100644 --- a/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/ContractConstructorTest.java +++ b/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/ContractConstructorTest.java @@ -9,6 +9,7 @@ import org.fisco.bcos.sdk.crypto.keypair.CryptoKeyPair; import org.fisco.bcos.sdk.model.ConstantConfig; import org.fisco.bcos.sdk.transaction.model.dto.TransactionResponse; +import org.fisco.bcos.sdk.transaction.tools.JsonUtils; import org.junit.Assert; import org.junit.Test; @@ -31,22 +32,20 @@ public void test2ComplexDeploy() throws Exception { client, cryptoKeyPair, abiFile, binFile); // deploy List params = Lists.newArrayList(); - params.add("1"); + params.add(1); params.add("2"); - params.add("3"); - params.add("4"); - String abi = FileUtils.readFileToString(new File(abiFile + "CheckInfoManager.abi")); - String bin = FileUtils.readFileToString(new File(binFile + "CheckInfoManager.bin")); + String abi = FileUtils.readFileToString(new File(abiFile + "ComplexSol.abi")); + String bin = FileUtils.readFileToString(new File(binFile + "ComplexSol.bin")); TransactionResponse txResponse = transactionProcessor.deployAndGetResponse(abi, bin, params); - // System.out.println(JsonUtils.toJson(txResponse)); + System.out.println(JsonUtils.toJson(txResponse)); Assert.assertEquals("0x0", txResponse.getTransactionReceipt().getStatus()); TransactionResponse response = - transactionProcessor.deployByContractLoader("CheckInfoManager", params); - // System.out.println(JsonUtils.toJson(response)); + transactionProcessor.deployByContractLoader("ComplexSol", params); + System.out.println(JsonUtils.toJson(response)); Assert.assertEquals("0x0", response.getTransactionReceipt().getStatus()); } } diff --git a/src/test/resources/ecdsa/abi/ComplexCodecTest.abi b/src/test/resources/ecdsa/abi/ComplexCodecTest.abi new file mode 100644 index 000000000..e7a815a37 --- /dev/null +++ b/src/test/resources/ecdsa/abi/ComplexCodecTest.abi @@ -0,0 +1 @@ +[{"inputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA","name":"a","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"b32_array_array","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"b32_s_array_array","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"b_array_array","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"b_s_array_array","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"int128","name":"i1","type":"int128"},{"internalType":"uint128","name":"u1","type":"uint128"},{"internalType":"int32[1]","name":"b1","type":"int32[1]"}],"internalType":"struct StaticStruct","name":"b","type":"tuple"}],"name":"buildStaticStruct","outputs":[{"components":[{"internalType":"int128","name":"i1","type":"int128"},{"internalType":"uint128","name":"u1","type":"uint128"},{"internalType":"int32[1]","name":"b1","type":"int32[1]"}],"internalType":"struct StaticStruct","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int128","name":"i1","type":"int128"},{"internalType":"uint128","name":"u1","type":"uint128"}],"name":"buildStaticStruct","outputs":[{"components":[{"internalType":"int128","name":"i1","type":"int128"},{"internalType":"uint128","name":"u1","type":"uint128"},{"internalType":"int32[1]","name":"b1","type":"int32[1]"}],"internalType":"struct StaticStruct[]","name":"","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"value_str","type":"string"},{"internalType":"bytes32[]","name":"_b","type":"bytes32[]"}],"name":"buildStructA","outputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"value_str","type":"string"},{"internalType":"bytes32[]","name":"_b","type":"bytes32[]"},{"internalType":"uint8","name":"size","type":"uint8"}],"name":"buildStructA","outputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA[]","name":"","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA","name":"a","type":"tuple"}],"name":"buildStructB","outputs":[{"components":[{"internalType":"string[]","name":"d_str","type":"string[]"},{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA[]","name":"a_struct","type":"tuple[]"}],"internalType":"struct StructB","name":"","type":"tuple"},{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA[]","name":"","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getStructA","outputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA","name":"a","type":"tuple"}],"name":"getStructA","outputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string[]","name":"d_str","type":"string[]"},{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA[]","name":"a_struct","type":"tuple[]"}],"internalType":"struct StructB","name":"b","type":"tuple"}],"name":"getStructAInStructB","outputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[][]","name":"b","type":"bytes32[][]"}],"name":"setBytes32ArrayArray","outputs":[{"internalType":"bytes32[][]","name":"","type":"bytes32[][]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[2][]","name":"b","type":"bytes32[2][]"}],"name":"setBytes32StaticArrayArray","outputs":[{"internalType":"bytes32[2][]","name":"","type":"bytes32[2][]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[][]","name":"b","type":"bytes[][]"}],"name":"setBytesArrayArray","outputs":[{"internalType":"bytes[][]","name":"","type":"bytes[][]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[2][]","name":"b","type":"bytes[2][]"}],"name":"setBytesStaticArrayArray","outputs":[{"internalType":"bytes[2][]","name":"","type":"bytes[2][]"}],"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file diff --git a/src/test/resources/ecdsa/bin/ComplexCodecTest.bin b/src/test/resources/ecdsa/bin/ComplexCodecTest.bin new file mode 100644 index 000000000..2ce316bc5 --- /dev/null +++ b/src/test/resources/ecdsa/bin/ComplexCodecTest.bin @@ -0,0 +1 @@ +60806040523480156200001157600080fd5b5060405162002f7938038062002f79833981016040819052620000349162000329565b8051805182916004916200005091839160209091019062000076565b5060208281015180516200006b9260018501920190620000da565b5090505050620004f5565b828054828255906000526020600020908101928215620000c8579160200282015b82811115620000c85782518051620000b791849160209091019062000126565b509160200191906001019062000097565b50620000d6929150620001a2565b5090565b82805482825590600052602060002090810192821562000118579160200282015b8281111562000118578251825591602001919060010190620000fb565b50620000d6929150620001c3565b8280546200013490620004b8565b90600052602060002090601f01602090048101928262000158576000855562000118565b82601f106200017357805160ff191683800117855562000118565b8280016001018555821562000118579182018281111562000118578251825591602001919060010190620000fb565b80821115620000d6576000620001b98282620001da565b50600101620001a2565b5b80821115620000d65760008155600101620001c4565b508054620001e890620004b8565b6000825580601f10620001f9575050565b601f016020900490600052602060002090810190620002199190620001c3565b50565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156200025757620002576200021c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200028857620002886200021c565b604052919050565b60006001600160401b03821115620002ac57620002ac6200021c565b5060051b60200190565b600082601f830112620002c857600080fd5b81516020620002e1620002db8362000290565b6200025d565b82815260059290921b840181019181810190868411156200030157600080fd5b8286015b848110156200031e578051835291830191830162000305565b509695505050505050565b600060208083850312156200033d57600080fd5b82516001600160401b03808211156200035557600080fd5b818501915060408083880312156200036c57600080fd5b6200037662000232565b8351838111156200038657600080fd5b8401601f810189136200039857600080fd5b8051620003a9620002db8262000290565b81815260059190911b8201870190878101908b831115620003c957600080fd5b8884015b838110156200047e57805188811115620003e75760008081fd5b8501603f81018e13620003fa5760008081fd5b8a810151898111156200041157620004116200021c565b62000425601f8201601f19168d016200025d565b8181528f8a8385010111156200043b5760008081fd5b60005b828110156200045b578381018b01518282018f01528d016200043e565b828111156200046d5760008e84840101525b5085525050918901918901620003cd565b508452505050838501519150828211156200049857600080fd5b620004a688838601620002b6565b85820152809550505050505092915050565b600181811c90821680620004cd57607f821691505b60208210811415620004ef57634e487b7160e01b600052602260045260246000fd5b50919050565b612a7480620005056000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063793f0d221161009757806395c0bf161161006657806395c0bf161461025d578063a1e122e014610270578063b837ecdc14610291578063c4d6d214146102b157600080fd5b8063793f0d22146101ea578063840ac22d146101fd578063873665a11461021d5780639091aad41461023d57600080fd5b8063393c9451116100d3578063393c945114610184578063507968e11461019757806367481cfc146101b75780636e446ffb146101d757600080fd5b80630413cfad146101055780631592c9921461012e5780631af01f3f1461014f578063219d62901461016f575b600080fd5b610118610113366004611cb5565b6102c4565b6040516101259190611e23565b60405180910390f35b61014161013c366004611ec8565b6103fb565b604051908152602001610125565b61016261015d366004611f50565b610438565b604051610125919061207a565b610177610627565b60405161012591906120dc565b6101776101923660046121dc565b61091e565b6101aa6101a5366004611ec8565b610ad9565b6040516101259190612218565b6101ca6101c5366004612259565b610b9e565b6040516101259190612343565b6101416101e5366004611ec8565b610cb0565b6101776101f8366004612351565b610ce5565b61021061020b3660046123ce565b610f46565b60405161012591906124c5565b61023061022b366004612546565b61105d565b6040516101259190612579565b61025061024b3660046125c7565b6111ce565b604051610125919061266a565b6101aa61026b366004611ec8565b611273565b61028361027e3660046121dc565b6112af565b6040516101259291906126cc565b6102a461029f366004612719565b6113c0565b60405161012591906127f2565b6101626102bf36600461285b565b611449565b80516060906102da906000906020850190611603565b506000805480602002602001604051908101604052809291908181526020016000905b828210156103f057838290600052602060002001805480602002602001604051908101604052809291908181526020016000905b828210156103dd5783829060005260206000200180546103509061295d565b80601f016020809104026020016040519081016040528092919081815260200182805461037c9061295d565b80156103c95780601f1061039e576101008083540402835291602001916103c9565b820191906000526020600020905b8154815290600101906020018083116103ac57829003601f168201915b505050505081526020019060010190610331565b50505050815260200190600101906102fd565b505050509050919050565b6001828154811061040b57600080fd5b90600052602060002001818154811061042357600080fd5b90600052602060002001600091509150505481565b6040805180820182526060808252602082015281516001808252818401909352909160009190816020015b6060815260200190600190039081610463579050509050838160008151811061048e5761048e612998565b6020026020010181905250604051806040016040528082815260200184815250600460008201518160000190805190602001906104cc929190611660565b5060208281015180516104e592600185019201906116b9565b505060408051600480546060602082028401810185529383018181529294509092849291849160009085015b828210156105bd5783829060005260206000200180546105309061295d565b80601f016020809104026020016040519081016040528092919081815260200182805461055c9061295d565b80156105a95780601f1061057e576101008083540402835291602001916105a9565b820191906000526020600020905b81548152906001019060200180831161058c57829003601f168201915b505050505081526020019060010190610511565b5050505081526020016001820180548060200260200160405190810160405280929190818152602001828054801561061457602002820191906000526020600020905b815481526020019060010190808311610600575b5050505050815250509150505b92915050565b604080516002808252606082810190935260009190816020015b6040805180820190915260608082526020820152815260200190600190039081610641579050506040805160048054606060208202840181018552938301818152949550919390928492849160009085015b8282101561073f5783829060005260206000200180546106b29061295d565b80601f01602080910402602001604051908101604052809291908181526020018280546106de9061295d565b801561072b5780601f106107005761010080835404028352916020019161072b565b820191906000526020600020905b81548152906001019060200180831161070e57829003601f168201915b505050505081526020019060010190610693565b5050505081526020016001820180548060200260200160405190810160405280929190818152602001828054801561079657602002820191906000526020600020905b815481526020019060010190808311610782575b505050505081525050816000815181106107b2576107b2612998565b6020026020010181905250600460405180604001604052908160008201805480602002602001604051908101604052809291908181526020016000905b8282101561089b57838290600052602060002001805461080e9061295d565b80601f016020809104026020016040519081016040528092919081815260200182805461083a9061295d565b80156108875780601f1061085c57610100808354040283529160200191610887565b820191906000526020600020905b81548152906001019060200180831161086a57829003601f168201915b5050505050815260200190600101906107ef565b505050508152602001600182018054806020026020016040519081016040528092919081815260200182805480156108f257602002820191906000526020600020905b8154815260200190600101908083116108de575b5050505050815250508160018151811061090e5761090e612998565b6020908102919091010152919050565b604080516002808252606082810190935260009190816020015b6040805180820190915260608082526020820152815260200190600190039081610938579050506040805160048054606060208202840181018552938301818152949550919390928492849160009085015b82821015610a365783829060005260206000200180546109a99061295d565b80601f01602080910402602001604051908101604052809291908181526020018280546109d59061295d565b8015610a225780601f106109f757610100808354040283529160200191610a22565b820191906000526020600020905b815481529060010190602001808311610a0557829003601f168201915b50505050508152602001906001019061098a565b50505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015610a8d57602002820191906000526020600020905b815481526020019060010190808311610a79575b50505050508152505081600081518110610aa957610aa9612998565b60200260200101819052508281600181518110610ac857610ac8612998565b602090810291909101015292915050565b60008281548110610ae957600080fd5b906000526020600020018181548110610b0157600080fd5b90600052602060002001600091509150508054610b1d9061295d565b80601f0160208091040260200160405190810160405280929190818152602001828054610b499061295d565b8015610b965780601f10610b6b57610100808354040283529160200191610b96565b820191906000526020600020905b815481529060010190602001808311610b7957829003601f168201915b505050505081565b610ba6611700565b604051806060016040528083600001516001610bc291906129c4565b600f0b815260200183602001516001610bdb9190612a13565b6001600160801b0390811682526040808601516020938401528351928401518216600160801b029290911691909117600690815590820151610c21906007906001611724565b50506040805160608101825260068054600f81900b8352600160801b90046001600160801b031660208084019190915283519081018085529294509092840191600790600190826000855b825461010083900a900460030b8152602060078301819004938401936001036004909301929092029101808411610c6c5790505b5050505050815250509050919050565b60038281548110610cc057600080fd5b90600052602060002090600202018160028110610cdc57600080fd5b01549150829050565b604080516002808252606082810190935260009190816020015b6060815260200190600190039081610cff5790505090508481600081518110610d2a57610d2a612998565b602002602001018190525060405180604001604052808281526020018581525060046000820151816000019080519060200190610d68929190611660565b506020828101518051610d8192600185019201906116b9565b5090505060008360ff166001600160401b03811115610da257610da2611b71565b604051908082528060200260200182016040528015610de757816020015b6040805180820190915260608082526020820152815260200190600190039081610dc05790505b506040805160048054606060208202840181018552938301818152949550919390928492849160009085015b82821015610ebf578382906000526020600020018054610e329061295d565b80601f0160208091040260200160405190810160405280929190818152602001828054610e5e9061295d565b8015610eab5780601f10610e8057610100808354040283529160200191610eab565b820191906000526020600020905b815481529060010190602001808311610e8e57829003601f168201915b505050505081526020019060010190610e13565b50505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015610f1657602002820191906000526020600020905b815481526020019060010190808311610f02575b50505050508152505081600081518110610f3257610f32612998565b602090810291909101015295945050505050565b8051606090610f5c9060029060208501906117be565b506002805480602002602001604051908101604052809291908181526020016000905b828210156103f057600084815260208120604080518082019091529160028086029092019190835b8282101561104a578382018054610fbd9061295d565b80601f0160208091040260200160405190810160405280929190818152602001828054610fe99061295d565b80156110365780601f1061100b57610100808354040283529160200191611036565b820191906000526020600020905b81548152906001019060200180831161101957829003601f168201915b505050505081526020019060010190610fa7565b5050505081526020019060010190610f7f565b60408051602080820183526001808352835160608181018652600f88900b82526001600160801b03878116948301859052958201859052948716600160801b909302929092176006908155906110b7906007908590611724565b50506040805160608082018352600f88900b82526001600160801b03871660208301528183018590528251600280825291810190935290925060009190816020015b611101611700565b8152602001906001900390816110f9579050506040805160608101825260068054600f81900b8352600160801b90046001600160801b031660208084019190915283519081018085529495509193909284019190600790600190826000855b825461010083900a900460030b8152602060078301819004938401936001036004909301929092029101808411611160579050505050505081525050816000815181106111af576111af612998565b60200260200101819052508181600181518110610f3257610f32612998565b80516060906111e4906001906020850190611814565b506001805480602002602001604051908101604052809291908181526020016000905b828210156103f05760008481526020908190208301805460408051828502810185019091528181529283018282801561125f57602002820191906000526020600020905b81548152602001906001019080831161124b575b505050505081526020019060010190611207565b6002828154811061128357600080fd5b9060005260206000209060020201816002811061129f57600080fd5b018054909250610b1d915061295d565b604080518082019091526060808252602082015260606112e2604051806040016040528060608152602001606081525090565b8351805185916004916112fc918391602090910190611660565b50602082810151805161131592600185019201906116b9565b50600291506113219050565b60405190808252806020026020018201604052801561136657816020015b604080518082019091526060808252602082015281526020019060019003908161133f5790505b5060208201819052805185919060009061138257611382612998565b60200260200101819052508381602001516001815181106113a5576113a5612998565b60200260200101819052508081602001519250925050915091565b80516060906113d690600390602085019061186d565b506003805480602002602001604051908101604052809291908181526020016000905b828210156103f05760008481526020902060408051808201918290529160028581029091019182845b815481526020019060010190808311611422575050505050815260200190600101906113f9565b604080518082019091526060808252602082015260008260200151511161146f57600080fd5b816020015160008151811061148657611486612998565b6020026020010151600460008201518160000190805190602001906114ac929190611660565b5060208281015180516114c592600185019201906116b9565b505060408051600480546060602082028401810185529383018181529294509092849291849160009085015b8282101561159d5783829060005260206000200180546115109061295d565b80601f016020809104026020016040519081016040528092919081815260200182805461153c9061295d565b80156115895780601f1061155e57610100808354040283529160200191611589565b820191906000526020600020905b81548152906001019060200180831161156c57829003601f168201915b5050505050815260200190600101906114f1565b50505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015610ca057602002820191906000526020600020905b8154815260200190600101908083116115e0575050505050815250509050919050565b828054828255906000526020600020908101928215611650579160200282015b8281111561165057825180516116409184916020909101906118c3565b5091602001919060010190611623565b5061165c92915061191c565b5090565b8280548282559060005260206000209081019282156116ad579160200282015b828111156116ad578251805161169d918491602090910190611939565b5091602001919060010190611680565b5061165c9291506119ac565b8280548282559060005260206000209081019282156116f4579160200282015b828111156116f45782518255916020019190600101906116d9565b5061165c9291506119c9565b604080516060810182526000808252602082015290810161171f6119de565b905290565b6001830191839082156116f45791602002820160005b8382111561178157835183826101000a81548163ffffffff021916908360030b63ffffffff160217905550926020019260040160208160030104928301926001030261173a565b80156117b15782816101000a81549063ffffffff0219169055600401602081600301049283019260010302611781565b505061165c9291506119c9565b828054828255906000526020600020906002028101928215611808579160200282015b828111156118085782516117f890839060026119fc565b50916020019190600201906117e1565b5061165c929150611a3c565b828054828255906000526020600020908101928215611861579160200282015b8281111561186157825180516118519184916020909101906116b9565b5091602001919060010190611834565b5061165c929150611a59565b8280548282559060005260206000209060020281019282156118b7579160200282015b828111156118b75782516118a79083906002611a76565b5091602001919060020190611890565b5061165c929150611aa3565b828054828255906000526020600020908101928215611910579160200282015b828111156119105782518051611900918491602090910190611939565b50916020019190600101906118e3565b5061165c929150611abd565b8082111561165c5760006119308282611ada565b5060010161191c565b8280546119459061295d565b90600052602060002090601f01602090048101928261196757600085556116f4565b82601f1061198057805160ff19168380011785556116f4565b828001600101855582156116f457918201828111156116f45782518255916020019190600101906116d9565b8082111561165c5760006119c08282611afb565b506001016119ac565b5b8082111561165c57600081556001016119ca565b60405180602001604052806001906020820280368337509192915050565b8260028101928215611910579160200282015b828111156119105782518051611a2c918491602090910190611939565b5091602001919060010190611a0f565b8082111561165c576000611a508282611b35565b50600201611a3c565b8082111561165c576000611a6d8282611b53565b50600101611a59565b82600281019282156116f457916020028201828111156116f45782518255916020019190600101906116d9565b8082111561165c5760008082556001820155600201611aa3565b8082111561165c576000611ad18282611afb565b50600101611abd565b5080546000825590600052602060002090810190611af89190611abd565b50565b508054611b079061295d565b6000825580601f10611b17575050565b601f016020900490600052602060002090810190611af891906119c9565b506000611b428282611afb565b50611b51906001016000611afb565b565b5080546000825590600052602060002090810190611af891906119c9565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715611ba957611ba9611b71565b60405290565b604051606081016001600160401b0381118282101715611ba957611ba9611b71565b604051602081016001600160401b0381118282101715611ba957611ba9611b71565b604051601f8201601f191681016001600160401b0381118282101715611c1b57611c1b611b71565b604052919050565b60006001600160401b03821115611c3c57611c3c611b71565b5060051b60200190565b600082601f830112611c5757600080fd5b81356001600160401b03811115611c7057611c70611b71565b611c83601f8201601f1916602001611bf3565b818152846020838601011115611c9857600080fd5b816020850160208301376000918101602001919091529392505050565b60006020808385031215611cc857600080fd5b6001600160401b038084351115611cde57600080fd5b8335840185601f820112611cf157600080fd5b8035611d04611cff82611c23565b611bf3565b81815260059190911b82018401908481019088831115611d2357600080fd5b8584015b83811015611dc9578581351115611d3d57600080fd5b803585018a603f820112611d5057600080fd5b87810135611d60611cff82611c23565b81815260059190911b820160400190898101908d831115611d8057600080fd5b604084015b83811015611db8578a81351115611d9b57600080fd5b611dab8f60408335880101611c46565b8352918b01918b01611d85565b508652505050918601918601611d27565b5098975050505050505050565b6000815180845260005b81811015611dfc57602081850181015186830182015201611de0565b81811115611e0e576000602083870101525b50601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060059250604081841b8701018488016000805b84811015611eb957898403603f19018652825180518086529089019089860190808a1b87018b01855b82811015611ea357601f19898303018452611e91828651611dd6565b948d0194938d01939150600101611e75565b50988b0198965050509288019250600101611e4c565b50919998505050505050505050565b60008060408385031215611edb57600080fd5b50508035926020909101359150565b600082601f830112611efb57600080fd5b81356020611f0b611cff83611c23565b82815260059290921b84018101918181019086841115611f2a57600080fd5b8286015b84811015611f455780358352918301918301611f2e565b509695505050505050565b60008060408385031215611f6357600080fd5b82356001600160401b0380821115611f7a57600080fd5b611f8686838701611c46565b93506020850135915080821115611f9c57600080fd5b50611fa985828601611eea565b9150509250929050565b600081518084526020808501808196508360051b8101915082860160005b85811015611ffb578284038952611fe9848351611dd6565b98850198935090840190600101611fd1565b5091979650505050505050565b600081518084526020808501945080840160005b838110156120385781518752958201959082019060010161201c565b509495945050505050565b60008151604084526120586040850182611fb3565b9050602083015184820360208601526120718282612008565b95945050505050565b60208152600061208d6020830184612043565b9392505050565b600081518084526020808501808196508360051b8101915082860160005b85811015611ffb5782840389526120ca848351612043565b988501989350908401906001016120b2565b60208152600061208d6020830184612094565b600082601f83011261210057600080fd5b81356020612110611cff83611c23565b82815260059290921b8401810191818101908684111561212f57600080fd5b8286015b84811015611f455780356001600160401b038111156121525760008081fd5b6121608986838b0101611c46565b845250918301918301612133565b60006040828403121561218057600080fd5b612188611b87565b905081356001600160401b03808211156121a157600080fd5b6121ad858386016120ef565b835260208401359150808211156121c357600080fd5b506121d084828501611eea565b60208301525092915050565b6000602082840312156121ee57600080fd5b81356001600160401b0381111561220457600080fd5b6122108482850161216e565b949350505050565b60208152600061208d6020830184611dd6565b8035600f81900b811461223d57600080fd5b919050565b80356001600160801b038116811461223d57600080fd5b60006060828403121561226b57600080fd5b612273611baf565b61227c8361222b565b8152602061228b818501612242565b8183015284605f85011261229e57600080fd5b6122a6611bd1565b8060608601878111156122b857600080fd5b604087015b818110156122e45780358060030b81146122d75760008081fd5b84529284019284016122bd565b505060408401525090949350505050565b8051600f0b825260206001600160801b0381830151168184015260408201516040840160005b600181101561233b57825160030b8252918301919083019060010161231b565b505050505050565b6060810161062182846122f5565b60008060006060848603121561236657600080fd5b83356001600160401b038082111561237d57600080fd5b61238987838801611c46565b9450602086013591508082111561239f57600080fd5b506123ac86828701611eea565b925050604084013560ff811681146123c357600080fd5b809150509250925092565b600060208083850312156123e157600080fd5b6001600160401b0380843511156123f757600080fd5b8335840185601f82011261240a57600080fd5b8035612418611cff82611c23565b81815260059190911b8201840190848101908883111561243757600080fd5b8584015b83811015611dc957858135111561245157600080fd5b803585018a603f82011261246457600080fd5b61246c611b87565b80606083018d81111561247e57600080fd5b8a84015b818110156124b4578a8135111561249857600080fd5b6124a78f8d8335880101611c46565b8452928b01928b01612482565b50508552505091860191860161243b565b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b84811015611eb957898403603f19018652825184888101845b600281101561253157878203835261251f828551611dd6565b938c0193928c01929150600101612506565b50978a019795505050918701916001016124ed565b6000806040838503121561255957600080fd5b6125628361222b565b915061257060208401612242565b90509250929050565b6020808252825182820181905260009190848201906040850190845b818110156125bb576125a88385516122f5565b9284019260609290920191600101612595565b50909695505050505050565b600060208083850312156125da57600080fd5b82356001600160401b03808211156125f157600080fd5b818501915085601f83011261260557600080fd5b8135612613611cff82611c23565b81815260059190911b8301840190848101908883111561263257600080fd5b8585015b83811015611dc95780358581111561264e5760008081fd5b61265c8b89838a0101611eea565b845250918601918601612636565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156126bf57603f198886030184526126ad858351612008565b94509285019290850190600101612691565b5092979650505050505050565b60408152600083516040808401526126e76080840182611fb3565b90506020850151603f198483030160608501526127048282612094565b91505082810360208401526120718185612094565b6000602080838503121561272c57600080fd5b82356001600160401b0381111561274257600080fd5b8301601f808201861361275457600080fd5b8135612762611cff82611c23565b81815260069190911b8301840190848101908883111561278157600080fd5b938501935b828510156127e657888486011261279d5760008081fd5b6127a5611b87565b80604087018b8111156127b85760008081fd5b875b818110156127d157803584529289019289016127ba565b50508352506040949094019390850190612786565b98975050505050505050565b60208082528251828201819052600091906040908185019086840185805b8381101561284d57825185835b600281101561283a5782518252918901919089019060010161281d565b5050509385019391860191600101612810565b509298975050505050505050565b6000602080838503121561286e57600080fd5b82356001600160401b038082111561288557600080fd5b908401906040828703121561289957600080fd5b6128a1611b87565b8235828111156128b057600080fd5b6128bc888286016120ef565b82525083830135828111156128d057600080fd5b80840193505086601f8401126128e557600080fd5b82356128f3611cff82611c23565b81815260059190911b8401850190858101908983111561291257600080fd5b8686015b8381101561294a5780358681111561292e5760008081fd5b61293c8c8a838b010161216e565b845250918701918701612916565b5095830195909552509695505050505050565b600181811c9082168061297157607f821691505b6020821081141561299257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600081600f0b83600f0b600082128260016001607f1b03038213811516156129ee576129ee6129ae565b8260016001607f1b0319038212811615612a0a57612a0a6129ae565b50019392505050565b60006001600160801b03808316818516808303821115612a3557612a356129ae565b0194935050505056fea2646970667358221220cbb4b742e9d5b7365ce5b03a554cae0a308d71a3733ba78a8c8ce6eb1e1b9e3d64736f6c634300080b0033 \ No newline at end of file diff --git a/src/test/resources/gm/abi/ComplexCodecTest.abi b/src/test/resources/gm/abi/ComplexCodecTest.abi new file mode 100644 index 000000000..e7a815a37 --- /dev/null +++ b/src/test/resources/gm/abi/ComplexCodecTest.abi @@ -0,0 +1 @@ +[{"inputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA","name":"a","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"b32_array_array","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"b32_s_array_array","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"b_array_array","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"b_s_array_array","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"int128","name":"i1","type":"int128"},{"internalType":"uint128","name":"u1","type":"uint128"},{"internalType":"int32[1]","name":"b1","type":"int32[1]"}],"internalType":"struct StaticStruct","name":"b","type":"tuple"}],"name":"buildStaticStruct","outputs":[{"components":[{"internalType":"int128","name":"i1","type":"int128"},{"internalType":"uint128","name":"u1","type":"uint128"},{"internalType":"int32[1]","name":"b1","type":"int32[1]"}],"internalType":"struct StaticStruct","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int128","name":"i1","type":"int128"},{"internalType":"uint128","name":"u1","type":"uint128"}],"name":"buildStaticStruct","outputs":[{"components":[{"internalType":"int128","name":"i1","type":"int128"},{"internalType":"uint128","name":"u1","type":"uint128"},{"internalType":"int32[1]","name":"b1","type":"int32[1]"}],"internalType":"struct StaticStruct[]","name":"","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"value_str","type":"string"},{"internalType":"bytes32[]","name":"_b","type":"bytes32[]"}],"name":"buildStructA","outputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"value_str","type":"string"},{"internalType":"bytes32[]","name":"_b","type":"bytes32[]"},{"internalType":"uint8","name":"size","type":"uint8"}],"name":"buildStructA","outputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA[]","name":"","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA","name":"a","type":"tuple"}],"name":"buildStructB","outputs":[{"components":[{"internalType":"string[]","name":"d_str","type":"string[]"},{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA[]","name":"a_struct","type":"tuple[]"}],"internalType":"struct StructB","name":"","type":"tuple"},{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA[]","name":"","type":"tuple[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getStructA","outputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA","name":"a","type":"tuple"}],"name":"getStructA","outputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"string[]","name":"d_str","type":"string[]"},{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA[]","name":"a_struct","type":"tuple[]"}],"internalType":"struct StructB","name":"b","type":"tuple"}],"name":"getStructAInStructB","outputs":[{"components":[{"internalType":"string[]","name":"value_str","type":"string[]"},{"internalType":"bytes32[]","name":"bytes32_in_struct","type":"bytes32[]"}],"internalType":"struct StructA","name":"","type":"tuple"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[][]","name":"b","type":"bytes32[][]"}],"name":"setBytes32ArrayArray","outputs":[{"internalType":"bytes32[][]","name":"","type":"bytes32[][]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[2][]","name":"b","type":"bytes32[2][]"}],"name":"setBytes32StaticArrayArray","outputs":[{"internalType":"bytes32[2][]","name":"","type":"bytes32[2][]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[][]","name":"b","type":"bytes[][]"}],"name":"setBytesArrayArray","outputs":[{"internalType":"bytes[][]","name":"","type":"bytes[][]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[2][]","name":"b","type":"bytes[2][]"}],"name":"setBytesStaticArrayArray","outputs":[{"internalType":"bytes[2][]","name":"","type":"bytes[2][]"}],"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file diff --git a/src/test/resources/gm/bin/ComplexCodecTest.bin b/src/test/resources/gm/bin/ComplexCodecTest.bin new file mode 100644 index 000000000..4b50e6378 --- /dev/null +++ b/src/test/resources/gm/bin/ComplexCodecTest.bin @@ -0,0 +1 @@ +60806040523480156200001157600080fd5b5060405162002f8338038062002f83833981016040819052620000349162000329565b8051805182916004916200005091839160209091019062000076565b5060208281015180516200006b9260018501920190620000da565b5090505050620004f5565b828054828255906000526020600020908101928215620000c8579160200282015b82811115620000c85782518051620000b791849160209091019062000126565b509160200191906001019062000097565b50620000d6929150620001a2565b5090565b82805482825590600052602060002090810192821562000118579160200282015b8281111562000118578251825591602001919060010190620000fb565b50620000d6929150620001c3565b8280546200013490620004b8565b90600052602060002090601f01602090048101928262000158576000855562000118565b82601f106200017357805160ff191683800117855562000118565b8280016001018555821562000118579182018281111562000118578251825591602001919060010190620000fb565b80821115620000d6576000620001b98282620001da565b50600101620001a2565b5b80821115620000d65760008155600101620001c4565b508054620001e890620004b8565b6000825580601f10620001f9575050565b601f016020900490600052602060002090810190620002199190620001c3565b50565b63b95aa35560e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156200025757620002576200021c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200028857620002886200021c565b604052919050565b60006001600160401b03821115620002ac57620002ac6200021c565b5060051b60200190565b600082601f830112620002c857600080fd5b81516020620002e1620002db8362000290565b6200025d565b82815260059290921b840181019181810190868411156200030157600080fd5b8286015b848110156200031e578051835291830191830162000305565b509695505050505050565b600060208083850312156200033d57600080fd5b82516001600160401b03808211156200035557600080fd5b818501915060408083880312156200036c57600080fd5b6200037662000232565b8351838111156200038657600080fd5b8401601f810189136200039857600080fd5b8051620003a9620002db8262000290565b81815260059190911b8201870190878101908b831115620003c957600080fd5b8884015b838110156200047e57805188811115620003e75760008081fd5b8501603f81018e13620003fa5760008081fd5b8a810151898111156200041157620004116200021c565b62000425601f8201601f19168d016200025d565b8181528f8a8385010111156200043b5760008081fd5b60005b828110156200045b578381018b01518282018f01528d016200043e565b828111156200046d5760008e84840101525b5085525050918901918901620003cd565b508452505050838501519150828211156200049857600080fd5b620004a688838601620002b6565b85820152809550505050505092915050565b600181811c90821680620004cd57607f821691505b60208210811415620004ef5763b95aa35560e01b600052602260045260246000fd5b50919050565b612a7e80620005056000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063a2030f0811610097578063cf0eeb9211610066578063cf0eeb921461025d578063d1b032f91461027e578063d4da0d8c14610291578063f79a6b6a146102b157600080fd5b8063a2030f081461020f578063a312b5f114610224578063a3d819e314610237578063ca60819c1461024a57600080fd5b80634676de9a116100d35780634676de9a1461018e57806354cebc8d146101ae57806373a96cee146101cf57806388c15074146101ef57600080fd5b80631062ff361461010557806332c313081461012e57806336793c591461014e5780633a07f2131461016e575b600080fd5b610118610113366004611ba9565b6102c4565b6040516101259190611c2a565b60405180910390f35b61014161013c366004611dbc565b61044b565b6040516101259190611f12565b61016161015c366004611fa2565b61056d565b604051610125919061207b565b61018161017c36600461214a565b6105f6565b6040516101259190612228565b6101a161019c36600461228a565b61069b565b6040516101259190612326565b6101c16101bc366004612334565b6107ad565b604051908152602001610125565b6101e26101dd366004612334565b6107ea565b6040516101259190612356565b6102026101fd36600461245d565b6108a7565b60405161012591906125eb565b610217610a61565b6040516101259190612646565b610217610232366004612659565b610d58565b610202610245366004612695565b610f13565b6101e2610258366004612334565b611101565b61027061026b366004612659565b611145565b6040516101259291906126f8565b6101c161028c366004612334565b611256565b6102a461029f366004612745565b61128b565b6040516101259190612854565b6102176102bf3660046128ea565b6113b7565b60408051602080820183526001808352835160608181018652600f88900b82526001600160801b03878116948301859052958201859052948716600160801b9093029290921760069081559061031e906007908590611618565b50506040805160608082018352600f88900b82526001600160801b03871660208301528183018590528251600280825291810190935290925060009190816020015b6103686116b7565b815260200190600190039081610360579050506040805160608101825260068054600f81900b8352600160801b90046001600160801b031660208084019190915283519081018085529495509193909284019190600790600190826000855b825461010083900a900460030b81526020600783018190049384019360010360049093019290920291018084116103c75790505050505050815250508160008151811061041657610416612967565b6020026020010181905250818160018151811061043557610435612967565b6020908102919091010152925050505b92915050565b80516060906104619060029060208501906116db565b506002805480602002602001604051908101604052809291908181526020016000905b8282101561056257600084815260208120604080518082019091529160028086029092019190835b8282101561054f5783820180546104c29061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546104ee9061297d565b801561053b5780601f106105105761010080835404028352916020019161053b565b820191906000526020600020905b81548152906001019060200180831161051e57829003601f168201915b5050505050815260200190600101906104ac565b5050505081526020019060010190610484565b505050509050919050565b8051606090610583906003906020850190611731565b506003805480602002602001604051908101604052809291908181526020016000905b828210156105625760008481526020902060408051808201918290529160028581029091019182845b8154815260200190600101908083116105cf575050505050815260200190600101906105a6565b805160609061060c906001906020850190611787565b506001805480602002602001604051908101604052809291908181526020016000905b828210156105625760008481526020908190208301805460408051828502810185019091528181529283018282801561068757602002820191906000526020600020905b815481526020019060010190808311610673575b50505050508152602001906001019061062f565b6106a36116b7565b6040518060600160405280836000015160016106bf91906129ce565b600f0b8152602001836020015160016106d89190612a1d565b6001600160801b0390811682526040808601516020938401528351928401518216600160801b02929091169190911760069081559082015161071e906007906001611618565b50506040805160608101825260068054600f81900b8352600160801b90046001600160801b031660208084019190915283519081018085529294509092840191600790600190826000855b825461010083900a900460030b81526020600783018190049384019360010360049093019290920291018084116107695790505b5050505050815250509050919050565b600182815481106107bd57600080fd5b9060005260206000200181815481106107d557600080fd5b90600052602060002001600091509150505481565b600282815481106107fa57600080fd5b9060005260206000209060020201816002811061081657600080fd5b018054909250610826915061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546108529061297d565b801561089f5780601f106108745761010080835404028352916020019161089f565b820191906000526020600020905b81548152906001019060200180831161088257829003601f168201915b505050505081565b60408051808201909152606080825260208201526000826020015151116108cd57600080fd5b81602001516000815181106108e4576108e4612967565b60200260200101516004600082015181600001908051906020019061090a9291906117e0565b5060208281015180516109239260018501920190611839565b505060408051600480546060602082028401810185529383018181529294509092849291849160009085015b828210156109fb57838290600052602060002001805461096e9061297d565b80601f016020809104026020016040519081016040528092919081815260200182805461099a9061297d565b80156109e75780601f106109bc576101008083540402835291602001916109e7565b820191906000526020600020905b8154815290600101906020018083116109ca57829003601f168201915b50505050508152602001906001019061094f565b5050505081526020016001820180548060200260200160405190810160405280929190818152602001828054801561079d57602002820191906000526020600020905b815481526020019060010190808311610a3e575050505050815250509050919050565b604080516002808252606082810190935260009190816020015b6040805180820190915260608082526020820152815260200190600190039081610a7b579050506040805160048054606060208202840181018552938301818152949550919390928492849160009085015b82821015610b79578382906000526020600020018054610aec9061297d565b80601f0160208091040260200160405190810160405280929190818152602001828054610b189061297d565b8015610b655780601f10610b3a57610100808354040283529160200191610b65565b820191906000526020600020905b815481529060010190602001808311610b4857829003601f168201915b505050505081526020019060010190610acd565b50505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015610bd057602002820191906000526020600020905b815481526020019060010190808311610bbc575b50505050508152505081600081518110610bec57610bec612967565b6020026020010181905250600460405180604001604052908160008201805480602002602001604051908101604052809291908181526020016000905b82821015610cd5578382906000526020600020018054610c489061297d565b80601f0160208091040260200160405190810160405280929190818152602001828054610c749061297d565b8015610cc15780601f10610c9657610100808354040283529160200191610cc1565b820191906000526020600020905b815481529060010190602001808311610ca457829003601f168201915b505050505081526020019060010190610c29565b50505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015610d2c57602002820191906000526020600020905b815481526020019060010190808311610d18575b50505050508152505081600181518110610d4857610d48612967565b6020908102919091010152919050565b604080516002808252606082810190935260009190816020015b6040805180820190915260608082526020820152815260200190600190039081610d72579050506040805160048054606060208202840181018552938301818152949550919390928492849160009085015b82821015610e70578382906000526020600020018054610de39061297d565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0f9061297d565b8015610e5c5780601f10610e3157610100808354040283529160200191610e5c565b820191906000526020600020905b815481529060010190602001808311610e3f57829003601f168201915b505050505081526020019060010190610dc4565b50505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015610ec757602002820191906000526020600020905b815481526020019060010190808311610eb3575b50505050508152505081600081518110610ee357610ee3612967565b60200260200101819052508281600181518110610f0257610f02612967565b602090810291909101015292915050565b6040805180820182526060808252602082015281516001808252818401909352909160009190816020015b6060815260200190600190039081610f3e5790505090508381600081518110610f6957610f69612967565b602002602001018190525060405180604001604052808281526020018481525060046000820151816000019080519060200190610fa79291906117e0565b506020828101518051610fc09260018501920190611839565b505060408051600480546060602082028401810185529383018181529294509092849291849160009085015b8282101561109857838290600052602060002001805461100b9061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546110379061297d565b80156110845780601f1061105957610100808354040283529160200191611084565b820191906000526020600020905b81548152906001019060200180831161106757829003601f168201915b505050505081526020019060010190610fec565b505050508152602001600182018054806020026020016040519081016040528092919081815260200182805480156110ef57602002820191906000526020600020905b8154815260200190600101908083116110db575b50505050508152505091505092915050565b6000828154811061111157600080fd5b90600052602060002001818154811061112957600080fd5b906000526020600020016000915091505080546108269061297d565b60408051808201909152606080825260208201526060611178604051806040016040528060608152602001606081525090565b8351805185916004916111929183916020909101906117e0565b5060208281015180516111ab9260018501920190611839565b50600291506111b79050565b6040519080825280602002602001820160405280156111fc57816020015b60408051808201909152606080825260208201528152602001906001900390816111d55790505b5060208201819052805185919060009061121857611218612967565b602002602001018190525083816020015160018151811061123b5761123b612967565b60200260200101819052508081602001519250925050915091565b6003828154811061126657600080fd5b9060005260206000209060020201816002811061128257600080fd5b01549150829050565b80516060906112a1906000906020850190611874565b506000805480602002602001604051908101604052809291908181526020016000905b8282101561056257838290600052602060002001805480602002602001604051908101604052809291908181526020016000905b828210156113a45783829060005260206000200180546113179061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546113439061297d565b80156113905780601f1061136557610100808354040283529160200191611390565b820191906000526020600020905b81548152906001019060200180831161137357829003601f168201915b5050505050815260200190600101906112f8565b50505050815260200190600101906112c4565b604080516002808252606082810190935260009190816020015b60608152602001906001900390816113d157905050905084816000815181106113fc576113fc612967565b60200260200101819052506040518060400160405280828152602001858152506004600082015181600001908051906020019061143a9291906117e0565b5060208281015180516114539260018501920190611839565b5090505060008360ff166001600160401b0381111561147457611474611c78565b6040519080825280602002602001820160405280156114b957816020015b60408051808201909152606080825260208201528152602001906001900390816114925790505b506040805160048054606060208202840181018552938301818152949550919390928492849160009085015b828210156115915783829060005260206000200180546115049061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546115309061297d565b801561157d5780601f106115525761010080835404028352916020019161157d565b820191906000526020600020905b81548152906001019060200180831161156057829003601f168201915b5050505050815260200190600101906114e5565b505050508152602001600182018054806020026020016040519081016040528092919081815260200182805480156115e857602002820191906000526020600020905b8154815260200190600101908083116115d4575b5050505050815250508160008151811061160457611604612967565b602090810291909101015295945050505050565b6001830191839082156116a75791602002820160005b8382111561167557835183826101000a81548163ffffffff021916908360030b63ffffffff160217905550926020019260040160208160030104928301926001030261162e565b80156116a55782816101000a81549063ffffffff0219169055600401602081600301049283019260010302611675565b505b506116b39291506118cd565b5090565b60408051606081018252600080825260208201529081016116d66118e2565b905290565b828054828255906000526020600020906002028101928215611725579160200282015b828111156117255782516117159083906002611900565b50916020019190600201906116fe565b506116b392915061194c565b82805482825590600052602060002090600202810192821561177b579160200282015b8281111561177b57825161176b9083906002611969565b5091602001919060020190611754565b506116b3929150611996565b8280548282559060005260206000209081019282156117d4579160200282015b828111156117d457825180516117c4918491602090910190611839565b50916020019190600101906117a7565b506116b39291506119b0565b82805482825590600052602060002090810192821561182d579160200282015b8281111561182d578251805161181d9184916020909101906119cd565b5091602001919060010190611800565b506116b3929150611a40565b8280548282559060005260206000209081019282156116a7579160200282015b828111156116a7578251825591602001919060010190611859565b8280548282559060005260206000209081019282156118c1579160200282015b828111156118c157825180516118b1918491602090910190611a5d565b5091602001919060010190611894565b506116b3929150611aaa565b5b808211156116b357600081556001016118ce565b60405180602001604052806001906020820280368337509192915050565b8260028101928215611940579160200282015b8281111561194057825180516119309184916020909101906119cd565b5091602001919060010190611913565b506116b3929150611ac7565b808211156116b35760006119608282611ae4565b5060020161194c565b82600281019282156116a757916020028201828111156116a7578251825591602001919060010190611859565b808211156116b35760008082556001820155600201611996565b808211156116b35760006119c48282611b02565b506001016119b0565b8280546119d99061297d565b90600052602060002090601f0160209004810192826119fb57600085556116a7565b82601f10611a1457805160ff19168380011785556116a7565b828001600101855582156116a757918201828111156116a7578251825591602001919060010190611859565b808211156116b3576000611a548282611b23565b50600101611a40565b828054828255906000526020600020908101928215611940579160200282015b828111156119405782518051611a9a9184916020909101906119cd565b5091602001919060010190611a7d565b808211156116b3576000611abe8282611b5d565b50600101611aaa565b808211156116b3576000611adb8282611b23565b50600101611ac7565b506000611af18282611b23565b50611b00906001016000611b23565b565b5080546000825590600052602060002090810190611b2091906118cd565b50565b508054611b2f9061297d565b6000825580601f10611b3f575050565b601f016020900490600052602060002090810190611b2091906118cd565b5080546000825590600052602060002090810190611b209190611ac7565b8035600f81900b8114611b8d57600080fd5b919050565b80356001600160801b0381168114611b8d57600080fd5b60008060408385031215611bbc57600080fd5b611bc583611b7b565b9150611bd360208401611b92565b90509250929050565b8051600f0b825260206001600160801b0381830151168184015260408201516040840160005b6001811015611c2257825160030b82529183019190830190600101611c02565b505050505050565b6020808252825182820181905260009190848201906040850190845b81811015611c6c57611c59838551611bdc565b9284019260609290920191600101611c46565b50909695505050505050565b63b95aa35560e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715611cb057611cb0611c78565b60405290565b604080519081016001600160401b0381118282101715611cb057611cb0611c78565b604051602081016001600160401b0381118282101715611cb057611cb0611c78565b604051601f8201601f191681016001600160401b0381118282101715611d2257611d22611c78565b604052919050565b60006001600160401b03821115611d4357611d43611c78565b5060051b60200190565b600082601f830112611d5e57600080fd5b81356001600160401b03811115611d7757611d77611c78565b611d8a601f8201601f1916602001611cfa565b818152846020838601011115611d9f57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020808385031215611dcf57600080fd5b6001600160401b038084351115611de557600080fd5b8335840185601f820112611df857600080fd5b8035611e0b611e0682611d2a565b611cfa565b81815260059190911b82018401908481019088831115611e2a57600080fd5b8584015b83811015611eb8578581351115611e4457600080fd5b803585018a603f820112611e5757600080fd5b611e5f611cb6565b80606083018d811115611e7157600080fd5b8a84015b81811015611ea7578a81351115611e8b57600080fd5b611e9a8f8d8335880101611d4d565b8452928b01928b01611e75565b505085525050918601918601611e2e565b5098975050505050505050565b6000815180845260005b81811015611eeb57602081850181015186830182015201611ecf565b81811115611efd576000602083870101525b50601f01601f19169290920160200192915050565b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b84811015611f9357898403603f19018652825184888101845b6002811015611f7e578782038352611f6c828551611ec5565b938c0193928c01929150600101611f53565b50978a01979550505091870191600101611f3a565b50919998505050505050505050565b60006020808385031215611fb557600080fd5b82356001600160401b03811115611fcb57600080fd5b8301601f8082018613611fdd57600080fd5b8135611feb611e0682611d2a565b81815260069190911b8301840190848101908883111561200a57600080fd5b938501935b8285101561206f5788848601126120265760008081fd5b61202e611cb6565b80604087018b8111156120415760008081fd5b875b8181101561205a5780358452928901928901612043565b5050835250604094909401939085019061200f565b98975050505050505050565b60208082528251828201819052600091906040908185019086840185805b838110156120d657825185835b60028110156120c3578251825291890191908901906001016120a6565b5050509385019391860191600101612099565b509298975050505050505050565b600082601f8301126120f557600080fd5b81356020612105611e0683611d2a565b82815260059290921b8401810191818101908684111561212457600080fd5b8286015b8481101561213f5780358352918301918301612128565b509695505050505050565b6000602080838503121561215d57600080fd5b82356001600160401b038082111561217457600080fd5b818501915085601f83011261218857600080fd5b8135612196611e0682611d2a565b81815260059190911b830184019084810190888311156121b557600080fd5b8585015b83811015611eb8578035858111156121d15760008081fd5b6121df8b89838a01016120e4565b8452509186019186016121b9565b600081518084526020808501945080840160005b8381101561221d57815187529582019590820190600101612201565b509495945050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561227d57603f1988860301845261226b8583516121ed565b9450928501929085019060010161224f565b5092979650505050505050565b60006060828403121561229c57600080fd5b6122a4611c8e565b6122ad83611b7b565b815260206122bc818501611b92565b8183015284605f8501126122cf57600080fd5b6122d7611cd8565b8060608601878111156122e957600080fd5b604087015b818110156123155780358060030b81146123085760008081fd5b84529284019284016122ee565b505060408401525090949350505050565b606081016104458284611bdc565b6000806040838503121561234757600080fd5b50508035926020909101359150565b6020815260006123696020830184611ec5565b9392505050565b600082601f83011261238157600080fd5b81356020612391611e0683611d2a565b82815260059290921b840181019181810190868411156123b057600080fd5b8286015b8481101561213f5780356001600160401b038111156123d35760008081fd5b6123e18986838b0101611d4d565b8452509183019183016123b4565b60006040828403121561240157600080fd5b612409611cb6565b905081356001600160401b038082111561242257600080fd5b61242e85838601612370565b8352602084013591508082111561244457600080fd5b50612451848285016120e4565b60208301525092915050565b6000602080838503121561247057600080fd5b82356001600160401b038082111561248757600080fd5b908401906040828703121561249b57600080fd5b6124a3611cb6565b8235828111156124b257600080fd5b6124be88828601612370565b82525083830135828111156124d257600080fd5b80840193505086601f8401126124e757600080fd5b82356124f5611e0682611d2a565b81815260059190911b8401850190858101908983111561251457600080fd5b8686015b8381101561254c578035868111156125305760008081fd5b61253e8c8a838b01016123ef565b845250918701918701612518565b5095830195909552509695505050505050565b600081518084526020808501808196508360051b8101915082860160005b858110156125a7578284038952612595848351611ec5565b9885019893509084019060010161257d565b5091979650505050505050565b60008151604084526125c9604085018261255f565b9050602083015184820360208601526125e282826121ed565b95945050505050565b60208152600061236960208301846125b4565b600081518084526020808501808196508360051b8101915082860160005b858110156125a75782840389526126348483516125b4565b9885019893509084019060010161261c565b60208152600061236960208301846125fe565b60006020828403121561266b57600080fd5b81356001600160401b0381111561268157600080fd5b61268d848285016123ef565b949350505050565b600080604083850312156126a857600080fd5b82356001600160401b03808211156126bf57600080fd5b6126cb86838701611d4d565b935060208501359150808211156126e157600080fd5b506126ee858286016120e4565b9150509250929050565b6040815260008351604080840152612713608084018261255f565b90506020850151603f1984830301606085015261273082826125fe565b91505082810360208401526125e281856125fe565b6000602080838503121561275857600080fd5b6001600160401b03808435111561276e57600080fd5b8335840185601f82011261278157600080fd5b803561278f611e0682611d2a565b81815260059190911b820184019084810190888311156127ae57600080fd5b8584015b83811015611eb85785813511156127c857600080fd5b803585018a603f8201126127db57600080fd5b878101356127eb611e0682611d2a565b81815260059190911b820160400190898101908d83111561280b57600080fd5b604084015b83811015612843578a8135111561282657600080fd5b6128368f60408335880101611d4d565b8352918b01918b01612810565b5086525050509186019186016127b2565b6000602080830181845280855180835260408601915060059250604081841b8701018488016000805b84811015611f9357898403603f19018652825180518086529089019089860190808a1b87018b01855b828110156128d457601f198983030184526128c2828651611ec5565b948d0194938d019391506001016128a6565b50988b019896505050928801925060010161287d565b6000806000606084860312156128ff57600080fd5b83356001600160401b038082111561291657600080fd5b61292287838801611d4d565b9450602086013591508082111561293857600080fd5b50612945868287016120e4565b925050604084013560ff8116811461295c57600080fd5b809150509250925092565b63b95aa35560e01b600052603260045260246000fd5b600181811c9082168061299157607f821691505b602082108114156129b25763b95aa35560e01b600052602260045260246000fd5b50919050565b63b95aa35560e01b600052601160045260246000fd5b600081600f0b83600f0b600082128260016001607f1b03038213811516156129f8576129f86129b8565b8260016001607f1b0319038212811615612a1457612a146129b8565b50019392505050565b60006001600160801b03808316818516808303821115612a3f57612a3f6129b8565b0194935050505056fea26469706673582212201466f6713a2501bd1383248e08f74a427b97bf1f6b89f6509b5e080047c75f2464736f6c634300080b0033 \ No newline at end of file From 251e61766c4316a866b8528ef02b2a7aca711f78 Mon Sep 17 00:00:00 2001 From: ywy2090 <912554887@qq.com> Date: Tue, 11 Jul 2023 15:50:31 +0800 Subject: [PATCH 08/22] update deps version (#802) * update deps version * update netty sm ssl contextVersion version to 1.5.2 --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 424dadf39..d1cc3cf4d 100644 --- a/build.gradle +++ b/build.gradle @@ -15,12 +15,12 @@ ext { ossrhPassword="xxx" } // jackson version - jacksonVersion = "2.14.2" + jacksonVersion = "2.15.2" commonsIOVersion = "2.4" commonsLang3Version = "3.1" javapoetVersion = "1.7.0" picocliVersion = "3.6.0" - nettySMSSLContextVersion = "1.5.1" + nettySMSSLContextVersion = "1.5.2" toml4jVersion = "0.7.2" bcprovJDK15onVersion = "1.60" webankJavaCryptoVersion = "1.0.2" @@ -29,7 +29,7 @@ ext { slf4jVersion = "1.7.36" junitVersion = '4.13.1' commonsCollections4Version = "4.4" - guavaVersion = "29.0-jre" + guavaVersion = "32.1.1-jre" } // check.dependsOn integrationTest From 0fadf19b210af3ab040e7d0264eeea9b4a098da3 Mon Sep 17 00:00:00 2001 From: wenlinli <1574249665@qq.com> Date: Wed, 9 Aug 2023 14:06:26 +0800 Subject: [PATCH 09/22] check openjdk 1.8.0.345 (#813) * check openjdk1.8.0.345 * fix error --- .ci/ci_check.sh | 2 + .github/workflows/workflow.yml | 9 ++++- build.gradle | 2 - .../bcos/sdk/eventsub/SubscribeTest.java | 6 +-- .../transaction/decoder/EventDecodeTest.java | 4 +- .../TransactionDecoderServiceTest.java | 14 +++---- .../AssembleTransactionProcessorTest.java | 39 +++++++++---------- ...ransactionWithRemoteSignProcessorTest.java | 6 ++- .../manager/ContractConstructorTest.java | 4 +- 9 files changed, 44 insertions(+), 42 deletions(-) diff --git a/.ci/ci_check.sh b/.ci/ci_check.sh index 35ae21fa9..cec76e017 100755 --- a/.ci/ci_check.sh +++ b/.ci/ci_check.sh @@ -112,6 +112,8 @@ check_sm_node() ## clean clean_node } +LOG_INFO "------ java version-------" +java -version LOG_INFO "------ download_tassl---------" download_tassl LOG_INFO "------ download_build_chain---------" diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 8e884390f..7daf7b599 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -19,9 +19,14 @@ jobs: fetch-depth: 5 - name: install macOS dependencies if: runner.os == 'macOS' - run: brew install openssl@1.1 openjdk + run: brew install openssl@1.1 - name: install Ubuntu dependencies if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt install -y git curl libssl-dev default-jdk build-essential + run: sudo apt-get update && sudo apt install -y git curl libssl-dev build-essential + - name: Set up JDK 1.8 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8.0.345' - name: run integration testing run: /bin/bash .ci/ci_check.sh diff --git a/build.gradle b/build.gradle index d1cc3cf4d..1e25cf09a 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,6 @@ ext { slf4jVersion = "1.7.36" junitVersion = '4.13.1' commonsCollections4Version = "4.4" - guavaVersion = "32.1.1-jre" } // check.dependsOn integrationTest @@ -200,7 +199,6 @@ dependencies { compile ("com.moandjiezana.toml:toml4j:${toml4jVersion}") compile ("com.webank:webank-blockchain-hsm-crypto:${webankHsmCryptoVersion}") testCompile ("org.apache.commons:commons-collections4:${commonsCollections4Version}") - testCompile ("com.google.guava:guava:${guavaVersion}") } javadoc { diff --git a/src/integration-test/java/org/fisco/bcos/sdk/eventsub/SubscribeTest.java b/src/integration-test/java/org/fisco/bcos/sdk/eventsub/SubscribeTest.java index f806b7e2d..70cf7a79c 100644 --- a/src/integration-test/java/org/fisco/bcos/sdk/eventsub/SubscribeTest.java +++ b/src/integration-test/java/org/fisco/bcos/sdk/eventsub/SubscribeTest.java @@ -15,9 +15,9 @@ package org.fisco.bcos.sdk.eventsub; -import com.google.common.collect.Lists; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.concurrent.Semaphore; import org.fisco.bcos.sdk.BcosSDK; @@ -63,7 +63,7 @@ public void testEventSubModule() { TransactionProcessorFactory.createAssembleTransactionProcessor( client, client.getCryptoSuite().createKeyPair(), abiFile, binFile); // deploy - List params = Lists.newArrayList(); + List params = new ArrayList<>(); params.add(1); params.add("test"); TransactionResponse response = manager.deployByContractLoader("ComplexSol", params); @@ -73,7 +73,7 @@ public void testEventSubModule() { contractAddress = response.getContractAddress(); // call function with event - List paramsSetValues = Lists.newArrayList(20); + List paramsSetValues = new ArrayList<>(Collections.singletonList(20)); String[] o = {"0x1", "0x2", "0x3"}; List a = Arrays.asList(o); paramsSetValues.add(a); diff --git a/src/integration-test/java/org/fisco/bcos/sdk/transaction/decoder/EventDecodeTest.java b/src/integration-test/java/org/fisco/bcos/sdk/transaction/decoder/EventDecodeTest.java index 730069ba0..5f4790aa2 100644 --- a/src/integration-test/java/org/fisco/bcos/sdk/transaction/decoder/EventDecodeTest.java +++ b/src/integration-test/java/org/fisco/bcos/sdk/transaction/decoder/EventDecodeTest.java @@ -14,7 +14,7 @@ */ package org.fisco.bcos.sdk.transaction.decoder; -import com.google.common.collect.Lists; +import java.util.ArrayList; import java.util.List; import java.util.Map; import org.fisco.bcos.sdk.BcosSDK; @@ -54,7 +54,7 @@ public void testDecode() throws Exception { client, client.getCryptoSuite().createKeyPair(), abiFile, binFile); ABICodec abiCodec = new ABICodec(client.getCryptoSuite()); // deploy - List params = Lists.newArrayList(); + List params = new ArrayList<>(); params.add(1); params.add("test2"); TransactionResponse response = manager.deployByContractLoader("ComplexSol", params); diff --git a/src/integration-test/java/org/fisco/bcos/sdk/transaction/decoder/TransactionDecoderServiceTest.java b/src/integration-test/java/org/fisco/bcos/sdk/transaction/decoder/TransactionDecoderServiceTest.java index 6f53dcdc0..5d39fbdaf 100644 --- a/src/integration-test/java/org/fisco/bcos/sdk/transaction/decoder/TransactionDecoderServiceTest.java +++ b/src/integration-test/java/org/fisco/bcos/sdk/transaction/decoder/TransactionDecoderServiceTest.java @@ -14,11 +14,9 @@ */ package org.fisco.bcos.sdk.transaction.decoder; -import com.google.common.collect.Lists; import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; +import java.util.*; + import org.fisco.bcos.sdk.BcosSDK; import org.fisco.bcos.sdk.client.Client; import org.fisco.bcos.sdk.model.ConstantConfig; @@ -57,7 +55,7 @@ public void testDecode() throws Exception { TransactionProcessorFactory.createAssembleTransactionProcessor( client, client.getCryptoSuite().createKeyPair(), abiFile, binFile); // deploy - List params = Lists.newArrayList(); + List params = new ArrayList<>(); params.add(1); params.add("test2"); TransactionResponse response = manager.deployByContractLoader(contractName, params); @@ -74,7 +72,7 @@ public void testDecode() throws Exception { contractName, contractAddress, "incrementUint256", - Lists.newArrayList(BigInteger.valueOf(1))); + Collections.singletonList(BigInteger.ONE)); TransactionResponse transactionResponseWithoutValues = decoder.decodeReceiptWithoutValues(abi, transactionReceipt); // System.out.println(JsonUtils.toJson(transactionResponseWithoutValues)); @@ -87,8 +85,8 @@ public void testDecode() throws Exception { // System.out.println(JsonUtils.toJson(events)); Assert.assertEquals(1, events.size()); // setBytes - List s = Lists.newArrayList("2".getBytes()); - List paramsSetBytes = new ArrayList(); + List s = Collections.singletonList("2".getBytes()); + List paramsSetBytes = new ArrayList<>(); paramsSetBytes.add(s); TransactionReceipt transactionReceipt2 = manager.sendTransactionAndGetReceiptByContractLoader( diff --git a/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionProcessorTest.java b/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionProcessorTest.java index e15365d7f..38541e83d 100644 --- a/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionProcessorTest.java +++ b/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionProcessorTest.java @@ -14,12 +14,9 @@ */ package org.fisco.bcos.sdk.transaction.manager; -import com.google.common.collect.Lists; + import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.CompletableFuture; import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; @@ -140,7 +137,7 @@ public void test11HelloWorldAsync() throws Exception { // send tx with callback String to = callbackMock.getResult().getContractAddress(); System.out.println("contract address is " + to); - List params = Lists.newArrayList("test"); + List params = Collections.singletonList("test"); transactionProcessor.sendTransactionAsync(to, abi, "set", params, callbackMock); // Assert.assertEquals("0x0", callbackMock.getResult().getStatus()); @@ -171,7 +168,7 @@ public void test2ComplexDeploy() throws Exception { TransactionProcessorFactory.createAssembleTransactionProcessor( client, cryptoKeyPair, abiFile, binFile); // deploy - List params = Lists.newArrayList(); + List params = new ArrayList<>(); params.add(1); params.add("test2"); TransactionResponse response = @@ -201,7 +198,7 @@ public void test3ComplexQuery() throws Exception { TransactionProcessorFactory.createAssembleTransactionProcessor( client, cryptoKeyPair, abiFile, binFile); // deploy - List params = Lists.newArrayList(); + List params = new ArrayList<>(); params.add(1); params.add("test2"); TransactionResponse response = @@ -244,7 +241,7 @@ public void test4ComplexEmptyTx() throws Exception { TransactionProcessorFactory.createAssembleTransactionProcessor( client, cryptoKeyPair, abiFile, binFile); // deploy - List params = Lists.newArrayList(); + List params = new ArrayList<>(); params.add(1); params.add("test2"); TransactionResponse response = @@ -266,7 +263,7 @@ public void test5ComplexIncrement() throws Exception { TransactionProcessorFactory.createAssembleTransactionProcessor( client, cryptoKeyPair, abiFile, binFile); // deploy - List params = Lists.newArrayList(); + List params = new ArrayList<>(); params.add(1); params.add("test2"); TransactionResponse response = @@ -280,7 +277,7 @@ public void test5ComplexIncrement() throws Exception { contractAddress, abi, "incrementUint256", - Lists.newArrayList(BigInteger.valueOf(10)), + Collections.singletonList(BigInteger.valueOf(10)), new TransactionCallback() { @Override public void onResponse(TransactionReceipt receipt) { @@ -294,7 +291,7 @@ public void onResponse(TransactionReceipt receipt) { contractAddress, abi, "getUint256", - Lists.newArrayList()); + new ArrayList<>()); Assert.assertEquals("Success", callResponse3.getReturnMessage()); } catch (TransactionBaseException | ABICodecException e) { System.out.println(e.getMessage()); @@ -309,7 +306,7 @@ public void test6ComplexSetValues() throws Exception { TransactionProcessorFactory.createAssembleTransactionProcessor( client, cryptoKeyPair, abiFile, binFile); // deploy - List params = Lists.newArrayList(); + List params = new ArrayList<>(); params.add(1); params.add("test2"); TransactionResponse response = @@ -320,7 +317,7 @@ public void test6ComplexSetValues() throws Exception { } String contractAddress = response.getContractAddress(); // set values - List paramsSetValues = Lists.newArrayList(20); + List paramsSetValues = new ArrayList<>(Collections.singletonList(20)); String[] o = {"0x1", "0x2", "0x3"}; List a = Arrays.asList(o); paramsSetValues.add(a); @@ -340,7 +337,7 @@ public void test7ComplexSetBytes() throws Exception { TransactionProcessorFactory.createAssembleTransactionProcessor( client, cryptoKeyPair, abiFile, binFile); // deploy - List params = Lists.newArrayList(); + List params = new ArrayList<>(); params.add(1); params.add("test2"); TransactionResponse response = @@ -350,7 +347,7 @@ public void test7ComplexSetBytes() throws Exception { } String contractAddress = response.getContractAddress(); // setBytes - List paramsSetBytes = Lists.newArrayList(new String("set bytes test".getBytes())); + List paramsSetBytes = Collections.singletonList(new String("set bytes test".getBytes())); TransactionResponse transactionResponse3 = transactionProcessor.sendTransactionWithStringParamsAndGetResponse( contractAddress, abi, "setBytes", paramsSetBytes); @@ -370,7 +367,7 @@ public void test7ComplexSetBytes() throws Exception { contractAddress, abi, "_bytesV", - Lists.newArrayList()); + new ArrayList<>()); Assert.assertEquals(0, callResponse4.getReturnCode()); List resultEntityList4 = JsonUtils.fromJsonList(callResponse4.getValues(), Object.class); @@ -383,7 +380,7 @@ public void test8ComplexSetBytesFuture() throws Exception { TransactionProcessorFactory.createAssembleTransactionProcessor( client, cryptoKeyPair, abiFile, binFile); // deploy - List params = Lists.newArrayList(); + List params = new ArrayList<>(); params.add(1); params.add("test2"); TransactionResponse response = @@ -392,7 +389,7 @@ public void test8ComplexSetBytesFuture() throws Exception { return; } String contractAddress = response.getContractAddress(); - List paramsSetBytes = Lists.newArrayList("2".getBytes()); + List paramsSetBytes = Collections.singletonList("2".getBytes()); String data = transactionProcessor.encodeFunction(abi, "setBytes", paramsSetBytes); String signedData = transactionProcessor.createSignedTransaction(contractAddress, data, cryptoKeyPair); @@ -410,7 +407,7 @@ public void test9ComplexIncrementInputParser() throws Exception { TransactionProcessorFactory.createAssembleTransactionProcessor( client, cryptoKeyPair, abiFile, binFile); // deploy - List params = Lists.newArrayList(); + List params = new ArrayList<>(); params.add(1); params.add("test2"); TransactionResponse response = @@ -427,7 +424,7 @@ public void test9ComplexIncrementInputParser() throws Exception { contractAddress, abi, "incrementUint256", - Lists.newArrayList(BigInteger.valueOf(10))); + Collections.singletonList(BigInteger.valueOf(10))); Assert.assertEquals(BigInteger.valueOf(10), transactionResponse.getInputObject().get(0)); } } diff --git a/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionWithRemoteSignProcessorTest.java b/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionWithRemoteSignProcessorTest.java index e435d0a98..57f3e24fc 100644 --- a/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionWithRemoteSignProcessorTest.java +++ b/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionWithRemoteSignProcessorTest.java @@ -14,10 +14,11 @@ */ package org.fisco.bcos.sdk.transaction.manager; -import com.google.common.collect.Lists; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CompletableFuture; +import java.util.Collections; + import org.apache.commons.lang3.StringUtils; import org.fisco.bcos.sdk.BcosSDK; import org.fisco.bcos.sdk.client.Client; @@ -47,7 +48,8 @@ public class AssembleTransactionWithRemoteSignProcessorTest { "src/integration-test/resources/" + ConstantConfig.CONFIG_FILE_NAME; private static final String abiFile = "src/integration-test/resources/abi/"; private static final String binFile = "src/integration-test/resources/bin/"; - private List params = Lists.newArrayList("test"); + private List params = new ArrayList<>(Collections.singletonList("test")); + ; // prepare sdk, read from the config file private BcosSDK sdk = BcosSDK.build(configFile); // set the group number 1 diff --git a/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/ContractConstructorTest.java b/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/ContractConstructorTest.java index 335a2f8c2..1f3622da1 100644 --- a/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/ContractConstructorTest.java +++ b/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/ContractConstructorTest.java @@ -1,7 +1,7 @@ package org.fisco.bcos.sdk.transaction.manager; -import com.google.common.collect.Lists; import java.io.File; +import java.util.ArrayList; import java.util.List; import org.apache.commons.io.FileUtils; import org.fisco.bcos.sdk.BcosSDK; @@ -31,7 +31,7 @@ public void test2ComplexDeploy() throws Exception { TransactionProcessorFactory.createAssembleTransactionProcessor( client, cryptoKeyPair, abiFile, binFile); // deploy - List params = Lists.newArrayList(); + List params = new ArrayList<>(); params.add(1); params.add("2"); From d7491f7c2c98b989130efd6bb236e51059a3f4a6 Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Thu, 10 Aug 2023 14:21:56 +0800 Subject: [PATCH 10/22] (sdk-abi): fix complex struct, array bug in abi codec, add many integration test for it. (#814) --- .github/workflows/workflow.yml | 2 + .gitignore | 2 + .../java/org/fisco/bcos/sdk/abi/Constant.java | 5 + .../org/fisco/bcos/sdk/abi/EventEncoder.java | 2 +- .../bcos/sdk/abi/FunctionReturnDecoder.java | 39 +- .../org/fisco/bcos/sdk/abi/TypeDecoder.java | 215 +- .../org/fisco/bcos/sdk/abi/TypeReference.java | 34 + .../java/org/fisco/bcos/sdk/abi/Utils.java | 103 +- .../fisco/bcos/sdk/abi/datatypes/Array.java | 28 +- .../bcos/sdk/abi/datatypes/DynamicArray.java | 53 +- .../bcos/sdk/abi/datatypes/StaticArray.java | 57 +- .../abi/datatypes/generated/StaticArray1.java | 11 + .../datatypes/generated/StaticArray10.java | 11 + .../datatypes/generated/StaticArray11.java | 11 + .../datatypes/generated/StaticArray12.java | 11 + .../datatypes/generated/StaticArray128.java | 20 +- .../datatypes/generated/StaticArray13.java | 11 + .../datatypes/generated/StaticArray14.java | 11 + .../datatypes/generated/StaticArray15.java | 11 + .../datatypes/generated/StaticArray16.java | 11 + .../datatypes/generated/StaticArray17.java | 11 + .../datatypes/generated/StaticArray18.java | 11 + .../datatypes/generated/StaticArray19.java | 11 + .../abi/datatypes/generated/StaticArray2.java | 11 + .../datatypes/generated/StaticArray20.java | 11 + .../datatypes/generated/StaticArray21.java | 11 + .../datatypes/generated/StaticArray22.java | 11 + .../datatypes/generated/StaticArray23.java | 11 + .../datatypes/generated/StaticArray24.java | 11 + .../datatypes/generated/StaticArray25.java | 11 + .../datatypes/generated/StaticArray26.java | 11 + .../datatypes/generated/StaticArray27.java | 11 + .../datatypes/generated/StaticArray28.java | 11 + .../datatypes/generated/StaticArray29.java | 11 + .../abi/datatypes/generated/StaticArray3.java | 11 + .../datatypes/generated/StaticArray30.java | 11 + .../datatypes/generated/StaticArray31.java | 11 + .../datatypes/generated/StaticArray32.java | 11 + .../abi/datatypes/generated/StaticArray4.java | 11 + .../abi/datatypes/generated/StaticArray5.java | 11 + .../abi/datatypes/generated/StaticArray6.java | 11 + .../abi/datatypes/generated/StaticArray7.java | 11 + .../abi/datatypes/generated/StaticArray8.java | 11 + .../abi/datatypes/generated/StaticArray9.java | 11 + .../org/fisco/bcos/sdk/contract/Contract.java | 14 +- .../java/org/fisco/bcos/sdk/BcosSDKTest.java | 244 +- .../fisco/bcos/sdk/contract/CodecTest.java | 2468 +++++++++++++++++ .../bcos/sdk/contract/ComplexCodecTest.java | 889 ++++++ .../fisco/bcos/sdk/contract/EventSubDemo.java | 583 ++++ .../bcos/sdk/precompiled/PrecompiledTest.java | 20 +- .../transaction/codec/CodecComplexTest.java | 212 ++ .../bcos/sdk/transaction/codec/CodecTest.java | 359 +++ .../sdk/transaction/codec/EvenDemoTest.java | 78 + .../TransactionDecoderServiceTest.java | 1 - .../AssembleTransactionProcessorTest.java | 4 +- ...ransactionWithRemoteSignProcessorTest.java | 6 +- 56 files changed, 5601 insertions(+), 189 deletions(-) create mode 100644 src/integration-test/java/org/fisco/bcos/sdk/contract/CodecTest.java create mode 100644 src/integration-test/java/org/fisco/bcos/sdk/contract/ComplexCodecTest.java create mode 100644 src/integration-test/java/org/fisco/bcos/sdk/contract/EventSubDemo.java create mode 100644 src/integration-test/java/org/fisco/bcos/sdk/transaction/codec/CodecComplexTest.java create mode 100644 src/integration-test/java/org/fisco/bcos/sdk/transaction/codec/CodecTest.java create mode 100644 src/integration-test/java/org/fisco/bcos/sdk/transaction/codec/EvenDemoTest.java diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 7daf7b599..a9aea4ee1 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -10,7 +10,9 @@ jobs: build: name: build runs-on: ${{ matrix.os }} + continue-on-error: true strategy: + fail-fast: false matrix: os: [ubuntu-20.04, ubuntu-22.04, macos-latest] steps: diff --git a/.gitignore b/.gitignore index 9913a5264..91d545d19 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ gmsm2.param integrationTestEnv.sh gradle.properties gpg.gpg +.DS_Store + diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/Constant.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/Constant.java index 43566803f..57deea018 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/Constant.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/Constant.java @@ -9,6 +9,11 @@ public class Constant { new BigInteger("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16); public static final BigInteger MIN_INT256 = new BigInteger("-7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16); + public static final BigInteger MAX_UINT128 = + new BigInteger("ffffffffffffffffffffffffffffffff", 16); + public static final BigInteger MAX_INT128 = + new BigInteger("7fffffffffffffffffffffffffffffff", 16); + public static final BigInteger MIN_INT128 = MAX_INT128.negate(); public static String NO_APPROPRIATE_ABI_METHOD = "Cann't encode in encodeMethodFromObject with appropriate interface ABI, please check your method name or ABI file"; diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/EventEncoder.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/EventEncoder.java index 9719012b2..28ed84e93 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/EventEncoder.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/EventEncoder.java @@ -33,7 +33,7 @@ private String buildMethodSignature( result.append(methodName); result.append("("); String params = - parameters.stream().map(p -> Utils.getTypeName(p)).collect(Collectors.joining(",")); + parameters.stream().map(Utils::getMethodSign).collect(Collectors.joining(",")); result.append(params); result.append(")"); return result.toString(); diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/FunctionReturnDecoder.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/FunctionReturnDecoder.java index 3fed5eaf6..a785d2e9e 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/FunctionReturnDecoder.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/FunctionReturnDecoder.java @@ -7,6 +7,7 @@ import org.fisco.bcos.sdk.abi.datatypes.Bytes; import org.fisco.bcos.sdk.abi.datatypes.BytesType; import org.fisco.bcos.sdk.abi.datatypes.DynamicArray; +import org.fisco.bcos.sdk.abi.datatypes.DynamicBytes; import org.fisco.bcos.sdk.abi.datatypes.DynamicStruct; import org.fisco.bcos.sdk.abi.datatypes.StaticArray; import org.fisco.bcos.sdk.abi.datatypes.StaticStruct; @@ -76,7 +77,7 @@ public static Type decodeIndexedValue( || Utf8String.class.isAssignableFrom(type)) { return TypeDecoder.decodeBytes(input, Bytes32.class); } else { - return TypeDecoder.decode(input, 0, type); + return TypeDecoder.decode(input, 0, typeReference); } } catch (ClassNotFoundException e) { throw new UnsupportedOperationException("Invalid class reference provided", e); @@ -139,7 +140,7 @@ private static List build(String input, List> outputPa offset += TypeDecoder.MAX_BYTE_LENGTH_FOR_HEX_STRING * length; } } else { - result = TypeDecoder.decode(input, hexStringDataOffset, cls); + result = TypeDecoder.decode(input, hexStringDataOffset, typeReference); offset += Utils.getOffset(typeReference.getType()) * TypeDecoder.MAX_BYTE_LENGTH_FOR_HEX_STRING; @@ -156,10 +157,42 @@ private static List build(String input, List> outputPa public static int getDataOffset( String input, int offset, java.lang.reflect.Type type) throws ClassNotFoundException { - if (Utils.dynamicType(type)) { + Class classType = Utils.getClassType(type); + + if (DynamicBytes.class.isAssignableFrom(classType) + || Utf8String.class.isAssignableFrom(classType) + || DynamicArray.class.isAssignableFrom(classType) + || hasDynamicOffsetInStaticArray(type)) { return TypeDecoder.decodeUintAsInt(input, offset) << 1; } else { return offset; } } + + public static int getDataOffset( + String input, int offset, TypeReference typeReference) + throws ClassNotFoundException { + @SuppressWarnings("unchecked") + Class type = (Class) typeReference.getClassType(); + if (DynamicBytes.class.isAssignableFrom(type) + || Utf8String.class.isAssignableFrom(type) + || DynamicArray.class.isAssignableFrom(type) + || hasDynamicOffsetInStaticArray(typeReference.getType())) { + return TypeDecoder.decodeUintAsInt(input, offset); + } else { + return offset; + } + } + + private static boolean hasDynamicOffsetInStaticArray(java.lang.reflect.Type type) + throws ClassNotFoundException { + try { + return StaticArray.class.isAssignableFrom(Utils.getClassType(type)) + && (DynamicStruct.class.isAssignableFrom( + Utils.getParameterizedTypeFromArray(type)) + || TypeDecoder.isDynamic(Utils.getParameterizedTypeFromArray(type))); + } catch (ClassCastException e) { + return false; + } + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/TypeDecoder.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/TypeDecoder.java index 404a4d44b..dced7bc5c 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/TypeDecoder.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/TypeDecoder.java @@ -30,6 +30,7 @@ import org.fisco.bcos.sdk.abi.datatypes.Ufixed; import org.fisco.bcos.sdk.abi.datatypes.Uint; import org.fisco.bcos.sdk.abi.datatypes.Utf8String; +import org.fisco.bcos.sdk.abi.datatypes.generated.AbiTypes; import org.fisco.bcos.sdk.abi.datatypes.generated.Uint160; import org.fisco.bcos.sdk.utils.Numeric; @@ -56,9 +57,61 @@ public static T decode(String input, int offset, Class type) return (T) decodeDynamicBytes(input, offset); } else if (Utf8String.class.isAssignableFrom(type)) { return (T) decodeUtf8String(input, offset); - } else if (Array.class.isAssignableFrom(type)) { - throw new UnsupportedOperationException( - "Array types must be wrapped in a TypeReference"); + } else if (StaticArray.class.isAssignableFrom(type)) { + int length = 0; + try { + if (type == StaticArray.class) { + length = + ((TypeReference.StaticArrayTypeReference) + TypeReference.create(Utils.getClassType(type))) + .getSize(); + } else { + length = + Integer.parseInt( + type.getSimpleName() + .substring(StaticArray.class.getSimpleName().length())); + } + } catch (ClassNotFoundException e) { + throw new UnsupportedOperationException( + "Unable to create instance of " + type.getName(), e); + } + return decodeStaticArray(input, offset, type, length); + } else if (DynamicArray.class.isAssignableFrom(type)) { + return decodeDynamicArray(input, offset, type); + } else { + throw new UnsupportedOperationException("Type cannot be encoded: " + type.getClass()); + } + } + + @SuppressWarnings("unchecked") + public static T decode(String input, int offset, TypeReference type) + throws ClassNotFoundException { + Class cls = type.getClassType(); + if (NumericType.class.isAssignableFrom(cls)) { + return (T) decodeNumeric(input.substring(offset), (Class) cls); + } else if (Address.class.isAssignableFrom(cls)) { + return (T) decodeAddress(input.substring(offset)); + } else if (Bool.class.isAssignableFrom(cls)) { + return (T) decodeBool(input, offset); + } else if (Bytes.class.isAssignableFrom(cls)) { + return (T) decodeBytes(input, offset, (Class) cls); + } else if (DynamicBytes.class.isAssignableFrom(cls)) { + return (T) decodeDynamicBytes(input, offset); + } else if (Utf8String.class.isAssignableFrom(cls)) { + return (T) decodeUtf8String(input, offset); + } else if (StaticArray.class.isAssignableFrom(cls)) { + int length; + if (cls == StaticArray.class) { + length = ((TypeReference.StaticArrayTypeReference) type).getSize(); + } else { + length = + Integer.parseInt( + cls.getSimpleName() + .substring(StaticArray.class.getSimpleName().length())); + } + return decodeStaticArray(input, offset, type, length); + } else if (DynamicArray.class.isAssignableFrom(cls)) { + return decodeDynamicArray(input, offset, type); } else { throw new UnsupportedOperationException("Type cannot be encoded: " + type.getClass()); } @@ -202,6 +255,21 @@ public static T decodeStaticArray( return decodeArrayElements(input, offset, type, length, function); } + public static T decodeStaticArray( + String input, int offset, TypeReference typeReference, int length) { + BiFunction, String, T> function = + (elements, typeName) -> { + if (elements.isEmpty()) { + throw new UnsupportedOperationException( + "Zero length fixed array is invalid type"); + } else { + return instantiateStaticArray(elements, length); + } + }; + + return decodeArrayElements(input, offset, typeReference, length, function); + } + @SuppressWarnings("unchecked") private static T instantiateStaticArray( java.lang.reflect.Type type, List elements) { @@ -216,6 +284,19 @@ private static T instantiateStaticArray( } } + public static T instantiateStaticArray(List elements, int length) { + try { + Class arrayClass = + (Class) + Class.forName( + "org.fisco.bcos.sdk.abi.datatypes.generated.StaticArray" + + length); + return (T) arrayClass.getConstructor(List.class).newInstance(elements); + } catch (ReflectiveOperationException e) { + throw new UnsupportedOperationException(e); + } + } + @SuppressWarnings("unchecked") public static T decodeDynamicArray( String input, int offset, java.lang.reflect.Type type) { @@ -225,7 +306,7 @@ public static T decodeDynamicArray( BiFunction, String, T> function = (elements, typeName) -> { if (elements.isEmpty()) { - return (T) DynamicArray.empty(typeName); + return (T) new DynamicArray(AbiTypes.getType(typeName), elements); } else { return (T) new DynamicArray<>(elements); } @@ -236,6 +317,23 @@ public static T decodeDynamicArray( return decodeArrayElements(input, valueOffset, type, length, function); } + public static T decodeDynamicArray( + String input, int offset, TypeReference typeReference) { + int length = decodeUintAsInt(input, offset); + + BiFunction, String, T> function = + (elements, typeName) -> { + if (elements.isEmpty()) { + return (T) new DynamicArray(AbiTypes.getType(typeName), elements); + } + return (T) new DynamicArray<>(elements); + }; + + int valueOffset = offset + Type.MAX_BYTE_LENGTH; + + return decodeArrayElements(input, valueOffset, typeReference, length, function); + } + @SuppressWarnings("rawtypes") private static T decodeArrayElements( String input, @@ -325,6 +423,104 @@ private static T decodeArrayElements( } } + private static T decodeArrayElements( + String input, + int offset, + TypeReference typeReference, + int length, + BiFunction, String, T> consumer) { + List elements = new ArrayList<>(length); + try { + java.lang.reflect.Type[] types = + ((ParameterizedType) typeReference.getType()).getActualTypeArguments(); + // cls without parameterized type + Class classType = Utils.getClassType(types[0]); + if (StructType.class.isAssignableFrom(classType)) { + for (int i = 0, currOffset = offset; + i < length; + i++, + currOffset += + getSingleElementLength(input, currOffset, classType) + * Type.MAX_BYTE_LENGTH) { + T value; + if (DynamicStruct.class.isAssignableFrom(classType)) { + value = + TypeDecoder.decodeDynamicStruct( + input, + offset + + FunctionReturnDecoder.getDataOffset( + input, currOffset, typeReference), + TypeReference.create(types[0])); + } else { + value = + TypeDecoder.decodeStaticStruct( + input, currOffset, TypeReference.create(types[0])); + } + elements.add(value); + } + + String typeName = Utils.getSimpleTypeName(classType); + return consumer.apply(elements, typeName); + } else { + int currOffset = offset; + for (int i = 0; i < length; i++) { + T value; + if (Array.class.isAssignableFrom(classType)) { + if (StaticArray.class.isAssignableFrom(classType)) { + int size = + Integer.parseInt( + Utils.getSimpleTypeName(classType) + .substring( + StaticArray.class + .getSimpleName() + .length())); + value = + decodeStaticArray( + input, + currOffset, + TypeReference.create(types[0]), + size); + } else { + int getOffset = + FunctionReturnDecoder.getDataOffset( + input, currOffset, TypeReference.create(types[0])); + value = + decodeDynamicArray( + input, + offset + getOffset, + TypeReference.create(types[0])); + } + } else { + if (isDynamic(classType)) { + int getOffset = + FunctionReturnDecoder.getDataOffset( + input, currOffset, typeReference); + value = + decode( + input, + offset + getOffset, + TypeReference.create(types[0])); + currOffset += Type.MAX_BYTE_LENGTH; + } else { + value = decode(input, currOffset, TypeReference.create(types[0])); + currOffset += + getSingleElementLength(input, currOffset, classType) + * Type.MAX_BYTE_LENGTH; + } + } + elements.add(value); + } + + String typeName = Utils.getSimpleTypeName(classType); + return consumer.apply(elements, typeName); + } + } catch (ClassNotFoundException e) { + throw new UnsupportedOperationException( + "Unable to access parameterized type " + typeReference.getType().getTypeName(), + e); + } + } + static int getSingleElementLength(String input, int offset, Class type) { if (input.length() == offset) { return 0; @@ -401,6 +597,8 @@ private static T decodeDynamicStructElements( final List parameterOffsets = new ArrayList<>(); for (int i = 0; i < length; ++i) { final Class declaredField = (Class) constructor.getParameterTypes()[i]; + TypeReference typeReferenceElement = + TypeReference.create(constructor.getGenericParameterTypes()[i]); final T value; final int beginIndex = offset + staticOffset; if (isDynamic(declaredField)) { @@ -425,7 +623,7 @@ private static T decodeDynamicStructElements( .size() * MAX_BYTE_LENGTH_FOR_HEX_STRING; } else { - value = decode(input.substring(beginIndex), 0, declaredField); + value = decode(input.substring(beginIndex), 0, typeReferenceElement); staticOffset += MAX_BYTE_LENGTH_FOR_HEX_STRING; } parameters.put(i, value); @@ -525,7 +723,8 @@ private static T decodeStaticStructElement( for (int i = 0, currOffset = offset; i < length; i++) { T value; final Class declaredField = (Class) constructor.getParameterTypes()[i]; - + TypeReference typeReferenceElement = + TypeReference.create(constructor.getGenericParameterTypes()[i]); if (StaticStruct.class.isAssignableFrom(declaredField)) { final int nestedStructLength = classType @@ -548,7 +747,7 @@ private static T decodeStaticStructElement( currOffset, currOffset + MAX_BYTE_LENGTH_FOR_HEX_STRING), 0, - declaredField); + typeReferenceElement); currOffset += MAX_BYTE_LENGTH_FOR_HEX_STRING; } elements.add(value); @@ -585,7 +784,7 @@ private static T decodeDynamicParameterFromStruct( } else if (DynamicArray.class.isAssignableFrom(typeReference.getClassType())) { value = decodeDynamicArray(dynamicElementData, 0, genericParameterType); } else { - value = decode(dynamicElementData, 0, typeReference.getClassType()); + value = decode(dynamicElementData, 0, typeReference); } return value; } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/TypeReference.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/TypeReference.java index 48a9d3217..49fe84017 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/TypeReference.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/TypeReference.java @@ -34,6 +34,15 @@ protected TypeReference(boolean indexed) { this.indexed = indexed; } + protected TypeReference(java.lang.reflect.Type type) { + java.lang.reflect.Type superclass = getClass().getGenericSuperclass(); + if (superclass instanceof Class) { + throw new RuntimeException("Missing type parameter."); + } + this.type = type; + this.indexed = false; + } + public int compareTo(TypeReference o) { // taken from the blog post comments - this results in an errror if the // type parameter is left out. @@ -74,4 +83,29 @@ public Type getType() { } }; } + + public static TypeReference create( + Type type) { + return new TypeReference(type) { + @Override + public Type getType() { + return super.getType(); + } + }; + } + + public abstract static class StaticArrayTypeReference< + T extends org.fisco.bcos.sdk.abi.datatypes.Type> + extends TypeReference { + + private final int size; + + protected StaticArrayTypeReference(int size) { + this.size = size; + } + + public int getSize() { + return size; + } + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/Utils.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/Utils.java index 2ec493d44..d2d714657 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/Utils.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/Utils.java @@ -11,21 +11,102 @@ import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.fisco.bcos.sdk.abi.datatypes.DynamicArray; -import org.fisco.bcos.sdk.abi.datatypes.DynamicBytes; -import org.fisco.bcos.sdk.abi.datatypes.Fixed; -import org.fisco.bcos.sdk.abi.datatypes.Int; -import org.fisco.bcos.sdk.abi.datatypes.StaticArray; -import org.fisco.bcos.sdk.abi.datatypes.StaticStruct; -import org.fisco.bcos.sdk.abi.datatypes.Type; -import org.fisco.bcos.sdk.abi.datatypes.Ufixed; -import org.fisco.bcos.sdk.abi.datatypes.Uint; -import org.fisco.bcos.sdk.abi.datatypes.Utf8String; +import org.fisco.bcos.sdk.abi.datatypes.*; /** Utility functions. */ public class Utils { private Utils() {} + public static String getMethodSign(TypeReference typeReference) { + return getMethodSign(typeReference.getType()); + } + + public static String getMethodSign(java.lang.reflect.Type type) { + try { + Class cls = Utils.getClassType(type); + if (type instanceof ParameterizedType) { // array + return getParameterizedMethodName(type); + } else { // simple type + return getSimpleMethodSign(cls); + } + + } catch (ClassNotFoundException e) { + throw new UnsupportedOperationException("Invalid class reference provided", e); + } + } + + private static String getParameterizedMethodName( + java.lang.reflect.Type type) { + + try { + Class cls = Utils.getClassType(type); + + if (DynamicArray.class.isAssignableFrom(cls)) { + return getMethodSign(((ParameterizedType) type).getActualTypeArguments()[0]) + "[]"; + } else if (StaticArray.class.isAssignableFrom(cls)) { + + int length = + Integer.parseInt( + cls.getSimpleName() + .substring(StaticArray.class.getSimpleName().length())); + + return getMethodSign(((ParameterizedType) type).getActualTypeArguments()[0]) + + "[" + + length + + "]"; + + } else { + throw new UnsupportedOperationException("Invalid type provided " + cls.getName()); + } + } catch (ClassNotFoundException e) { + throw new UnsupportedOperationException("Invalid class reference provided", e); + } + } + + public static String getSimpleMethodSign(Class type) { + String simpleName = type.getSimpleName().toLowerCase(); + + if (type.equals(Uint.class) + || type.equals(Int.class) + || type.equals(Ufixed.class) + || type.equals(Fixed.class)) { + return simpleName + "256"; + } else if (type.equals(Utf8String.class)) { + return "string"; + } else if (type.equals(DynamicBytes.class)) { + return "bytes"; + } else if (StructType.class.isAssignableFrom(type)) { + Constructor constructor = + Arrays.stream(type.getDeclaredConstructors()) + .filter( + declaredConstructor -> + Arrays.stream(declaredConstructor.getParameterTypes()) + .allMatch(Type.class::isAssignableFrom) + && declaredConstructor.getParameterTypes() + .length + > 0) + .findAny() + .orElseThrow( + () -> + new RuntimeException( + "TypeReferenced struct must contain a constructor with types that extend Type")); + int length = constructor.getParameterCount(); + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append('('); + for (int i = 0; i < length; i++) { + TypeReference typeReferenceElement = + TypeReference.create(constructor.getGenericParameterTypes()[i]); + stringBuilder.append(getTypeName(typeReferenceElement)); + stringBuilder.append(','); + } + stringBuilder.delete(stringBuilder.length() - 1, stringBuilder.length()); + stringBuilder.append(')'); + return stringBuilder.toString(); + } else { + return simpleName; + } + } + public static String getTypeName(TypeReference typeReference) { return getTypeName(typeReference.getType()); } @@ -85,6 +166,8 @@ static String getSimpleTypeName(Class type) { return "string"; } else if (type.equals(DynamicBytes.class)) { return "bytes"; + } else if (StructType.class.isAssignableFrom(type)) { + return type.getName(); } else { return simpleName; } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/Array.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/Array.java index b24d354cc..1975d9b86 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/Array.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/Array.java @@ -1,14 +1,12 @@ package org.fisco.bcos.sdk.abi.datatypes; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; +import java.util.*; /** Fixed size array. */ public abstract class Array implements Type> { private String type; + protected Class typeClass; protected final List value; @SafeVarargs @@ -37,6 +35,21 @@ public abstract class Array implements Type> { this.value = Collections.emptyList(); } + Array(Class type, List values) { + Objects.requireNonNull(type); + if (!valid(values, type.getTypeName())) { + throw new UnsupportedOperationException( + "If empty list is provided, use empty array instance"); + } + this.typeClass = type; + this.value = values; + } + + @SafeVarargs + Array(Class type, T... values) { + this(type, Arrays.asList(values)); + } + @Override public List getValue() { return value; @@ -61,7 +74,7 @@ private boolean valid(T[] values, String type) { } private boolean valid(List values, String type) { - return (values != null && values.size() != 0) || type != null; + return (values != null && !values.isEmpty()) || type != null; } @Override @@ -75,15 +88,12 @@ public boolean equals(Object o) { Array array = (Array) o; - if (!type.equals(array.type)) { - return false; - } return value != null ? value.equals(array.value) : array.value == null; } @Override public int hashCode() { - int result = type.hashCode(); + int result = 1; result = 31 * result + (value != null ? value.hashCode() : 0); return result; } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/DynamicArray.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/DynamicArray.java index 01cd26929..8513b0b86 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/DynamicArray.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/DynamicArray.java @@ -1,23 +1,47 @@ package org.fisco.bcos.sdk.abi.datatypes; +import static org.fisco.bcos.sdk.abi.Utils.getTypeName; + import java.util.List; +import org.fisco.bcos.sdk.abi.datatypes.generated.AbiTypes; /** Dynamic array type. */ public class DynamicArray extends Array { @SafeVarargs public DynamicArray(T... values) { - super(values[0].getTypeAsString() + "[]", values); + super( + StructType.class.isAssignableFrom(values[0].getClass()) + ? (Class) values[0].getClass() + : (Array.class.isAssignableFrom(values[0].getClass()) + ? (Class) values[0].getClass() + : (Class) AbiTypes.getType(values[0].getTypeAsString())), + values); } public DynamicArray(List values) { - super(values.get(0).getTypeAsString() + "[]", values); + super( + StructType.class.isAssignableFrom(values.get(0).getClass()) + ? (Class) values.get(0).getClass() + : (Array.class.isAssignableFrom(values.get(0).getClass()) + ? (Class) values.get(0).getClass() + : (Class) AbiTypes.getType(values.get(0).getTypeAsString())), + values); } private DynamicArray(String type) { super(type); } + public DynamicArray(Class type, List values) { + super(type, values); + } + + @SafeVarargs + public DynamicArray(Class type, T... values) { + super(type, values); + } + public static DynamicArray empty(String type) { return new DynamicArray(type); } @@ -27,6 +51,31 @@ public boolean dynamicType() { return true; } + @Override + public String getTypeAsString() { + String paramsType; + if (!value.isEmpty() && StructType.class.isAssignableFrom(value.get(0).getClass())) { + paramsType = value.get(0).getTypeAsString(); + } else if (StructType.class.isAssignableFrom(this.typeClass)) { + try { + T t = this.typeClass.newInstance(); + paramsType = t.getTypeAsString(); + } catch (InstantiationException | IllegalAccessException e) { + // struct type is not defined default constructor + paramsType = AbiTypes.getTypeAString(this.typeClass); + } + } else if (Array.class.isAssignableFrom(this.typeClass)) { + if (!value.isEmpty()) { + paramsType = value.get(0).getTypeAsString(); + } else { + paramsType = getTypeName((typeClass)); + } + } else { + paramsType = AbiTypes.getTypeAString(typeClass); + } + return paramsType + "[]"; + } + @Override public int offset() { return 1; diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/StaticArray.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/StaticArray.java index 957271c33..f20787225 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/StaticArray.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/StaticArray.java @@ -1,6 +1,8 @@ package org.fisco.bcos.sdk.abi.datatypes; +import java.util.Arrays; import java.util.List; +import org.fisco.bcos.sdk.abi.datatypes.generated.AbiTypes; /** Static array type. */ public class StaticArray extends Array { @@ -14,28 +16,75 @@ public class StaticArray extends Array { @SafeVarargs public StaticArray(T... values) { - super(values[0].getTypeAsString() + "[" + values.length + "]", values); + super( + StructType.class.isAssignableFrom(values[0].getClass()) + ? (Class) values[0].getClass() + : (Class) AbiTypes.getType(values[0].getTypeAsString()), + values); isValid(); } @SafeVarargs public StaticArray(int expectedSize, T... values) { - super(values[0].getTypeAsString() + "[" + values.length + "]", values); + super( + StructType.class.isAssignableFrom(values[0].getClass()) + ? (Class) values[0].getClass() + : (Class) AbiTypes.getType(values[0].getTypeAsString()), + values); this.expectedSize = expectedSize; isValid(); } public StaticArray(List values) { - super(values.get(0).getTypeAsString() + "[" + values.size() + "]", values); + super( + StructType.class.isAssignableFrom(values.get(0).getClass()) + ? (Class) values.get(0).getClass() + : (Class) AbiTypes.getType(values.get(0).getTypeAsString()), + values); isValid(); } public StaticArray(int expectedSize, List values) { - super(values.get(0).getTypeAsString() + "[" + values.size() + "]", values); + super( + StructType.class.isAssignableFrom(values.get(0).getClass()) + ? (Class) values.get(0).getClass() + : (Class) AbiTypes.getType(values.get(0).getTypeAsString()), + values); this.expectedSize = expectedSize; isValid(); } + @SafeVarargs + public StaticArray(Class type, T... values) { + this(type, Arrays.asList(values)); + } + + @SafeVarargs + public StaticArray(Class type, int expectedSize, T... values) { + this(type, expectedSize, Arrays.asList(values)); + } + + public StaticArray(Class type, List values) { + this(type, values == null ? 0 : values.size(), values); + } + + public StaticArray(Class type, int expectedSize, List values) { + super(type, values); + this.expectedSize = expectedSize; + isValid(); + } + + @Override + public String getTypeAsString() { + String type; + if (StructType.class.isAssignableFrom(value.get(0).getClass())) { + type = value.get(0).getTypeAsString(); + } else { + type = AbiTypes.getTypeAString(this.typeClass); + } + return type + "[" + value.size() + "]"; + } + private void isValid() { if (expectedSize == null && value.size() > MAX_SIZE_OF_STATIC_ARRAY) { throw new UnsupportedOperationException( diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray1.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray1.java index a3628ca82..b156c0da8 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray1.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray1.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray1 extends StaticArray { + @Deprecated public StaticArray1(List values) { super(1, values); } + @Deprecated @SafeVarargs public StaticArray1(T... values) { super(1, values); } + + public StaticArray1(Class type, List values) { + super(type, 1, values); + } + + @SafeVarargs + public StaticArray1(Class type, T... values) { + super(type, 1, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray10.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray10.java index 549208a12..666e7984f 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray10.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray10.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray10 extends StaticArray { + @Deprecated public StaticArray10(List values) { super(10, values); } + @Deprecated @SafeVarargs public StaticArray10(T... values) { super(10, values); } + + public StaticArray10(Class type, List values) { + super(type, 10, values); + } + + @SafeVarargs + public StaticArray10(Class type, T... values) { + super(type, 10, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray11.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray11.java index b64644485..bac26a9d3 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray11.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray11.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray11 extends StaticArray { + @Deprecated public StaticArray11(List values) { super(11, values); } + @Deprecated @SafeVarargs public StaticArray11(T... values) { super(11, values); } + + public StaticArray11(Class type, List values) { + super(type, 11, values); + } + + @SafeVarargs + public StaticArray11(Class type, T... values) { + super(type, 11, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray12.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray12.java index b520868d7..14efd9676 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray12.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray12.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray12 extends StaticArray { + @Deprecated public StaticArray12(List values) { super(12, values); } + @Deprecated @SafeVarargs public StaticArray12(T... values) { super(12, values); } + + public StaticArray12(Class type, List values) { + super(type, 12, values); + } + + @SafeVarargs + public StaticArray12(Class type, T... values) { + super(type, 12, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray128.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray128.java index a4469527b..716bbca12 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray128.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray128.java @@ -9,7 +9,7 @@ * *

Do not modifiy! * - *

Please use org.web3j.codegen.AbiTypesGenerator in the Please use AbiTypesGenerator in the codegen module to update. */ public class StaticArray128 extends StaticArray { @@ -23,13 +23,13 @@ public StaticArray128(List values) { public StaticArray128(T... values) { super(128, values); } - // - // public StaticArray128(Class type, List values) { - // super(type, 128, values); - // } - // - // @SafeVarargs - // public StaticArray128(Class type, T... values) { - // super(type, 128, values); - // } + + public StaticArray128(Class type, List values) { + super(type, 128, values); + } + + @SafeVarargs + public StaticArray128(Class type, T... values) { + super(type, 128, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray13.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray13.java index 32391fa9f..9eaf403ae 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray13.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray13.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray13 extends StaticArray { + @Deprecated public StaticArray13(List values) { super(13, values); } + @Deprecated @SafeVarargs public StaticArray13(T... values) { super(13, values); } + + public StaticArray13(Class type, List values) { + super(type, 13, values); + } + + @SafeVarargs + public StaticArray13(Class type, T... values) { + super(type, 13, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray14.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray14.java index 680d29e0a..c399db12c 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray14.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray14.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray14 extends StaticArray { + @Deprecated public StaticArray14(List values) { super(14, values); } + @Deprecated @SafeVarargs public StaticArray14(T... values) { super(14, values); } + + public StaticArray14(Class type, List values) { + super(type, 14, values); + } + + @SafeVarargs + public StaticArray14(Class type, T... values) { + super(type, 14, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray15.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray15.java index c9f4b07bb..24958de9b 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray15.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray15.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray15 extends StaticArray { + @Deprecated public StaticArray15(List values) { super(15, values); } + @Deprecated @SafeVarargs public StaticArray15(T... values) { super(15, values); } + + public StaticArray15(Class type, List values) { + super(type, 15, values); + } + + @SafeVarargs + public StaticArray15(Class type, T... values) { + super(type, 15, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray16.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray16.java index 92e5a8442..8019b166e 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray16.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray16.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray16 extends StaticArray { + @Deprecated public StaticArray16(List values) { super(16, values); } + @Deprecated @SafeVarargs public StaticArray16(T... values) { super(16, values); } + + public StaticArray16(Class type, List values) { + super(type, 16, values); + } + + @SafeVarargs + public StaticArray16(Class type, T... values) { + super(type, 16, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray17.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray17.java index c0e5a44b6..bd8136984 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray17.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray17.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray17 extends StaticArray { + @Deprecated public StaticArray17(List values) { super(17, values); } + @Deprecated @SafeVarargs public StaticArray17(T... values) { super(17, values); } + + public StaticArray17(Class type, List values) { + super(type, 17, values); + } + + @SafeVarargs + public StaticArray17(Class type, T... values) { + super(type, 17, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray18.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray18.java index 10261b048..52ff8afab 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray18.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray18.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray18 extends StaticArray { + @Deprecated public StaticArray18(List values) { super(18, values); } + @Deprecated @SafeVarargs public StaticArray18(T... values) { super(18, values); } + + public StaticArray18(Class type, List values) { + super(type, 18, values); + } + + @SafeVarargs + public StaticArray18(Class type, T... values) { + super(type, 18, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray19.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray19.java index 861b9b68a..f3be54021 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray19.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray19.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray19 extends StaticArray { + @Deprecated public StaticArray19(List values) { super(19, values); } + @Deprecated @SafeVarargs public StaticArray19(T... values) { super(19, values); } + + public StaticArray19(Class type, List values) { + super(type, 19, values); + } + + @SafeVarargs + public StaticArray19(Class type, T... values) { + super(type, 19, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray2.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray2.java index af50b5ed0..52c0e4569 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray2.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray2.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray2 extends StaticArray { + @Deprecated public StaticArray2(List values) { super(2, values); } + @Deprecated @SafeVarargs public StaticArray2(T... values) { super(2, values); } + + public StaticArray2(Class type, List values) { + super(type, 2, values); + } + + @SafeVarargs + public StaticArray2(Class type, T... values) { + super(type, 2, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray20.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray20.java index 3a4ef52aa..9a88af70b 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray20.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray20.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray20 extends StaticArray { + @Deprecated public StaticArray20(List values) { super(20, values); } + @Deprecated @SafeVarargs public StaticArray20(T... values) { super(20, values); } + + public StaticArray20(Class type, List values) { + super(type, 20, values); + } + + @SafeVarargs + public StaticArray20(Class type, T... values) { + super(type, 20, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray21.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray21.java index 83fad2583..39050d016 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray21.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray21.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray21 extends StaticArray { + @Deprecated public StaticArray21(List values) { super(21, values); } + @Deprecated @SafeVarargs public StaticArray21(T... values) { super(21, values); } + + public StaticArray21(Class type, List values) { + super(type, 21, values); + } + + @SafeVarargs + public StaticArray21(Class type, T... values) { + super(type, 21, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray22.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray22.java index ba6d078d6..cfc5fbaeb 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray22.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray22.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray22 extends StaticArray { + @Deprecated public StaticArray22(List values) { super(22, values); } + @Deprecated @SafeVarargs public StaticArray22(T... values) { super(22, values); } + + public StaticArray22(Class type, List values) { + super(type, 22, values); + } + + @SafeVarargs + public StaticArray22(Class type, T... values) { + super(type, 22, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray23.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray23.java index f29d51ef1..f18f2de70 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray23.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray23.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray23 extends StaticArray { + @Deprecated public StaticArray23(List values) { super(23, values); } + @Deprecated @SafeVarargs public StaticArray23(T... values) { super(23, values); } + + public StaticArray23(Class type, List values) { + super(type, 23, values); + } + + @SafeVarargs + public StaticArray23(Class type, T... values) { + super(type, 23, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray24.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray24.java index 9928e5bf8..6ad10ba6c 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray24.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray24.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray24 extends StaticArray { + @Deprecated public StaticArray24(List values) { super(24, values); } + @Deprecated @SafeVarargs public StaticArray24(T... values) { super(24, values); } + + public StaticArray24(Class type, List values) { + super(type, 24, values); + } + + @SafeVarargs + public StaticArray24(Class type, T... values) { + super(type, 24, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray25.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray25.java index fd204865e..05406fb40 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray25.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray25.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray25 extends StaticArray { + @Deprecated public StaticArray25(List values) { super(25, values); } + @Deprecated @SafeVarargs public StaticArray25(T... values) { super(25, values); } + + public StaticArray25(Class type, List values) { + super(type, 25, values); + } + + @SafeVarargs + public StaticArray25(Class type, T... values) { + super(type, 25, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray26.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray26.java index 919179488..4fa5e42be 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray26.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray26.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray26 extends StaticArray { + @Deprecated public StaticArray26(List values) { super(26, values); } + @Deprecated @SafeVarargs public StaticArray26(T... values) { super(26, values); } + + public StaticArray26(Class type, List values) { + super(type, 26, values); + } + + @SafeVarargs + public StaticArray26(Class type, T... values) { + super(type, 26, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray27.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray27.java index d9df13688..0fa1b972e 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray27.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray27.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray27 extends StaticArray { + @Deprecated public StaticArray27(List values) { super(27, values); } + @Deprecated @SafeVarargs public StaticArray27(T... values) { super(27, values); } + + public StaticArray27(Class type, List values) { + super(type, 27, values); + } + + @SafeVarargs + public StaticArray27(Class type, T... values) { + super(type, 27, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray28.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray28.java index 90b6f2ea3..f1a23695e 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray28.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray28.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray28 extends StaticArray { + @Deprecated public StaticArray28(List values) { super(28, values); } + @Deprecated @SafeVarargs public StaticArray28(T... values) { super(28, values); } + + public StaticArray28(Class type, List values) { + super(type, 28, values); + } + + @SafeVarargs + public StaticArray28(Class type, T... values) { + super(type, 28, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray29.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray29.java index e245cd4ae..f2963b33f 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray29.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray29.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray29 extends StaticArray { + @Deprecated public StaticArray29(List values) { super(29, values); } + @Deprecated @SafeVarargs public StaticArray29(T... values) { super(29, values); } + + public StaticArray29(Class type, List values) { + super(type, 29, values); + } + + @SafeVarargs + public StaticArray29(Class type, T... values) { + super(type, 29, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray3.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray3.java index b412b5316..7d842148b 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray3.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray3.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray3 extends StaticArray { + @Deprecated public StaticArray3(List values) { super(3, values); } + @Deprecated @SafeVarargs public StaticArray3(T... values) { super(3, values); } + + public StaticArray3(Class type, List values) { + super(type, 3, values); + } + + @SafeVarargs + public StaticArray3(Class type, T... values) { + super(type, 3, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray30.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray30.java index e933c647c..967174835 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray30.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray30.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray30 extends StaticArray { + @Deprecated public StaticArray30(List values) { super(30, values); } + @Deprecated @SafeVarargs public StaticArray30(T... values) { super(30, values); } + + public StaticArray30(Class type, List values) { + super(type, 30, values); + } + + @SafeVarargs + public StaticArray30(Class type, T... values) { + super(type, 30, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray31.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray31.java index 7a2112811..b2f09e510 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray31.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray31.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray31 extends StaticArray { + @Deprecated public StaticArray31(List values) { super(31, values); } + @Deprecated @SafeVarargs public StaticArray31(T... values) { super(31, values); } + + public StaticArray31(Class type, List values) { + super(type, 31, values); + } + + @SafeVarargs + public StaticArray31(Class type, T... values) { + super(type, 31, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray32.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray32.java index fe69fa45c..c582d3dec 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray32.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray32.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray32 extends StaticArray { + @Deprecated public StaticArray32(List values) { super(32, values); } + @Deprecated @SafeVarargs public StaticArray32(T... values) { super(32, values); } + + public StaticArray32(Class type, List values) { + super(type, 32, values); + } + + @SafeVarargs + public StaticArray32(Class type, T... values) { + super(type, 32, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray4.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray4.java index e6194e7da..81b7acff1 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray4.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray4.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray4 extends StaticArray { + @Deprecated public StaticArray4(List values) { super(4, values); } + @Deprecated @SafeVarargs public StaticArray4(T... values) { super(4, values); } + + public StaticArray4(Class type, List values) { + super(type, 4, values); + } + + @SafeVarargs + public StaticArray4(Class type, T... values) { + super(type, 4, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray5.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray5.java index c39451be5..5c947fa98 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray5.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray5.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray5 extends StaticArray { + @Deprecated public StaticArray5(List values) { super(5, values); } + @Deprecated @SafeVarargs public StaticArray5(T... values) { super(5, values); } + + public StaticArray5(Class type, List values) { + super(type, 5, values); + } + + @SafeVarargs + public StaticArray5(Class type, T... values) { + super(type, 5, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray6.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray6.java index 2fdd2b60a..1119fed28 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray6.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray6.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray6 extends StaticArray { + @Deprecated public StaticArray6(List values) { super(6, values); } + @Deprecated @SafeVarargs public StaticArray6(T... values) { super(6, values); } + + public StaticArray6(Class type, List values) { + super(type, 6, values); + } + + @SafeVarargs + public StaticArray6(Class type, T... values) { + super(type, 6, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray7.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray7.java index c31125d69..d4fdcf71b 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray7.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray7.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray7 extends StaticArray { + @Deprecated public StaticArray7(List values) { super(7, values); } + @Deprecated @SafeVarargs public StaticArray7(T... values) { super(7, values); } + + public StaticArray7(Class type, List values) { + super(type, 7, values); + } + + @SafeVarargs + public StaticArray7(Class type, T... values) { + super(type, 7, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray8.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray8.java index e36ad5cc8..1987f768b 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray8.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray8.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray8 extends StaticArray { + @Deprecated public StaticArray8(List values) { super(8, values); } + @Deprecated @SafeVarargs public StaticArray8(T... values) { super(8, values); } + + public StaticArray8(Class type, List values) { + super(type, 8, values); + } + + @SafeVarargs + public StaticArray8(Class type, T... values) { + super(type, 8, values); + } } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray9.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray9.java index bd297958b..a59780e4d 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray9.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/generated/StaticArray9.java @@ -13,12 +13,23 @@ * href="https://github.com/web3j/web3j/tree/master/codegen">codegen module to update. */ public class StaticArray9 extends StaticArray { + @Deprecated public StaticArray9(List values) { super(9, values); } + @Deprecated @SafeVarargs public StaticArray9(T... values) { super(9, values); } + + public StaticArray9(Class type, List values) { + super(type, 9, values); + } + + @SafeVarargs + public StaticArray9(Class type, T... values) { + super(type, 9, values); + } } diff --git a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/contract/Contract.java b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/contract/Contract.java index caef3b833..0b5605939 100644 --- a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/contract/Contract.java +++ b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/contract/Contract.java @@ -17,7 +17,6 @@ import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -26,10 +25,7 @@ import org.fisco.bcos.sdk.abi.FunctionEncoder; import org.fisco.bcos.sdk.abi.FunctionReturnDecoder; import org.fisco.bcos.sdk.abi.TypeReference; -import org.fisco.bcos.sdk.abi.datatypes.Address; -import org.fisco.bcos.sdk.abi.datatypes.Event; -import org.fisco.bcos.sdk.abi.datatypes.Function; -import org.fisco.bcos.sdk.abi.datatypes.Type; +import org.fisco.bcos.sdk.abi.datatypes.*; import org.fisco.bcos.sdk.client.Client; import org.fisco.bcos.sdk.client.protocol.response.Call; import org.fisco.bcos.sdk.crypto.CryptoSuite; @@ -427,8 +423,12 @@ protected List extractEventParametersWithLog( @SuppressWarnings("unchecked") public static List convertToNative(List arr) { List out = new ArrayList(); - for (Iterator it = arr.iterator(); it.hasNext(); ) { - out.add((T) it.next().getValue()); + for (S s : arr) { + if (Array.class.isAssignableFrom(s.getClass())) { + out.add((T) convertToNative((List) ((Array) s).getValue())); + } else { + out.add((T) s.getValue()); + } } return out; } diff --git a/src/integration-test/java/org/fisco/bcos/sdk/BcosSDKTest.java b/src/integration-test/java/org/fisco/bcos/sdk/BcosSDKTest.java index cb8fee68f..0bbfcc634 100644 --- a/src/integration-test/java/org/fisco/bcos/sdk/BcosSDKTest.java +++ b/src/integration-test/java/org/fisco/bcos/sdk/BcosSDKTest.java @@ -60,8 +60,11 @@ import org.fisco.bcos.sdk.utils.Hex; import org.fisco.bcos.sdk.utils.Numeric; import org.junit.Assert; +import org.junit.FixMethodOrder; import org.junit.Test; +import org.junit.runners.MethodSorters; +@FixMethodOrder(MethodSorters.NAME_ASCENDING) public class BcosSDKTest { private static final String configFile = BcosSDKTest.class @@ -70,13 +73,17 @@ public class BcosSDKTest { .getPath(); @Test - public void test1Client() throws ConfigException { + public void test1Client() + throws ConfigException, ContractException, ChannelPrococolExceiption, + InterruptedException { BcosSDK sdk = BcosSDK.build(configFile); // check groupList Assert.assertTrue(sdk.getChannel().getAvailablePeer().size() >= 1); // get the client Client client = sdk.getClient(Integer.valueOf(1)); + HelloWorld.deploy(client, client.getCryptoSuite().getCryptoKeyPair()); + // test getBlockNumber BlockNumber blockNumber = client.getBlockNumber(); @@ -149,6 +156,7 @@ public void test1Client() throws ConfigException { client.getPbftView(); // getSyncStatus + blockNumber = client.getBlockNumber(); BlockHash latestHash = client.getBlockHashByNumber(blockNumber.getBlockNumber()); SyncStatus syncStatus = client.getSyncStatus(); Assert.assertEquals( @@ -196,45 +204,39 @@ public void test1Client() throws ConfigException { latestHash.getBlockHashByNumber(), consensusStatus.getConsensusStatus().getBaseConsensusInfo().getHighestblockHash()); - try { - // test calculateHash interface for the transaction response - BcosTransaction transaction = - client.getTransactionByBlockNumberAndIndex( - blockNumber.getBlockNumber(), BigInteger.ZERO); - if (transaction.getTransaction().get() != null) { - System.out.println( - "### transactionHash:" + transaction.getTransaction().get().getHash()); - System.out.println( - "### calculated transactionHash:" - + transaction - .getTransaction() - .get() - .calculateHash(client.getCryptoSuite())); - System.out.println( - "### transaction" + transaction.getTransaction().get().toString()); - Assert.assertEquals( - transaction.getTransaction().get().calculateHash(client.getCryptoSuite()), - transaction.getTransaction().get().getHash()); - } - - // test calculateHash interface for the getBlockHeader response - BcosBlockHeader blockHeader = - client.getBlockHeaderByNumber(blockNumber.getBlockNumber(), true); - String calculatedHash = - blockHeader.getBlockHeader().calculateHash(client.getCryptoSuite()); - System.out.println("### blockHeader calculatedHash : " + calculatedHash); + // test calculateHash interface for the transaction response + BcosTransaction transaction = + client.getTransactionByBlockNumberAndIndex( + blockNumber.getBlockNumber(), BigInteger.ZERO); + if (transaction.getTransaction().get() != null) { + System.out.println( + "### transactionHash:" + transaction.getTransaction().get().getHash()); System.out.println( - "### blockHeader expectedHash: " + blockHeader.getBlockHeader().getHash()); - Assert.assertEquals(blockHeader.getBlockHeader().getHash(), calculatedHash); - - // test calculateHash interface for the block response - block = client.getBlockByNumber(blockNumber.getBlockNumber(), false); - calculatedHash = block.getBlock().calculateHash(client.getCryptoSuite()); - Assert.assertEquals(block.getBlock().getHash(), calculatedHash); - test2SendTransactions(); - } catch (ClientException | ContractException e) { - System.out.println("testClient exception, error info: " + e.getMessage()); + "### calculated transactionHash:" + + transaction + .getTransaction() + .get() + .calculateHash(client.getCryptoSuite())); + System.out.println("### transaction" + transaction.getTransaction().get().toString()); + Assert.assertEquals( + transaction.getTransaction().get().calculateHash(client.getCryptoSuite()), + transaction.getTransaction().get().getHash()); } + + // test calculateHash interface for the getBlockHeader response + BcosBlockHeader blockHeader = + client.getBlockHeaderByNumber(blockNumber.getBlockNumber(), true); + String calculatedHash = blockHeader.getBlockHeader().calculateHash(client.getCryptoSuite()); + System.out.println("### blockHeader calculatedHash : " + calculatedHash); + System.out.println( + "### blockHeader expectedHash: " + blockHeader.getBlockHeader().getHash()); + Assert.assertEquals(blockHeader.getBlockHeader().getHash(), calculatedHash); + + // test calculateHash interface for the block response + block = client.getBlockByNumber(blockNumber.getBlockNumber(), false); + calculatedHash = block.getBlock().calculateHash(client.getCryptoSuite()); + Assert.assertEquals(block.getBlock().getHash(), calculatedHash); + test2SendTransactions(); } private void checkReceipt( @@ -290,84 +292,86 @@ public void onResponse(TransactionReceipt receipt) { } } - public void test2SendTransactions() throws ConfigException, ContractException { + public void test2SendTransactions() + throws ConfigException, ContractException, ChannelPrococolExceiption, + InterruptedException { + System.out.println("#### testSendTransactions"); + BcosSDK sdk = BcosSDK.build(configFile); + Integer groupId = Integer.valueOf(1); + Client client = sdk.getClient(groupId); + BigInteger blockLimit = sdk.getGroupManagerService().getBlockLimitByGroup(groupId); + BigInteger blockNumber = client.getBlockNumber().getBlockNumber(); + // deploy the HelloWorld contract + HelloWorld helloWorld = + HelloWorld.deploy(client, client.getCryptoSuite().getCryptoKeyPair()); + checkReceipt( + helloWorld, + client, + blockNumber.add(BigInteger.ONE), + helloWorld.getDeployReceipt(), + false); + + // check the blockLimit has been modified + // wait the block number notification + Thread.sleep(1000); + Assert.assertTrue( + sdk.getGroupManagerService() + .getBlockLimitByGroup(groupId) + .compareTo(blockLimit.add(BigInteger.ONE)) + >= 0); + Assert.assertTrue(helloWorld != null); + Assert.assertTrue(helloWorld.getContractAddress() != null); + + // send transaction + String settedString = "Hello, FISCO"; + TransactionReceipt receipt = helloWorld.set(settedString); + Assert.assertTrue(receipt != null); + TransactionCallbackTest callback = new TransactionCallbackTest(); + byte[] transactionHash = helloWorld.set(settedString, callback); + // wait here try { - System.out.println("#### testSendTransactions"); - BcosSDK sdk = BcosSDK.build(configFile); - Integer groupId = Integer.valueOf(1); - Client client = sdk.getClient(groupId); - BigInteger blockLimit = sdk.getGroupManagerService().getBlockLimitByGroup(groupId); - BigInteger blockNumber = client.getBlockNumber().getBlockNumber(); - // deploy the HelloWorld contract - HelloWorld helloWorld = - HelloWorld.deploy(client, client.getCryptoSuite().getCryptoKeyPair()); - checkReceipt( - helloWorld, - client, - blockNumber.add(BigInteger.ONE), - helloWorld.getDeployReceipt(), - false); - - // check the blockLimit has been modified - // wait the block number notification - Thread.sleep(1000); - Assert.assertTrue( - sdk.getGroupManagerService() - .getBlockLimitByGroup(groupId) - .compareTo(blockLimit.add(BigInteger.ONE)) - >= 0); - Assert.assertTrue(helloWorld != null); - Assert.assertTrue(helloWorld.getContractAddress() != null); - - // send transaction - String settedString = "Hello, FISCO"; - TransactionReceipt receipt = helloWorld.set(settedString); - Assert.assertTrue(receipt != null); - TransactionCallbackTest callback = new TransactionCallbackTest(); - byte[] transactionHash = helloWorld.set(settedString, callback); - // wait here - try { - callback.semaphore.acquire(1); - callback.semaphore.release(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - // check the hash - Assert.assertEquals( - "0x" + Hex.toHexString(transactionHash), callback.receipt.getTransactionHash()); + callback.semaphore.acquire(1); + callback.semaphore.release(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + // check the hash + Assert.assertEquals( + "0x" + Hex.toHexString(transactionHash), callback.receipt.getTransactionHash()); - checkReceipt(helloWorld, client, blockNumber.add(BigInteger.valueOf(2)), receipt, true); - // wait the blocknumber notification - Thread.sleep(1000); - System.out.println( - sdk.getGroupManagerService().getBlockLimitByGroup(groupId) - + " " - + blockLimit.add(BigInteger.valueOf(2))); - Assert.assertTrue( - sdk.getGroupManagerService() - .getBlockLimitByGroup(groupId) - .compareTo(blockLimit.add(BigInteger.valueOf(2))) - >= 0); - // get the modified value - String getValue = helloWorld.get(); - Assert.assertTrue(getValue.equals(settedString)); - - // load contract from the contract address - HelloWorld helloWorld2 = - HelloWorld.load( - helloWorld.getContractAddress(), - client, - client.getCryptoSuite().getCryptoKeyPair()); - Assert.assertTrue( - helloWorld2.getContractAddress().equals(helloWorld.getContractAddress())); - settedString = "Hello, Fisco2"; - TransactionReceipt receipt2 = helloWorld2.set(settedString); - checkReceipt( - helloWorld2, client, blockNumber.add(BigInteger.valueOf(3)), receipt2, true); - Assert.assertTrue(helloWorld.get().equals(settedString)); - Assert.assertTrue(helloWorld2.get().equals(settedString)); - - // test getBatchReceiptsByBlockHashAndRange(added after v2.7.0) + checkReceipt(helloWorld, client, blockNumber.add(BigInteger.valueOf(2)), receipt, true); + // wait the blocknumber notification + Thread.sleep(1000); + System.out.println( + sdk.getGroupManagerService().getBlockLimitByGroup(groupId) + + " " + + blockLimit.add(BigInteger.valueOf(2))); + Assert.assertTrue( + sdk.getGroupManagerService() + .getBlockLimitByGroup(groupId) + .compareTo(blockLimit.add(BigInteger.valueOf(2))) + >= 0); + // get the modified value + String getValue = helloWorld.get(); + Assert.assertTrue(getValue.equals(settedString)); + + // load contract from the contract address + HelloWorld helloWorld2 = + HelloWorld.load( + helloWorld.getContractAddress(), + client, + client.getCryptoSuite().getCryptoKeyPair()); + Assert.assertTrue(helloWorld2.getContractAddress().equals(helloWorld.getContractAddress())); + settedString = "Hello, Fisco2"; + TransactionReceipt receipt2 = helloWorld2.set(settedString); + checkReceipt(helloWorld2, client, blockNumber.add(BigInteger.valueOf(3)), receipt2, true); + Assert.assertTrue(helloWorld.get().equals(settedString)); + Assert.assertTrue(helloWorld2.get().equals(settedString)); + + // test getBatchReceiptsByBlockHashAndRange(added after v2.7.0) + String osName = System.getProperty("os.name"); + // node rpc error: zip compress not support on mac os + if (!osName.startsWith("Mac OS")) { BcosTransactionReceiptsDecoder bcosTransactionReceiptsDecoder = client.getBatchReceiptsByBlockHashAndRange( client.getBlockHashByNumber(client.getBlockNumber().getBlockNumber()) @@ -388,15 +392,11 @@ public void test2SendTransactions() throws ConfigException, ContractException { + bcosTransactionReceiptsDecoder .decodeTransactionReceiptsInfo() .toString()); - testECRecover(); - testSM2Recover(); - testCurve25519VRFVerify(); - } catch (ContractException - | ClientException - | InterruptedException - | ChannelPrococolExceiption e) { - System.out.println("testSendTransactions exceptioned, error info:" + e.getMessage()); } + + testECRecover(); + testSM2Recover(); + testCurve25519VRFVerify(); } public void testECRecover() throws ContractException { diff --git a/src/integration-test/java/org/fisco/bcos/sdk/contract/CodecTest.java b/src/integration-test/java/org/fisco/bcos/sdk/contract/CodecTest.java new file mode 100644 index 000000000..664964826 --- /dev/null +++ b/src/integration-test/java/org/fisco/bcos/sdk/contract/CodecTest.java @@ -0,0 +1,2468 @@ +package org.fisco.bcos.sdk.contract; + +import java.math.BigInteger; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.fisco.bcos.sdk.abi.FunctionReturnDecoder; +import org.fisco.bcos.sdk.abi.TypeReference; +import org.fisco.bcos.sdk.abi.Utils; +import org.fisco.bcos.sdk.abi.datatypes.*; +import org.fisco.bcos.sdk.abi.datatypes.generated.*; +import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple1; +import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple6; +import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple7; +import org.fisco.bcos.sdk.client.Client; +import org.fisco.bcos.sdk.crypto.CryptoSuite; +import org.fisco.bcos.sdk.crypto.keypair.CryptoKeyPair; +import org.fisco.bcos.sdk.model.CryptoType; +import org.fisco.bcos.sdk.model.TransactionReceipt; +import org.fisco.bcos.sdk.model.callback.TransactionCallback; +import org.fisco.bcos.sdk.transaction.model.exception.ContractException; +import org.fisco.bcos.sdk.utils.StringUtils; + +@SuppressWarnings("unchecked") +public class CodecTest extends Contract { + public static final String[] BINARY_ARRAY = { + "60806040523480156200001157600080fd5b506040518060400160405280600d81526020017f48656c6c6f2c20576f726c642100000000000000000000000000000000000000815250600090805190602001906200005f92919062000066565b5062000115565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000a957805160ff1916838001178555620000da565b82800160010185558215620000da579182015b82811115620000d9578251825591602001919060010190620000bc565b5b509050620000e99190620000ed565b5090565b6200011291905b808211156200010e576000816000905550600101620000f4565b5090565b90565b61681480620001256000396000f3fe608060405234801561001057600080fd5b50600436106104545760003560e01c80637991369911610241578063d562c1e61161013b578063e60fc960116100c3578063edf1319611610087578063edf1319614610c73578063f8e41ebd14610c91578063f9c4aa3714610cad578063fba1a1c314610ccb578063fed22d6014610ce757610454565b8063e60fc96014610be5578063e9becf3214610c03578063ea1a81ab14610c1f578063ec61c15714610c3b578063edec1a8414610c5757610454565b8063de3fc3e31161010a578063de3fc3e314610b51578063ded516d214610b6f578063e1a0506a14610b8d578063e30081a014610bab578063e3d9f63f14610bc757610454565b8063d562c1e614610add578063d5ac3bb614610af9578063d8daa2d914610b17578063da359dc814610b3557610454565b8063ac4df8d7116101c9578063c35a20e41161018d578063c35a20e414610a4f578063d07c8de114610a6b578063d30ebb7214610a89578063d49f5b0c14610aa5578063d4ffb63214610ac157610454565b8063ac4df8d7146109bd578063b47a8402146109d9578063b74daf63146109f7578063b8b5729814610a15578063c2b12a7314610a3357610454565b8063911f24d411610210578063911f24d4146109295780639276da411461094757806394b36ca314610963578063973496f61461098157806399f719b21461099f57610454565b806379913699146108b35780637a5cc140146108d157806386b77823146108ed57806388e2b03b1461090b57610454565b806338d0f94e116103525780634caa8481116102da578063567f454a1161029e578063567f454a1461081a5780635a9ca114146108365780635cccd0c8146108545780636d4ce63c1461087757806375a3b91c1461089557610454565b80634caa8481146107875780634ed3885e146107aa5780634f0fdc47146107c65780634f58ae26146107e257806352cc0134146107fe57610454565b80633e486bfc116103215780633e486bfc146106f157806340a5f7ef1461070f5780634156e98f14610733578063436daabd1461074f5780634bbfc6d31461076b57610454565b806338d0f94e1461067b57806339e36107146106995780633d3b79e2146106b75780633e1af988146106d357610454565b80631e26fd33116103e05780632be9171c116103a45780632be9171c146105eb578063313835861461060957806334b3491f14610625578063353ab14a1461064157806338cc48311461065d57610454565b80631e26fd331461055d5780631f9030371461057957806324749bac1461059757806327c50eca146105b35780632a74abca146105cf57610454565b80630fdda3ef116104275780630fdda3ef146104cd57806312a7b914146104e95780631332af961461050757806317b90d94146105255780631c59d68c1461054157610454565b80630952b8f8146104595780630b75ce03146104775780630bcd3b33146104935780630e08b25c146104b1575b600080fd5b610461610d05565b60405161046e9190615a90565b60405180910390f35b610491600480360381019061048c919061443b565b610d5d565b005b61049b610d72565b6040516104a89190615be7565b60405180910390f35b6104cb60048036038101906104c691906149d6565b610e14565b005b6104e760048036038101906104e2919061457c565b610e29565b005b6104f1610e3e565b6040516104fe9190615b7b565b60405180910390f35b61050f610e55565b60405161051c919061599f565b60405180910390f35b61053f600480360381019061053a9190614d02565b610ed3565b005b61055b60048036038101906105569190614511565b610ef1565b005b61057760048036038101906105729190614a41565b610f06565b005b610581610f23565b60405161058e9190615bcc565b60405180910390f35b6105b160048036038101906105ac9190614b26565b610f2d565b005b6105cd60048036038101906105c89190614a00565b610f6c565b005b6105e960048036038101906105e491906144d0565b610f86565b005b6105f3610fa0565b6040516106009190615b3d565b60405180910390f35b610623600480360381019061061e91906143d0565b611011565b005b61063f600480360381019061063a91906147bd565b611026565b005b61065b60048036038101906106569190614a93565b6110a4565b005b6106656110d1565b60405161067291906157b6565b60405180910390f35b6106836110fb565b6040516106909190615d14565b60405180910390f35b6106a1611105565b6040516106ae91906158e5565b60405180910390f35b6106d160048036038101906106cc919061487c565b61115d565b005b6106db611177565b6040516106e89190615961565b60405180910390f35b6106f96111cf565b6040516107069190615d2f565b60405180910390f35b6107176111e6565b60405161072a9796959493929190615c3f565b60405180910390f35b61074d60048036038101906107489190614752565b61138d565b005b6107696004803603810190610764919061453b565b6113a7565b005b610785600480360381019061078091906148bd565b6113c1565b005b61078f611453565b6040516107a196959493929190615a1b565b60405180910390f35b6107c460048036038101906107bf9190614c6f565b611725565b005b6107e060048036038101906107db9190614611565b61173f565b005b6107fc60048036038101906107f791906146e7565b611759565b005b610818600480360381019061081391906144a6565b611773565b005b610834600480360381019061082f9190614728565b611788565b005b61083e61179d565b60405161084b9190615cbc565b60405180910390f35b61085c6117b4565b60405161086e96959493929190615ab2565b60405180910390f35b61087f611ab8565b60405161088c9190615cd7565b60405180910390f35b61089d611b5a565b6040516108aa919061582b565b60405180910390f35b6108bb611bd7565b6040516108c89190615b96565b60405180910390f35b6108eb60048036038101906108e691906145a6565b611bee565b005b6108f5611c08565b60405161090291906158c9565b60405180910390f35b610913611c53565b6040516109209190615923565b60405180910390f35b610931611cd1565b60405161093e9190615869565b60405180910390f35b610961600480360381019061095c9190614652565b611d5f565b005b61096b611d74565b6040516109789190615cf9565b60405180910390f35b610989611d99565b604051610996919061584d565b60405180910390f35b6109a7611e1a565b6040516109b49190615c09565b60405180910390f35b6109d760048036038101906109d291906146bd565b611e31565b005b6109e1611e46565b6040516109ee9190615c24565b60405180910390f35b6109ff611e50565b604051610a0c9190615b59565b60405180910390f35b610a1d611ece565b604051610a2a91906157d1565b60405180910390f35b610a4d6004803603810190610a489190614abc565b611f4f565b005b610a696004803603810190610a64919061467c565b611f59565b005b610a73611f73565b604051610a8091906159ff565b60405180910390f35b610aa36004803603810190610a9e9190614cb0565b611fbe565b005b610abf6004803603810190610aba9190614c46565b611ff9565b005b610adb6004803603810190610ad691906145e7565b61201a565b005b610af76004803603810190610af29190614cd9565b61202f565b005b610b01612039565b604051610b0e91906157ed565b60405180910390f35b610b1f6120c7565b604051610b2c9190615907565b60405180910390f35b610b4f6004803603810190610b4a9190614ae5565b612138565b005b610b59612152565b604051610b66919061580f565b60405180910390f35b610b776121c2565b604051610b849190615bb1565b60405180910390f35b610b956121d9565b604051610ba291906158a7565b60405180910390f35b610bc56004803603810190610bc091906143a7565b612276565b005b610bcf6122ba565b604051610bdc919061588b565b60405180910390f35b610bed61234a565b604051610bfa9190615945565b60405180910390f35b610c1d6004803603810190610c189190614b4f565b612395565b005b610c396004803603810190610c349190614b78565b61239f565b005b610c556004803603810190610c509190614465565b61245a565b005b610c716004803603810190610c6c91906143fa565b612474565b005b610c7b61248e565b604051610c889190615983565b60405180910390f35b610cab6004803603810190610ca69190614793565b6124ff565b005b610cb5612514565b604051610cc291906159dd565b60405180910390f35b610ce56004803603810190610ce09190614a6a565b6125b0565b005b610cef6125ce565b604051610cfc91906159c1565b60405180910390f35b6060601b805480602002602001604051908101604052809291908181526020018280548015610d5357602002820191906000526020600020905b815481526020019060010190808311610d3f575b5050505050905090565b80602f90600a610d6e92919061265c565b5050565b606060088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e0a5780601f10610ddf57610100808354040283529160200191610e0a565b820191906000526020600020905b815481529060010190602001808311610ded57829003601f168201915b5050505050905090565b80600990600a610e259291906126f5565b5050565b80604290600a610e3a92919061278f565b5050565b6000600560009054906101000a900460ff16905090565b6060602c805480602002602001604051908101604052809291908181526020018280548015610ec957602002820191906000526020600020906000905b82829054906101000a900460000b60000b81526020019060010190602082600001049283019260010382029150808411610e925790505b5050505050905090565b80600160006101", + "000a81548160ff021916908360ff16021790555050565b80603c90600a610f029291906127cf565b5050565b80600560006101000a81548160ff02191690831515021790555050565b6000600754905090565b80600360016101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff16021790555050565b8060199080519060200190610f82929190612869565b5050565b80604d9080519060200190610f9c929190612910565b5050565b610fa86129d5565b6009600a806020026040519081016040528092919082600a8015611007576020028201916000905b82829054906101000a900460ff1660ff1681526020019060010190602082600001049283019260010382029150808411610fd05790505b5050505050905090565b80603190600a6110229291906129f8565b5050565b85600f90600a611037929190612a75565b5084602290600a611049929190612ab5565b5083603190600a61105b9291906129f8565b508260009080519060200190611072929190612af5565b508160089080519060200190611089929190612b75565b5080602f90600a61109b92919061265c565b50505050505050565b80600660006101000a8154816fffffffffffffffffffffffffffffffff021916908360801c021790555050565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600254905090565b6060604e80548060200260200160405190810160405280929190818152602001828054801561115357602002820191906000526020600020905b81548152602001906001019080831161113f575b5050505050905090565b80601b9080519060200190611173929190612bf5565b5050565b6060602e8054806020026020016040519081016040528092919081815260200182805480156111c557602002820191906000526020600020905b8154815260200190600101908083116111b1575b5050505050905090565b6000600160009054906101000a900460ff16905090565b6000806000806060806000600454600160009054906101000a900460ff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900460ff1660086000600754828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112d35780601f106112a8576101008083540402835291602001916112d3565b820191906000526020600020905b8154815290600101906020018083116112b657829003601f168201915b50505050509250818054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561136f5780601f106113445761010080835404028352916020019161136f565b820191906000526020600020905b81548152906001019060200180831161135257829003601f168201915b50505050509150965096509650965096509650965090919293949596565b80601a90805190602001906113a3929190612c42565b5050565b80604c90805190602001906113bd929190612d16565b5050565b85601b90805190602001906113d7929190612bf5565b5084602e90805190602001906113ee929190612dbd565b5083603b9080519060200190611405929190612e0a565b50826000908051906020019061141c929190612af5565b508160089080519060200190611433929190612b75565b50806030908051906020019061144a929190612e94565b50505050505050565b61145b612f3a565b611463612f5d565b61146b612f80565b606080611476612fa3565b600f6022603160006008602f85600a806020026040519081016040528092919082600a80156114ba576020028201915b8154815260200190600101908083116114a6575b5050505050955084600a806020026040519081016040528092919082600a80156114f9576020028201915b8154815260200190600101908083116114e5575b5050505050945083600a806020026040519081016040528092919082600a801561156e576020028201915b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611524575b50505050509350828054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561160a5780601f106115df5761010080835404028352916020019161160a565b820191906000526020600020905b8154815290600101906020018083116115ed57829003601f168201915b50505050509250818054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116a65780601f1061167b576101008083540402835291602001916116a6565b820191906000526020600020905b81548152906001019060200180831161168957829003601f168201915b5050505050915080600a806020026040519081016040528092919082600a801561170a576020028201916000905b82829054906101000a900460ff161515815260200190600101906020826000010492830192600103820291508084116116d45790505b50505050509050955095509550955095509550909192939495565b806000908051906020019061173b929190612af5565b5050565b80602d9080519060200190611755929190612fc6565b5050565b80602c908051906020019061176f92919061309d565b5050565b80603d90600a611784929190613147565b5050565b80600a90600a6117999291906131ff565b5050565b6000600360009054906101000a900460000b905090565b606080606080606080601b602e603b6000600860308580548060200260200160405190810160405280929190818152602001828054801561181457602002820191906000526020600020905b815481526020019060010190808311611800575b505050505095508480548060200260200160405190810160405280929190818152602001828054801561186657602002820191906000526020600020905b815481526020019060010190808311611852575b50505050509450838054806020026020016040519081016040528092919081815260200182805480156118ee57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116118a4575b50505050509350828054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561198a5780601f1061195f5761010080835404028352916020019161198a565b820191906000526020600020905b81548152906001019060200180831161196d57829003601f168201915b50505050509250818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611a265780601f106119fb57610100808354040283529160200191611a26565b820191906000526020600020905b815481529060010190602001808311611a0957829003601f168201915b5050505050915080805480602002602001604051908101604052809291908181526020018280548015611a9d57602002820191906000526020600020906000905b82829054906101000a900460ff16151581526020019060010190602082600001049283019260010382029150808411611a675790505b50505050509050955095509550955095509550909192939495565b606060008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611b505780601f10611b2557610100808354040283529160200191611b50565b820191906000526020600020905b815481529060010190602001808311611b3357829003601f168201915b5050505050905090565b60606030805480602002602001604051908101604052809291908181526020018280548015611bcd57602002820191906000526020600020906000905b82829054906101000a900460ff16151581526020019060010190602082600001049283019260010382029150808411611b975790505b5050505050905090565b6000600660009054906101000a900460801b905090565b80604e9080519060200190611c049291906132c6565b5050565b611c10613313565b6042600a806020026040519081016040528092919082600a8015611c49576020028201915b815481526020019060010190808311611c35575b5050505050905090565b6060602d805480602002602001604051908101604052809291908181526020018280548015611cc757602002820191906000526020600020906000905b82829054906101000a9004600f0b600f0b81526020019060100190602082600f01049283019260010382029150808411611c905790505b5050505050905090565b6060604d805480602002602001604051908101604052809291908181526020018280548015611d5557602002820191906000526020600020906000905b82829054906101000a900460801b6fffffffffffffffffffffffffffffffff191681526020019060100190602082600f01049283019260010382029150808411611d0e5790505b5050505050905090565b80602290600a611d70929190612ab5565b5050565b60006001809054906101000a90046fffffffffffffffffffffffffffffffff16905090565b611da1613336565b603d600a806020026040519081016040528092919082600a8015611e10576020028201916000905b82829054906101000a900460801b6fffffffffffffffffffffffffffffffff191681526020019060100190602082600f01049283019260010382029150808411611dc95790505b5050505050905090565b6000600360019054906101000a9004600f0b905090565b80601c90600a611e42929190613359565b5050565b6000600454905090565b60606019805480602002602001604051908101604052809291908181526020018280548015611ec457602002820191906000526020600020906000905b82829054906101000a900460ff1660ff1681526020019060010190602082600001049283019260010382029150808411611e8d5790505b5050505050905090565b611ed6612f80565b6031600a", + "806020026040519081016040528092919082600a8015611f45576020028201915b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611efb575b5050505050905090565b8060078190555050565b80602e9080519060200190611f6f929190612dbd565b5050565b611f7b612f3a565b600f600a806020026040519081016040528092919082600a8015611fb4576020028201915b815481526020019060010190808311611fa0575b5050505050905090565b806001806101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555050565b80600360006101000a81548160ff021916908360000b60ff16021790555050565b80601d90600a61202b9291906133f6565b5050565b8060028190555050565b6060603b8054806020026020016040519081016040528092919081815260200182805480156120bd57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311612073575b5050505050905090565b6120cf6134c0565b601d600a806020026040519081016040528092919082600a801561212e576020028201916000905b82829054906101000a9004600f0b600f0b81526020019060100190602082600f010492830192600103820291508084116120f75790505b5050505050905090565b806008908051906020019061214e929190612b75565b5050565b61215a612fa3565b602f600a806020026040519081016040528092919082600a80156121b8576020028201916000905b82829054906101000a900460ff161515815260200190600101906020826000010492830192600103820291508084116121825790505b5050505050905090565b6000600560159054906101000a900460f81b905090565b6060604c80548060200260200160405190810160405280929190818152602001828054801561226c57602002820191906000526020600020906000905b82829054906101000a900460f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600101906020826000010492830192600103820291508084116122165790505b5050505050905090565b80600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6122c26134e3565b603c600a806020026040519081016040528092919082600a8015612340576020028201916000905b82829054906101000a900460f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600101906020826000010492830192600103820291508084116122ea5790505b5050505050905090565b612352612f5d565b6022600a806020026040519081016040528092919082600a801561238b576020028201915b815481526020019060010190808311612377575b5050505050905090565b8060048190555050565b8660048190555085600160006101000a81548160ff021916908360ff16021790555084600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600560006101000a81548160ff0219169083151502179055508260089080519060200190612432929190612b75565b508160009080519060200190612449929190612af5565b508060078190555050505050505050565b8060309080519060200190612470929190612e94565b5050565b80603b908051906020019061248a929190612e0a565b5050565b612496613506565b601c600a806020026040519081016040528092919082600a80156124f5576020028201916000905b82829054906101000a900460000b60000b815260200190600101906020826000010492830192600103820291508084116124be5790505b5050505050905090565b80600f90600a612510929190612a75565b5050565b6060601a8054806020026020016040519081016040528092919081815260200182805480156125a657602002820191906000526020600020906000905b82829054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020019060100190602082600f010492830192600103820291508084116125515790505b5050505050905090565b80600560156101000a81548160ff021916908360f81c021790555050565b6125d6613529565b600a80806020026040519081016040528092919082600a8015612652576020028201916000905b82829054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020019060100190602082600f010492830192600103820291508084116125fd5790505b5050505050905090565b82600a601f016020900481019282156126e45791602002820160005b838211156126b557835183826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302612678565b80156126e25782816101000a81549060ff02191690556001016020816000010492830192600103026126b5565b505b5090506126f1919061354c565b5090565b82600a601f0160209004810192821561277e5791602002820160005b8382111561274f57835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302612711565b801561277c5782816101000a81549060ff021916905560010160208160000104928301926001030261274f565b505b50905061278b919061357c565b5090565b82600a81019282156127be579160200282015b828111156127bd5782518255916020019190600101906127a2565b5b5090506127cb91906135ac565b5090565b82600a601f016020900481019282156128585791602002820160005b8382111561282957835183826101000a81548160ff021916908360f81c021790555092602001926001016020816000010492830192600103026127eb565b80156128565782816101000a81549060ff0219169055600101602081600001049283019260010302612829565b505b50905061286591906135d1565b5090565b82805482825590600052602060002090601f016020900481019282156128ff5791602002820160005b838211156128d057835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302612892565b80156128fd5782816101000a81549060ff02191690556001016020816000010492830192600103026128d0565b505b50905061290c919061357c565b5090565b828054828255906000526020600020906001016002900481019282156129c45791602002820160005b8382111561298657835183826101000a8154816fffffffffffffffffffffffffffffffff021916908360801c02179055509260200192601001602081600f01049283019260010302612939565b80156129c25782816101000a8154906fffffffffffffffffffffffffffffffff0219169055601001602081600f01049283019260010302612986565b505b5090506129d19190613601565b5090565b604051806101400160405280600a90602082028036833780820191505090505090565b82600a8101928215612a64579160200282015b82811115612a635782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190612a0b565b5b509050612a719190613640565b5090565b82600a8101928215612aa4579160200282015b82811115612aa3578251825591602001919060010190612a88565b5b509050612ab19190613683565b5090565b82600a8101928215612ae4579160200282015b82811115612ae3578251825591602001919060010190612ac8565b5b509050612af191906136a8565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612b3657805160ff1916838001178555612b64565b82800160010185558215612b64579182015b82811115612b63578251825591602001919060010190612b48565b5b509050612b719190613683565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612bb657805160ff1916838001178555612be4565b82800160010185558215612be4579182015b82811115612be3578251825591602001919060010190612bc8565b5b509050612bf19190613683565b5090565b828054828255906000526020600020908101928215612c31579160200282015b82811115612c30578251825591602001919060010190612c15565b5b509050612c3e9190613683565b5090565b82805482825590600052602060002090600101600290048101928215612d055791602002820160005b83821115612cc757835183826101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509260200192601001602081600f01049283019260010302612c6b565b8015612d035782816101000a8154906fffffffffffffffffffffffffffffffff0219169055601001602081600f01049283019260010302612cc7565b505b509050612d1291906136cd565b5090565b82805482825590600052602060002090601f01602090048101928215612dac5791602002820160005b83821115612d7d57835183826101000a81548160ff021916908360f81c02179055509260200192600101602081600001049283019260010302612d3f565b8015612daa5782816101000a81549060ff0219169055600101602081600001049283019260010302612d7d565b505b509050612db991906135d1565b5090565b828054828255906000526020600020908101928215612df9579160200282015b82811115612df8578251825591602001919060010190612ddd565b5b509050612e0691906136a8565b5090565b828054828255906000526020600020908101928215612e83579160200282015b82811115612e825782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190612e2a565b5b509050612e909190613640565b5090565b82805482825590600052602060002090601f01602090048101928215612f295791602002820160005b83821115612efa57835183826101000a81548160ff0219169083151502", + "179055509260200192600101602081600001049283019260010302612ebd565b8015612f275782816101000a81549060ff0219169055600101602081600001049283019260010302612efa565b505b509050612f36919061354c565b5090565b604051806101400160405280600a90602082028036833780820191505090505090565b604051806101400160405280600a90602082028036833780820191505090505090565b604051806101400160405280600a90602082028036833780820191505090505090565b604051806101400160405280600a90602082028036833780820191505090505090565b8280548282559060005260206000209060010160029004810192821561308c5791602002820160005b8382111561304e57835183826101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff1602179055509260200192601001602081600f01049283019260010302612fef565b801561308a5782816101000a8154906fffffffffffffffffffffffffffffffff0219169055601001602081600f0104928301926001030261304e565b505b509050613099919061370c565b5090565b82805482825590600052602060002090601f016020900481019282156131365791602002820160005b8382111561310757835183826101000a81548160ff021916908360000b60ff16021790555092602001926001016020816000010492830192600103026130c6565b80156131345782816101000a81549060ff0219169055600101602081600001049283019260010302613107565b505b509050613143919061374b565b5090565b82600a6001016002900481019282156131ee5791602002820160005b838211156131b057835183826101000a8154816fffffffffffffffffffffffffffffffff021916908360801c02179055509260200192601001602081600f01049283019260010302613163565b80156131ec5782816101000a8154906fffffffffffffffffffffffffffffffff0219169055601001602081600f010492830192600103026131b0565b505b5090506131fb9190613601565b5090565b82600a6001016002900481019282156132b55791602002820160005b8382111561327757835183826101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509260200192601001602081600f0104928301926001030261321b565b80156132b35782816101000a8154906fffffffffffffffffffffffffffffffff0219169055601001602081600f01049283019260010302613277565b505b5090506132c291906136cd565b5090565b828054828255906000526020600020908101928215613302579160200282015b828111156133015782518255916020019190600101906132e6565b5b50905061330f91906135ac565b5090565b604051806101400160405280600a90602082028036833780820191505090505090565b604051806101400160405280600a90602082028036833780820191505090505090565b82600a601f016020900481019282156133e55791602002820160005b838211156133b657835183826101000a81548160ff021916908360000b60ff1602179055509260200192600101602081600001049283019260010302613375565b80156133e35782816101000a81549060ff02191690556001016020816000010492830192600103026133b6565b505b5090506133f2919061374b565b5090565b82600a6001016002900481019282156134af5791602002820160005b8382111561347157835183826101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff1602179055509260200192601001602081600f01049283019260010302613412565b80156134ad5782816101000a8154906fffffffffffffffffffffffffffffffff0219169055601001602081600f01049283019260010302613471565b505b5090506134bc919061370c565b5090565b604051806101400160405280600a90602082028036833780820191505090505090565b604051806101400160405280600a90602082028036833780820191505090505090565b604051806101400160405280600a90602082028036833780820191505090505090565b604051806101400160405280600a90602082028036833780820191505090505090565b61357991905b8082111561357557600081816101000a81549060ff021916905550600101613552565b5090565b90565b6135a991905b808211156135a557600081816101000a81549060ff021916905550600101613582565b5090565b90565b6135ce91905b808211156135ca5760008160009055506001016135b2565b5090565b90565b6135fe91905b808211156135fa57600081816101000a81549060ff0219169055506001016135d7565b5090565b90565b61363d91905b8082111561363957600081816101000a8154906fffffffffffffffffffffffffffffffff021916905550600101613607565b5090565b90565b61368091905b8082111561367c57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101613646565b5090565b90565b6136a591905b808211156136a1576000816000905550600101613689565b5090565b90565b6136ca91905b808211156136c65760008160009055506001016136ae565b5090565b90565b61370991905b8082111561370557600081816101000a8154906fffffffffffffffffffffffffffffffff0219169055506001016136d3565b5090565b90565b61374891905b8082111561374457600081816101000a8154906fffffffffffffffffffffffffffffffff021916905550600101613712565b5090565b90565b61377891905b8082111561377457600081816101000a81549060ff021916905550600101613751565b5090565b90565b60008135905061378a816166e1565b92915050565b600082601f8301126137a157600080fd5b600a6137b46137af82615d77565b615d4a565b915081838560208402820111156137ca57600080fd5b60005b838110156137fa57816137e0888261377b565b8452602084019350602083019250506001810190506137cd565b5050505092915050565b600082601f83011261381557600080fd5b813561382861382382615d99565b615d4a565b9150818183526020840193506020810190508385602084028201111561384d57600080fd5b60005b8381101561387d5781613863888261377b565b845260208401935060208301925050600181019050613850565b5050505092915050565b600082601f83011261389857600080fd5b600a6138ab6138a682615dc1565b615d4a565b915081838560208402820111156138c157600080fd5b60005b838110156138f157816138d7888261422d565b8452602084019350602083019250506001810190506138c4565b5050505092915050565b600082601f83011261390c57600080fd5b813561391f61391a82615de3565b615d4a565b9150818183526020840193506020810190508385602084028201111561394457600080fd5b60005b83811015613974578161395a888261422d565b845260208401935060208301925050600181019050613947565b5050505092915050565b600082601f83011261398f57600080fd5b600a6139a261399d82615e0b565b615d4a565b915081838560208402820111156139b857600080fd5b60005b838110156139e857816139ce8882614257565b8452602084019350602083019250506001810190506139bb565b5050505092915050565b600082601f830112613a0357600080fd5b8135613a16613a1182615e2d565b615d4a565b91508181835260208401935060208101905083856020840282011115613a3b57600080fd5b60005b83811015613a6b5781613a518882614257565b845260208401935060208301925050600181019050613a3e565b5050505092915050565b600082601f830112613a8657600080fd5b600a613a99613a9482615e55565b615d4a565b91508183856020840282011115613aaf57600080fd5b60005b83811015613adf5781613ac58882614242565b845260208401935060208301925050600181019050613ab2565b5050505092915050565b600082601f830112613afa57600080fd5b8135613b0d613b0882615e77565b615d4a565b91508181835260208401935060208101905083856020840282011115613b3257600080fd5b60005b83811015613b625781613b488882614242565b845260208401935060208301925050600181019050613b35565b5050505092915050565b600082601f830112613b7d57600080fd5b600a613b90613b8b82615e9f565b615d4a565b91508183856020840282011115613ba657600080fd5b60005b83811015613bd65781613bbc888261426c565b845260208401935060208301925050600181019050613ba9565b5050505092915050565b600082601f830112613bf157600080fd5b8135613c04613bff82615ec1565b615d4a565b91508181835260208401935060208101905083856020840282011115613c2957600080fd5b60005b83811015613c595781613c3f888261426c565b845260208401935060208301925050600181019050613c2c565b5050505092915050565b600082601f830112613c7457600080fd5b600a613c87613c8282615ee9565b615d4a565b91508183856020840282011115613c9d57600080fd5b60005b83811015613ccd5781613cb388826142d5565b845260208401935060208301925050600181019050613ca0565b5050505092915050565b600082601f830112613ce857600080fd5b8135613cfb613cf682615f0b565b615d4a565b91508181835260208401935060208101905083856020840282011115613d2057600080fd5b60005b83811015613d505781613d3688826142d5565b845260208401935060208301925050600181019050613d23565b5050505092915050565b600082601f830112613d6b57600080fd5b600a613d7e613d7982615f33565b615d4a565b91508183856020840282011115613d9457600080fd5b60005b83811015613dc45781613daa88826142ea565b845260208401935060208301925050600181019050613d97565b5050505092915050565b600082601f830112613ddf57600080fd5b8135613df2613ded82615f55565b615d4a565b91508181835260208401935060208101905083856020840282011115613e1757600080fd5b60005b83811015613e475781613e2d88826142ea565b845260208401935060208301925050600181019050613e1a565b5050505092915050565b600082601f830112613e6257600080fd5b600a613e75613e7082615f7d565b615d4a565b91508183856020840282011115613e8b57600080fd5b60005b83811015613ebb5781613ea188826142ff565b845260208401935060208301925050600181019050613e8e565b5050505092915050565b600082601f830112613ed657600080fd5b8135613e", + "e9613ee482615f9f565b615d4a565b91508181835260208401935060208101905083856020840282011115613f0e57600080fd5b60005b83811015613f3e5781613f2488826142ff565b845260208401935060208301925050600181019050613f11565b5050505092915050565b600082601f830112613f5957600080fd5b600a613f6c613f6782615fc7565b615d4a565b91508183856020840282011115613f8257600080fd5b60005b83811015613fb25781613f988882614368565b845260208401935060208301925050600181019050613f85565b5050505092915050565b600082601f830112613fcd57600080fd5b8135613fe0613fdb82615fe9565b615d4a565b9150818183526020840193506020810190508385602084028201111561400557600080fd5b60005b83811015614035578161401b8882614368565b845260208401935060208301925050600181019050614008565b5050505092915050565b600082601f83011261405057600080fd5b600a61406361405e82616011565b615d4a565b9150818385602084028201111561407957600080fd5b60005b838110156140a9578161408f888261437d565b84526020840193506020830192505060018101905061407c565b5050505092915050565b600082601f8301126140c457600080fd5b81356140d76140d282616033565b615d4a565b915081818352602084019350602081019050838560208402820111156140fc57600080fd5b60005b8381101561412c5781614112888261437d565b8452602084019350602083019250506001810190506140ff565b5050505092915050565b600082601f83011261414757600080fd5b600a61415a6141558261605b565b615d4a565b9150818385602084028201111561417057600080fd5b60005b838110156141a057816141868882614392565b845260208401935060208301925050600181019050614173565b5050505092915050565b600082601f8301126141bb57600080fd5b81356141ce6141c98261607d565b615d4a565b915081818352602084019350602081019050838560208402820111156141f357600080fd5b60005b8381101561422357816142098882614392565b8452602084019350602083019250506001810190506141f6565b5050505092915050565b60008135905061423c816166f8565b92915050565b6000813590506142518161670f565b92915050565b60008135905061426681616726565b92915050565b60008135905061427b8161673d565b92915050565b600082601f83011261429257600080fd5b81356142a56142a0826160a5565b615d4a565b915080825260208301602083018583830111156142c157600080fd5b6142cc83828461668e565b50505092915050565b6000813590506142e481616754565b92915050565b6000813590506142f98161676b565b92915050565b60008135905061430e81616782565b92915050565b600082601f83011261432557600080fd5b8135614338614333826160d1565b615d4a565b9150808252602083016020830185838301111561435457600080fd5b61435f83828461668e565b50505092915050565b60008135905061437781616799565b92915050565b60008135905061438c816167b0565b92915050565b6000813590506143a1816167c7565b92915050565b6000602082840312156143b957600080fd5b60006143c78482850161377b565b91505092915050565b600061014082840312156143e357600080fd5b60006143f184828501613790565b91505092915050565b60006020828403121561440c57600080fd5b600082013567ffffffffffffffff81111561442657600080fd5b61443284828501613804565b91505092915050565b6000610140828403121561444e57600080fd5b600061445c84828501613887565b91505092915050565b60006020828403121561447757600080fd5b600082013567ffffffffffffffff81111561449157600080fd5b61449d848285016138fb565b91505092915050565b600061014082840312156144b957600080fd5b60006144c78482850161397e565b91505092915050565b6000602082840312156144e257600080fd5b600082013567ffffffffffffffff8111156144fc57600080fd5b614508848285016139f2565b91505092915050565b6000610140828403121561452457600080fd5b600061453284828501613a75565b91505092915050565b60006020828403121561454d57600080fd5b600082013567ffffffffffffffff81111561456757600080fd5b61457384828501613ae9565b91505092915050565b6000610140828403121561458f57600080fd5b600061459d84828501613b6c565b91505092915050565b6000602082840312156145b857600080fd5b600082013567ffffffffffffffff8111156145d257600080fd5b6145de84828501613be0565b91505092915050565b600061014082840312156145fa57600080fd5b600061460884828501613c63565b91505092915050565b60006020828403121561462357600080fd5b600082013567ffffffffffffffff81111561463d57600080fd5b61464984828501613cd7565b91505092915050565b6000610140828403121561466557600080fd5b600061467384828501613d5a565b91505092915050565b60006020828403121561468e57600080fd5b600082013567ffffffffffffffff8111156146a857600080fd5b6146b484828501613dce565b91505092915050565b600061014082840312156146d057600080fd5b60006146de84828501613e51565b91505092915050565b6000602082840312156146f957600080fd5b600082013567ffffffffffffffff81111561471357600080fd5b61471f84828501613ec5565b91505092915050565b6000610140828403121561473b57600080fd5b600061474984828501613f48565b91505092915050565b60006020828403121561476457600080fd5b600082013567ffffffffffffffff81111561477e57600080fd5b61478a84828501613fbc565b91505092915050565b600061014082840312156147a657600080fd5b60006147b48482850161403f565b91505092915050565b60008060008060008061054087890312156147d757600080fd5b60006147e589828a0161403f565b9650506101406147f789828a01613d5a565b95505061028061480989828a01613790565b9450506103c087013567ffffffffffffffff81111561482757600080fd5b61483389828a01614314565b9350506103e087013567ffffffffffffffff81111561485157600080fd5b61485d89828a01614281565b92505061040061486f89828a01613887565b9150509295509295509295565b60006020828403121561488e57600080fd5b600082013567ffffffffffffffff8111156148a857600080fd5b6148b4848285016140b3565b91505092915050565b60008060008060008060c087890312156148d657600080fd5b600087013567ffffffffffffffff8111156148f057600080fd5b6148fc89828a016140b3565b965050602087013567ffffffffffffffff81111561491957600080fd5b61492589828a01613dce565b955050604087013567ffffffffffffffff81111561494257600080fd5b61494e89828a01613804565b945050606087013567ffffffffffffffff81111561496b57600080fd5b61497789828a01614314565b935050608087013567ffffffffffffffff81111561499457600080fd5b6149a089828a01614281565b92505060a087013567ffffffffffffffff8111156149bd57600080fd5b6149c989828a016138fb565b9150509295509295509295565b600061014082840312156149e957600080fd5b60006149f784828501614136565b91505092915050565b600060208284031215614a1257600080fd5b600082013567ffffffffffffffff811115614a2c57600080fd5b614a38848285016141aa565b91505092915050565b600060208284031215614a5357600080fd5b6000614a618482850161422d565b91505092915050565b600060208284031215614a7c57600080fd5b6000614a8a84828501614242565b91505092915050565b600060208284031215614aa557600080fd5b6000614ab384828501614257565b91505092915050565b600060208284031215614ace57600080fd5b6000614adc8482850161426c565b91505092915050565b600060208284031215614af757600080fd5b600082013567ffffffffffffffff811115614b1157600080fd5b614b1d84828501614281565b91505092915050565b600060208284031215614b3857600080fd5b6000614b46848285016142d5565b91505092915050565b600060208284031215614b6157600080fd5b6000614b6f848285016142ea565b91505092915050565b600080600080600080600060e0888a031215614b9357600080fd5b6000614ba18a828b016142ea565b9750506020614bb28a828b01614392565b9650506040614bc38a828b0161377b565b9550506060614bd48a828b0161422d565b945050608088013567ffffffffffffffff811115614bf157600080fd5b614bfd8a828b01614281565b93505060a088013567ffffffffffffffff811115614c1a57600080fd5b614c268a828b01614314565b92505060c0614c378a828b0161426c565b91505092959891949750929550565b600060208284031215614c5857600080fd5b6000614c66848285016142ff565b91505092915050565b600060208284031215614c8157600080fd5b600082013567ffffffffffffffff811115614c9b57600080fd5b614ca784828501614314565b91505092915050565b600060208284031215614cc257600080fd5b6000614cd084828501614368565b91505092915050565b600060208284031215614ceb57600080fd5b6000614cf98482850161437d565b91505092915050565b600060208284031215614d1457600080fd5b6000614d2284828501614392565b91505092915050565b6000614d378383614e33565b60208301905092915050565b6000614d4f8383615618565b60208301905092915050565b6000614d678383615636565b60208301905092915050565b6000614d7f8383615654565b60208301905092915050565b6000614d978383615672565b60208301905092915050565b6000614daf83836156c9565b60208301905092915050565b6000614dc783836156e7565b60208301905092915050565b6000614ddf8383615705565b60208301905092915050565b6000614df7838361575c565b60208301905092915050565b6000614e0f838361577a565b60208301905092915050565b6000614e278383615798565b60208301905092915050565b614e3c81616597565b82525050565b614e4b81616597565b82525050565b614e5a8161621b565b614e648184616441565b9250614e6f826160fd565b8060005b83811015614ea0578151614e878782614d2b565b9650614e9283616323565b925050600181019050614e73565b505050505050565b6000614eb382616226565b614ebd818561644c565b9350614ec883616107565b8060005b83811015614ef9578151614ee088", + "82614d2b565b9750614eeb83616330565b925050600181019050614ecc565b5085935050505092915050565b614f0f81616231565b614f19818461645d565b9250614f2482616117565b8060005b83811015614f55578151614f3c8782614d43565b9650614f478361633d565b925050600181019050614f28565b505050505050565b6000614f688261623c565b614f728185616468565b9350614f7d83616121565b8060005b83811015614fae578151614f958882614d43565b9750614fa08361634a565b925050600181019050614f81565b5085935050505092915050565b614fc481616247565b614fce8184616479565b9250614fd982616131565b8060005b8381101561500a578151614ff18782614d5b565b9650614ffc83616357565b925050600181019050614fdd565b505050505050565b600061501d82616252565b6150278185616484565b93506150328361613b565b8060005b8381101561506357815161504a8882614d5b565b975061505583616364565b925050600181019050615036565b5085935050505092915050565b6150798161625d565b6150838184616495565b925061508e8261614b565b8060005b838110156150bf5781516150a68782614d73565b96506150b183616371565b925050600181019050615092565b505050505050565b60006150d282616268565b6150dc81856164a0565b93506150e783616155565b8060005b838110156151185781516150ff8882614d73565b975061510a8361637e565b9250506001810190506150eb565b5085935050505092915050565b61512e81616273565b61513881846164b1565b925061514382616165565b8060005b8381101561517457815161515b8782614d8b565b96506151668361638b565b925050600181019050615147565b505050505050565b60006151878261627e565b61519181856164bc565b935061519c8361616f565b8060005b838110156151cd5781516151b48882614d8b565b97506151bf83616398565b9250506001810190506151a0565b5085935050505092915050565b6151e381616289565b6151ed81846164cd565b92506151f88261617f565b8060005b838110156152295781516152108782614da3565b965061521b836163a5565b9250506001810190506151fc565b505050505050565b600061523c82616294565b61524681856164d8565b935061525183616189565b8060005b838110156152825781516152698882614da3565b9750615274836163b2565b925050600181019050615255565b5085935050505092915050565b6152988161629f565b6152a281846164e9565b92506152ad82616199565b8060005b838110156152de5781516152c58782614dbb565b96506152d0836163bf565b9250506001810190506152b1565b505050505050565b60006152f1826162aa565b6152fb81856164f4565b9350615306836161a3565b8060005b8381101561533757815161531e8882614dbb565b9750615329836163cc565b92505060018101905061530a565b5085935050505092915050565b61534d816162b5565b6153578184616505565b9250615362826161b3565b8060005b8381101561539357815161537a8782614dd3565b9650615385836163d9565b925050600181019050615366565b505050505050565b60006153a6826162c0565b6153b08185616510565b93506153bb836161bd565b8060005b838110156153ec5781516153d38882614dd3565b97506153de836163e6565b9250506001810190506153bf565b5085935050505092915050565b615402816162cb565b61540c8184616521565b9250615417826161cd565b8060005b8381101561544857815161542f8782614deb565b965061543a836163f3565b92505060018101905061541b565b505050505050565b600061545b826162d6565b615465818561652c565b9350615470836161d7565b8060005b838110156154a15781516154888882614deb565b975061549383616400565b925050600181019050615474565b5085935050505092915050565b6154b7816162e1565b6154c1818461653d565b92506154cc826161e7565b8060005b838110156154fd5781516154e48782614e03565b96506154ef8361640d565b9250506001810190506154d0565b505050505050565b6000615510826162ec565b61551a8185616548565b9350615525836161f1565b8060005b8381101561555657815161553d8882614e03565b97506155488361641a565b925050600181019050615529565b5085935050505092915050565b61556c816162f7565b6155768184616559565b925061558182616201565b8060005b838110156155b25781516155998782614e1b565b96506155a483616427565b925050600181019050615585565b505050505050565b60006155c582616302565b6155cf8185616564565b93506155da8361620b565b8060005b8381101561560b5781516155f28882614e1b565b97506155fd83616434565b9250506001810190506155de565b5085935050505092915050565b615621816165a9565b82525050565b615630816165a9565b82525050565b61563f816165e1565b82525050565b61564e816165e1565b82525050565b61565d816165b5565b82525050565b61566c816165b5565b82525050565b61567b8161660d565b82525050565b61568a8161660d565b82525050565b600061569b8261630d565b6156a58185616575565b93506156b581856020860161669d565b6156be816166d0565b840191505092915050565b6156d281616617565b82525050565b6156e181616617565b82525050565b6156f081616624565b82525050565b6156ff81616624565b82525050565b61570e8161662e565b82525050565b61571d8161662e565b82525050565b600061572e82616318565b6157388185616586565b935061574881856020860161669d565b615751816166d0565b840191505092915050565b6157658161663b565b82525050565b6157748161663b565b82525050565b61578381616677565b82525050565b61579281616677565b82525050565b6157a181616681565b82525050565b6157b081616681565b82525050565b60006020820190506157cb6000830184614e42565b92915050565b6000610140820190506157e76000830184614e51565b92915050565b600060208201905081810360008301526158078184614ea8565b905092915050565b6000610140820190506158256000830184614f06565b92915050565b600060208201905081810360008301526158458184614f5d565b905092915050565b6000610140820190506158636000830184614fbb565b92915050565b600060208201905081810360008301526158838184615012565b905092915050565b6000610140820190506158a16000830184615070565b92915050565b600060208201905081810360008301526158c181846150c7565b905092915050565b6000610140820190506158df6000830184615125565b92915050565b600060208201905081810360008301526158ff818461517c565b905092915050565b60006101408201905061591d60008301846151da565b92915050565b6000602082019050818103600083015261593d8184615231565b905092915050565b60006101408201905061595b600083018461528f565b92915050565b6000602082019050818103600083015261597b81846152e6565b905092915050565b6000610140820190506159996000830184615344565b92915050565b600060208201905081810360008301526159b9818461539b565b905092915050565b6000610140820190506159d760008301846153f9565b92915050565b600060208201905081810360008301526159f78184615450565b905092915050565b600061014082019050615a1560008301846154ae565b92915050565b600061054082019050615a3160008301896154ae565b615a3f61014083018861528f565b615a4d610280830187614e51565b8181036103c0830152615a608186615723565b90508181036103e0830152615a758185615690565b9050615a85610400830184614f06565b979650505050505050565b60006020820190508181036000830152615aaa8184615505565b905092915050565b600060c0820190508181036000830152615acc8189615505565b90508181036020830152615ae081886152e6565b90508181036040830152615af48187614ea8565b90508181036060830152615b088186615723565b90508181036080830152615b1c8185615690565b905081810360a0830152615b308184614f5d565b9050979650505050505050565b600061014082019050615b536000830184615563565b92915050565b60006020820190508181036000830152615b7381846155ba565b905092915050565b6000602082019050615b906000830184615627565b92915050565b6000602082019050615bab6000830184615645565b92915050565b6000602082019050615bc66000830184615663565b92915050565b6000602082019050615be16000830184615681565b92915050565b60006020820190508181036000830152615c018184615690565b905092915050565b6000602082019050615c1e60008301846156d8565b92915050565b6000602082019050615c3960008301846156f6565b92915050565b600060e082019050615c54600083018a6156f6565b615c6160208301896157a7565b615c6e6040830188614e42565b615c7b6060830187615627565b8181036080830152615c8d8186615690565b905081810360a0830152615ca18185615723565b9050615cb060c0830184615681565b98975050505050505050565b6000602082019050615cd16000830184615714565b92915050565b60006020820190508181036000830152615cf18184615723565b905092915050565b6000602082019050615d0e600083018461576b565b92915050565b6000602082019050615d296000830184615789565b92915050565b6000602082019050615d4460008301846157a7565b92915050565b6000604051905081810181811067ffffffffffffffff82111715615d6d57600080fd5b8060405250919050565b600067ffffffffffffffff821115615d8e57600080fd5b602082029050919050565b600067ffffffffffffffff821115615db057600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615dd857600080fd5b602082029050919050565b600067ffffffffffffffff821115615dfa57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615e2257600080fd5b602082029050919050565b600067ffffffffffffffff821115615e4457600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615e6c57600080fd5b602082029050919050565b600067ffffffffffffffff821115615e8e57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615eb657600080fd5b602082029050919050565b600067ffffffffffffffff821115615ed857600080fd5b6020", + "82029050602081019050919050565b600067ffffffffffffffff821115615f0057600080fd5b602082029050919050565b600067ffffffffffffffff821115615f2257600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615f4a57600080fd5b602082029050919050565b600067ffffffffffffffff821115615f6c57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615f9457600080fd5b602082029050919050565b600067ffffffffffffffff821115615fb657600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615fde57600080fd5b602082029050919050565b600067ffffffffffffffff82111561600057600080fd5b602082029050602081019050919050565b600067ffffffffffffffff82111561602857600080fd5b602082029050919050565b600067ffffffffffffffff82111561604a57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff82111561607257600080fd5b602082029050919050565b600067ffffffffffffffff82111561609457600080fd5b602082029050602081019050919050565b600067ffffffffffffffff8211156160bc57600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff8211156160e857600080fd5b601f19601f8301169050602081019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b60006165a282616657565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffff0000000000000000000000000000000082169050919050565b6000819050919050565b600081600f0b9050919050565b6000819050919050565b60008160000b9050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b838110156166bb5780820151818401526020810190506166a0565b838111156166ca576000848401525b50505050565b6000601f19601f8301169050919050565b6166ea81616597565b81146166f557600080fd5b50565b616701816165a9565b811461670c57600080fd5b50565b616718816165b5565b811461672357600080fd5b50565b61672f816165e1565b811461673a57600080fd5b50565b6167468161660d565b811461675157600080fd5b50565b61675d81616617565b811461676857600080fd5b50565b61677481616624565b811461677f57600080fd5b50565b61678b8161662e565b811461679657600080fd5b50565b6167a28161663b565b81146167ad57600080fd5b50565b6167b981616677565b81146167c457600080fd5b50565b6167d081616681565b81146167db57600080fd5b5056fea2646970667358221220faeb202280dd32d960771addbc7f23b0bf5cd40fc602d95f916bcf83f4d4453264736f6c634300060a0033" + }; + + public static final String BINARY = StringUtils.joinAll("", BINARY_ARRAY); + + public static final String[] SM_BINARY_ARRAY = { + "60806040523480156200001157600080fd5b506040518060400160405280600d81526020017f48656c6c6f2c20576f726c642100000000000000000000000000000000000000815250600090805190602001906200005f92919062000066565b5062000115565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000a957805160ff1916838001178555620000da565b82800160010185558215620000da579182015b82811115620000d9578251825591602001919060010190620000bc565b5b509050620000e99190620000ed565b5090565b6200011291905b808211156200010e576000816000905550600101620000f4565b5090565b90565b61681380620001256000396000f3fe608060405234801561001057600080fd5b50600436106104535760003560e01c80637e7b4d1c11610241578063ba55b20f1161013b578063ea7c251f116100c3578063f429665f11610087578063f429665f14610c72578063f6997ea014610c8e578063f719933a14610caa578063f7b3ec6114610cc8578063ff95639414610ce657610453565b8063ea7c251f14610bde578063ebf146ce14610bfc578063efcbd24814610c1a578063f0e89e5f14610c36578063f3ac2e8a14610c5457610453565b8063ceb712c61161010a578063ceb712c614610b50578063d1d9b73b14610b6c578063d352904d14610b88578063d474564c14610ba6578063dd860cc014610bc257610453565b8063ba55b20f14610ade578063baf2a7a014610afa578063c5b4f92514610b16578063c879c0b814610b3257610453565b806398d58abf116101c9578063a5e1f1d91161018d578063a5e1f1d914610a4c578063aad6c33514610a6a578063ac44749714610a86578063b35ccacc14610aa4578063b6ce001f14610ac257610453565b806398d58abf146109be57806399826c15146109da5780639dcf97eb146109f65780639e2dbcf714610a12578063a327f32514610a2e57610453565b806393870cc71161021057806393870cc71461093057806394d219111461094c5780639536efe114610968578063968a91471461098457806396edde0b146109a057610453565b80637e7b4d1c146108b7578063800cbdca146108da578063840f1024146108f85780638e25983b1461091457610453565b80634685437911610352578063617b2eb3116102da57806373afa6e11161029e57806373afa6e11461082957806375d01dcd14610845578063770044b314610861578063771979061461087d5780637de1a7b01461089957610453565b8063617b2eb31461079157806361dd7d1d146107ad5780636e0e3d9d146107cb578063703b711e146107e75780637294eece1461080b57610453565b8063513f671811610321578063513f6718146106f857806351f1f59714610716578063528ab60514610732578063596dcd57146107505780635d1d09591461077357610453565b80634685437914610684578063494fd782146106a05780634f5cf199146106bc57806350828532146106da57610453565b806323fa2b82116103e057806337df8ca5116103a457806337df8ca5146105f257806339477bfe146106105780634169b1811461062c578063441927041461064a57806346567e821461066857610453565b806323fa2b821461055e5780632913c36b1461057c578063299f7f9d1461059a5780633590b49f146105b857806337724f8c146105d457610453565b806311567c421161042757806311567c42146104ca57806314ffde1c146104e8578063151d37311461050657806319c8656f1461052457806320437abf1461054257610453565b8062cb0bc01461045857806308b164a8146104745780630a5f37ce146104925780630db84857146104ae575b600080fd5b610472600480360381019061046d91906144cf565b610d04565b005b61047c610d1e565b6040516104899190615c08565b60405180910390f35b6104ac60048036038101906104a7919061457b565b610d35565b005b6104c860048036038101906104c391906147bc565b610d4a565b005b6104d2610dc8565b6040516104df91906157b5565b60405180910390f35b6104f0610df2565b6040516104fd91906158e4565b60405180910390f35b61050e610e4a565b60405161051b919061580e565b60405180910390f35b61052c610eba565b6040516105399190615bcb565b60405180910390f35b61055c60048036038101906105579190614610565b610ec4565b005b610566610ede565b6040516105739190615cbb565b60405180910390f35b610584610ef5565b60405161059191906159c0565b60405180910390f35b6105a2610f83565b6040516105af9190615cd6565b60405180910390f35b6105d260048036038101906105cd9190614c6e565b611025565b005b6105dc61103f565b6040516105e991906158c8565b60405180910390f35b6105fa61108a565b6040516106079190615b95565b60405180910390f35b61062a60048036038101906106259190614c45565b6110a1565b005b6106346110c2565b6040516106419190615a8f565b60405180910390f35b61065261111a565b60405161065f9190615922565b60405180910390f35b610682600480360381019061067d919061487b565b611198565b005b61069e60048036038101906106999190614cd8565b6111b2565b005b6106ba60048036038101906106b59190614b4e565b6111bc565b005b6106c46111c6565b6040516106d19190615cf8565b60405180910390f35b6106e26111eb565b6040516106ef9190615960565b60405180910390f35b610700611243565b60405161070d91906158a6565b60405180910390f35b610730600480360381019061072b9190614a40565b6112e0565b005b61073a6112fd565b604051610747919061584c565b60405180910390f35b61075861137e565b60405161076a96959493929190615a1a565b60405180910390f35b61077b611650565b6040516107889190615d13565b60405180910390f35b6107ab60048036038101906107a69190614464565b61165a565b005b6107b5611674565b6040516107c291906159fe565b60405180910390f35b6107e560048036038101906107e0919061453a565b6116bf565b005b6107ef6116d9565b6040516108029796959493929190615c3e565b60405180910390f35b610813611880565b6040516108209190615b58565b60405180910390f35b610843600480360381019061083e9190614751565b6118fe565b005b61085f600480360381019061085a9190614a69565b611918565b005b61087b60048036038101906108769190614727565b611936565b005b610897600480360381019061089291906146e6565b61194b565b005b6108a1611965565b6040516108ae9190615d2e565b60405180910390f35b6108bf61197c565b6040516108d196959493929190615ab1565b60405180910390f35b6108e2611c80565b6040516108ef919061588a565b60405180910390f35b610912600480360381019061090d9190614510565b611d10565b005b61092e600480360381019061092991906145e6565b611d25565b005b61094a60048036038101906109459190614792565b611d3a565b005b610966600480360381019061096191906143a6565b611d4f565b005b610982600480360381019061097d91906149d5565b611d93565b005b61099e60048036038101906109999190614a92565b611da8565b005b6109a8611dd5565b6040516109b59190615944565b60405180910390f35b6109d860048036038101906109d391906143cf565b611e20565b005b6109f460048036038101906109ef91906148bc565b611e35565b005b610a106004803603810190610a0b91906149ff565b611ec7565b005b610a2c6004803603810190610a2791906144a5565b611ee1565b005b610a36611ef6565b604051610a439190615b3c565b60405180910390f35b610a54611f67565b604051610a619190615b7a565b60405180910390f35b610a846004803603810190610a7f9190614d01565b611f7e565b005b610a8e611f9c565b604051610a9b9190615c23565b60405180910390f35b610aac611fa6565b604051610ab99190615982565b60405180910390f35b610adc6004803603810190610ad79190614b25565b612017565b005b610af86004803603810190610af39190614b77565b612056565b005b610b146004803603810190610b0f9190614abb565b612111565b005b610b306004803603810190610b2b9190614ae4565b61211b565b005b610b3a612135565b604051610b4791906157d0565b60405180910390f35b610b6a6004803603810190610b6591906145a5565b6121b6565b005b610b866004803603810190610b81919061443a565b6121d0565b005b610b906121e5565b604051610b9d91906159dc565b60405180910390f35b610bc06004803603810190610bbb91906146bc565b612281565b005b610bdc6004803603810190610bd79190614caf565b612296565b005b610be66122d1565b604051610bf39190615868565b60405180910390f35b610c0461235f565b604051610c11919061582a565b60405180910390f35b610c346004803603810190610c2f9190614651565b6123dc565b005b610c3e6123f1565b604051610c4b919061599e565b60405180910390f35b610c5c61246f565b604051610c699190615906565b60405180910390f35b610c8c6004803603810190610c8791906143f9565b6124e0565b005b610ca86004803603810190610ca3919061467b565b6124fa565b005b610cb2612514565b604051610cbf9190615bb0565b60405180910390f35b610cd061252b565b604051610cdd91906157ec565b60405180910390f35b610cee6125b9565b604051610cfb9190615be6565b60405180910390f35b80604d9080519060200190610d1a92919061265b565b5050565b6000600360019054906101000a9004600f0b905090565b80604290600a610d46929190612720565b5050565b85600f90600a610d5b929190612760565b5084602290600a610d6d9291906127a0565b5083603190600a610d7f9291906127e0565b508260009080519060200190610d9692919061285d565b508160089080519060200190610dad9291906128dd565b5080602f90600a610dbf92919061295d565b50505050505050565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060604e805480602002602001604051908101604052809291908181526020018280548015610e4057602002820191906000526020600020905b815481526020019060010190808311610e2c575b5050505050905090565b610e526129f6565b602f600a806020026040519081016040528092919082600a8015610eb0576020028201916000905b82829054906101000a900460ff16151581526020019060010190602082600001049283019260010382029150808411610e7a5790505b5050505050905090565b6000600754905090565b80602d9080519060200190610eda929190612a19565b", + "5050565b6000600360009054906101000a900460000b905090565b610efd612af0565b600a80806020026040519081016040528092919082600a8015610f79576020028201916000905b82829054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020019060100190602082600f01049283019260010382029150808411610f245790505b5050505050905090565b606060008054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561101b5780601f10610ff05761010080835404028352916020019161101b565b820191906000526020600020905b815481529060010190602001808311610ffe57829003601f168201915b5050505050905090565b806000908051906020019061103b92919061285d565b5050565b611047612b13565b6042600a806020026040519081016040528092919082600a8015611080576020028201915b81548152602001906001019080831161106c575b5050505050905090565b6000600660009054906101000a900460801b905090565b80600360006101000a81548160ff021916908360000b60ff16021790555050565b6060601b80548060200260200160405190810160405280929190818152602001828054801561111057602002820191906000526020600020905b8154815260200190600101908083116110fc575b5050505050905090565b6060602d80548060200260200160405190810160405280929190818152602001828054801561118e57602002820191906000526020600020906000905b82829054906101000a9004600f0b600f0b81526020019060100190602082600f010492830192600103820291508084116111575790505b5050505050905090565b80601b90805190602001906111ae929190612b36565b5050565b8060028190555050565b8060048190555050565b60006001809054906101000a90046fffffffffffffffffffffffffffffffff16905090565b6060602e80548060200260200160405190810160405280929190818152602001828054801561123957602002820191906000526020600020905b815481526020019060010190808311611225575b5050505050905090565b6060604c8054806020026020016040519081016040528092919081815260200182805480156112d657602002820191906000526020600020906000905b82829054906101000a900460f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190600101906020826000010492830192600103820291508084116112805790505b5050505050905090565b80600560006101000a81548160ff02191690831515021790555050565b611305612b83565b603d600a806020026040519081016040528092919082600a8015611374576020028201916000905b82829054906101000a900460801b6fffffffffffffffffffffffffffffffff191681526020019060100190602082600f0104928301926001038202915080841161132d5790505b5050505050905090565b611386612ba6565b61138e612bc9565b611396612bec565b6060806113a16129f6565b600f6022603160006008602f85600a806020026040519081016040528092919082600a80156113e5576020028201915b8154815260200190600101908083116113d1575b5050505050955084600a806020026040519081016040528092919082600a8015611424576020028201915b815481526020019060010190808311611410575b5050505050945083600a806020026040519081016040528092919082600a8015611499576020028201915b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161144f575b50505050509350828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115355780601f1061150a57610100808354040283529160200191611535565b820191906000526020600020905b81548152906001019060200180831161151857829003601f168201915b50505050509250818054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115d15780601f106115a6576101008083540402835291602001916115d1565b820191906000526020600020905b8154815290600101906020018083116115b457829003601f168201915b5050505050915080600a806020026040519081016040528092919082600a8015611635576020028201916000905b82829054906101000a900460ff161515815260200190600101906020826000010492830192600103820291508084116115ff5790505b50505050509050955095509550955095509550909192939495565b6000600254905090565b8060309080519060200190611670929190612c0f565b5050565b61167c612ba6565b600f600a806020026040519081016040528092919082600a80156116b5576020028201915b8154815260200190600101908083116116a1575b5050505050905090565b80604c90805190602001906116d5929190612cb5565b5050565b6000806000806060806000600454600160009054906101000a900460ff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900460ff1660086000600754828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117c65780601f1061179b576101008083540402835291602001916117c6565b820191906000526020600020905b8154815290600101906020018083116117a957829003601f168201915b50505050509250818054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118625780601f1061183757610100808354040283529160200191611862565b820191906000526020600020905b81548152906001019060200180831161184557829003601f168201915b50505050509150965096509650965096509650965090919293949596565b606060198054806020026020016040519081016040528092919081815260200182805480156118f457602002820191906000526020600020906000905b82829054906101000a900460ff1660ff16815260200190600101906020826000010492830192600103820291508084116118bd5790505b5050505050905090565b80601a9080519060200190611914929190612d5c565b5050565b80600560156101000a81548160ff021916908360f81c021790555050565b80600a90600a611947929190612e30565b5050565b80602c9080519060200190611961929190612ef7565b5050565b6000600160009054906101000a900460ff16905090565b606080606080606080601b602e603b600060086030858054806020026020016040519081016040528092919081815260200182805480156119dc57602002820191906000526020600020905b8154815260200190600101908083116119c8575b5050505050955084805480602002602001604051908101604052809291908181526020018280548015611a2e57602002820191906000526020600020905b815481526020019060010190808311611a1a575b5050505050945083805480602002602001604051908101604052809291908181526020018280548015611ab657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611a6c575b50505050509350828054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611b525780601f10611b2757610100808354040283529160200191611b52565b820191906000526020600020905b815481529060010190602001808311611b3557829003601f168201915b50505050509250818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611bee5780601f10611bc357610100808354040283529160200191611bee565b820191906000526020600020905b815481529060010190602001808311611bd157829003601f168201915b5050505050915080805480602002602001604051908101604052809291908181526020018280548015611c6557602002820191906000526020600020906000905b82829054906101000a900460ff16151581526020019060010190602082600001049283019260010382029150808411611c2f5790505b50505050509050955095509550955095509550909192939495565b611c88612fa1565b603c600a806020026040519081016040528092919082600a8015611d06576020028201916000905b82829054906101000a900460f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019060010190602082600001049283019260010382029150808411611cb05790505b5050505050905090565b80603c90600a611d21929190612fc4565b5050565b80601d90600a611d3692919061305e565b5050565b80600f90600a611d4b929190612760565b5050565b80600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b80600990600a611da4929190613128565b5050565b80600660006101000a8154816fffffffffffffffffffffffffffffffff021916908360801c021790555050565b611ddd612bc9565b6022600a806020026040519081016040528092919082600a8015611e16576020028201915b815481526020019060010190808311611e02575b5050505050905090565b80603190600a611e319291906127e0565b5050565b85601b9080519060200190611e4b929190612b36565b5084602e9080519060200190611e629291906131c2565b5083603b9080519060200190611e7992919061320f565b508260009080519060200190611e9092919061285d565b508160089080519060200190611ea79291906128dd565b508060309080519060200190611ebe929190612c0f565b50505050505050565b8060199080519060200190611edd9291906132", + "99565b5050565b80603d90600a611ef2929190613340565b5050565b611efe6133f8565b6009600a806020026040519081016040528092919082600a8015611f5d576020028201916000905b82829054906101000a900460ff1660ff1681526020019060010190602082600001049283019260010382029150808411611f265790505b5050505050905090565b6000600560009054906101000a900460ff16905090565b80600160006101000a81548160ff021916908360ff16021790555050565b6000600454905090565b611fae61341b565b601c600a806020026040519081016040528092919082600a801561200d576020028201916000905b82829054906101000a900460000b60000b81526020019060010190602082600001049283019260010382029150808411611fd65790505b5050505050905090565b80600360016101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff16021790555050565b8660048190555085600160006101000a81548160ff021916908360ff16021790555084600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600560006101000a81548160ff02191690831515021790555082600890805190602001906120e99291906128dd565b50816000908051906020019061210092919061285d565b508060078190555050505050505050565b8060078190555050565b80600890805190602001906121319291906128dd565b5050565b61213d612bec565b6031600a806020026040519081016040528092919082600a80156121ac576020028201915b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311612162575b5050505050905090565b80604e90805190602001906121cc92919061343e565b5050565b80602f90600a6121e192919061295d565b5050565b6060601a80548060200260200160405190810160405280929190818152602001828054801561227757602002820191906000526020600020906000905b82829054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020019060100190602082600f010492830192600103820291508084116122225790505b5050505050905090565b80601c90600a61229292919061348b565b5050565b806001806101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555050565b6060604d80548060200260200160405190810160405280929190818152602001828054801561235557602002820191906000526020600020906000905b82829054906101000a900460801b6fffffffffffffffffffffffffffffffff191681526020019060100190602082600f0104928301926001038202915080841161230e5790505b5050505050905090565b606060308054806020026020016040519081016040528092919081815260200182805480156123d257602002820191906000526020600020906000905b82829054906101000a900460ff1615158152602001906001019060208260000104928301926001038202915080841161239c5790505b5050505050905090565b80602290600a6123ed9291906127a0565b5050565b6060602c80548060200260200160405190810160405280929190818152602001828054801561246557602002820191906000526020600020906000905b82829054906101000a900460000b60000b8152602001906001019060208260000104928301926001038202915080841161242e5790505b5050505050905090565b612477613528565b601d600a806020026040519081016040528092919082600a80156124d6576020028201916000905b82829054906101000a9004600f0b600f0b81526020019060100190602082600f0104928301926001038202915080841161249f5790505b5050505050905090565b80603b90805190602001906124f692919061320f565b5050565b80602e90805190602001906125109291906131c2565b5050565b6000600560159054906101000a900460f81b905090565b6060603b8054806020026020016040519081016040528092919081815260200182805480156125af57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311612565575b5050505050905090565b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156126515780601f1061262657610100808354040283529160200191612651565b820191906000526020600020905b81548152906001019060200180831161263457829003601f168201915b5050505050905090565b8280548282559060005260206000209060010160029004810192821561270f5791602002820160005b838211156126d157835183826101000a8154816fffffffffffffffffffffffffffffffff021916908360801c02179055509260200192601001602081600f01049283019260010302612684565b801561270d5782816101000a8154906fffffffffffffffffffffffffffffffff0219169055601001602081600f010492830192600103026126d1565b505b50905061271c919061354b565b5090565b82600a810192821561274f579160200282015b8281111561274e578251825591602001919060010190612733565b5b50905061275c919061358a565b5090565b82600a810192821561278f579160200282015b8281111561278e578251825591602001919060010190612773565b5b50905061279c91906135af565b5090565b82600a81019282156127cf579160200282015b828111156127ce5782518255916020019190600101906127b3565b5b5090506127dc91906135d4565b5090565b82600a810192821561284c579160200282015b8281111561284b5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906127f3565b5b50905061285991906135f9565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061289e57805160ff19168380011785556128cc565b828001600101855582156128cc579182015b828111156128cb5782518255916020019190600101906128b0565b5b5090506128d991906135af565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061291e57805160ff191683800117855561294c565b8280016001018555821561294c579182015b8281111561294b578251825591602001919060010190612930565b5b50905061295991906135af565b5090565b82600a601f016020900481019282156129e55791602002820160005b838211156129b657835183826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302612979565b80156129e35782816101000a81549060ff02191690556001016020816000010492830192600103026129b6565b505b5090506129f2919061363c565b5090565b604051806101400160405280600a90602082028036833780820191505090505090565b82805482825590600052602060002090600101600290048101928215612adf5791602002820160005b83821115612aa157835183826101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff1602179055509260200192601001602081600f01049283019260010302612a42565b8015612add5782816101000a8154906fffffffffffffffffffffffffffffffff0219169055601001602081600f01049283019260010302612aa1565b505b509050612aec919061366c565b5090565b604051806101400160405280600a90602082028036833780820191505090505090565b604051806101400160405280600a90602082028036833780820191505090505090565b828054828255906000526020600020908101928215612b72579160200282015b82811115612b71578251825591602001919060010190612b56565b5b509050612b7f91906135af565b5090565b604051806101400160405280600a90602082028036833780820191505090505090565b604051806101400160405280600a90602082028036833780820191505090505090565b604051806101400160405280600a90602082028036833780820191505090505090565b604051806101400160405280600a90602082028036833780820191505090505090565b82805482825590600052602060002090601f01602090048101928215612ca45791602002820160005b83821115612c7557835183826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302612c38565b8015612ca25782816101000a81549060ff0219169055600101602081600001049283019260010302612c75565b505b509050612cb1919061363c565b5090565b82805482825590600052602060002090601f01602090048101928215612d4b5791602002820160005b83821115612d1c57835183826101000a81548160ff021916908360f81c02179055509260200192600101602081600001049283019260010302612cde565b8015612d495782816101000a81549060ff0219169055600101602081600001049283019260010302612d1c565b505b509050612d5891906136ab565b5090565b82805482825590600052602060002090600101600290048101928215612e1f5791602002820160005b83821115612de157835183826101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509260200192601001602081600f01049283019260010302612d85565b8015612e1d5782816101000a8154906fffffffffffffffffffffffffffffffff0219169055601001602081600f01049283019260010302612de1565b505b509050612e2c91906136db565b5090565b82600a600101600290048101928215612ee65791602002820160005b83821115612ea857835183826101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509260200192601001602081600f01049283019260010302612e4c565b8015612ee45782816101000a8154906fffffffffffffffffffffffffffffffff0219169055601001602081600f0104928301", + "9260010302612ea8565b505b509050612ef391906136db565b5090565b82805482825590600052602060002090601f01602090048101928215612f905791602002820160005b83821115612f6157835183826101000a81548160ff021916908360000b60ff1602179055509260200192600101602081600001049283019260010302612f20565b8015612f8e5782816101000a81549060ff0219169055600101602081600001049283019260010302612f61565b505b509050612f9d919061371a565b5090565b604051806101400160405280600a90602082028036833780820191505090505090565b82600a601f0160209004810192821561304d5791602002820160005b8382111561301e57835183826101000a81548160ff021916908360f81c02179055509260200192600101602081600001049283019260010302612fe0565b801561304b5782816101000a81549060ff021916905560010160208160000104928301926001030261301e565b505b50905061305a91906136ab565b5090565b82600a6001016002900481019282156131175791602002820160005b838211156130d957835183826101000a8154816fffffffffffffffffffffffffffffffff0219169083600f0b6fffffffffffffffffffffffffffffffff1602179055509260200192601001602081600f0104928301926001030261307a565b80156131155782816101000a8154906fffffffffffffffffffffffffffffffff0219169055601001602081600f010492830192600103026130d9565b505b509050613124919061366c565b5090565b82600a601f016020900481019282156131b15791602002820160005b8382111561318257835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302613144565b80156131af5782816101000a81549060ff0219169055600101602081600001049283019260010302613182565b505b5090506131be919061374a565b5090565b8280548282559060005260206000209081019282156131fe579160200282015b828111156131fd5782518255916020019190600101906131e2565b5b50905061320b91906135d4565b5090565b828054828255906000526020600020908101928215613288579160200282015b828111156132875782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509160200191906001019061322f565b5b50905061329591906135f9565b5090565b82805482825590600052602060002090601f0160209004810192821561332f5791602002820160005b8382111561330057835183826101000a81548160ff021916908360ff16021790555092602001926001016020816000010492830192600103026132c2565b801561332d5782816101000a81549060ff0219169055600101602081600001049283019260010302613300565b505b50905061333c919061374a565b5090565b82600a6001016002900481019282156133e75791602002820160005b838211156133a957835183826101000a8154816fffffffffffffffffffffffffffffffff021916908360801c02179055509260200192601001602081600f0104928301926001030261335c565b80156133e55782816101000a8154906fffffffffffffffffffffffffffffffff0219169055601001602081600f010492830192600103026133a9565b505b5090506133f4919061354b565b5090565b604051806101400160405280600a90602082028036833780820191505090505090565b604051806101400160405280600a90602082028036833780820191505090505090565b82805482825590600052602060002090810192821561347a579160200282015b8281111561347957825182559160200191906001019061345e565b5b509050613487919061358a565b5090565b82600a601f016020900481019282156135175791602002820160005b838211156134e857835183826101000a81548160ff021916908360000b60ff16021790555092602001926001016020816000010492830192600103026134a7565b80156135155782816101000a81549060ff02191690556001016020816000010492830192600103026134e8565b505b509050613524919061371a565b5090565b604051806101400160405280600a90602082028036833780820191505090505090565b61358791905b8082111561358357600081816101000a8154906fffffffffffffffffffffffffffffffff021916905550600101613551565b5090565b90565b6135ac91905b808211156135a8576000816000905550600101613590565b5090565b90565b6135d191905b808211156135cd5760008160009055506001016135b5565b5090565b90565b6135f691905b808211156135f25760008160009055506001016135da565b5090565b90565b61363991905b8082111561363557600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055506001016135ff565b5090565b90565b61366991905b8082111561366557600081816101000a81549060ff021916905550600101613642565b5090565b90565b6136a891905b808211156136a457600081816101000a8154906fffffffffffffffffffffffffffffffff021916905550600101613672565b5090565b90565b6136d891905b808211156136d457600081816101000a81549060ff0219169055506001016136b1565b5090565b90565b61371791905b8082111561371357600081816101000a8154906fffffffffffffffffffffffffffffffff0219169055506001016136e1565b5090565b90565b61374791905b8082111561374357600081816101000a81549060ff021916905550600101613720565b5090565b90565b61377791905b8082111561377357600081816101000a81549060ff021916905550600101613750565b5090565b90565b600081359050613789816166e0565b92915050565b600082601f8301126137a057600080fd5b600a6137b36137ae82615d76565b615d49565b915081838560208402820111156137c957600080fd5b60005b838110156137f957816137df888261377a565b8452602084019350602083019250506001810190506137cc565b5050505092915050565b600082601f83011261381457600080fd5b813561382761382282615d98565b615d49565b9150818183526020840193506020810190508385602084028201111561384c57600080fd5b60005b8381101561387c5781613862888261377a565b84526020840193506020830192505060018101905061384f565b5050505092915050565b600082601f83011261389757600080fd5b600a6138aa6138a582615dc0565b615d49565b915081838560208402820111156138c057600080fd5b60005b838110156138f057816138d6888261422c565b8452602084019350602083019250506001810190506138c3565b5050505092915050565b600082601f83011261390b57600080fd5b813561391e61391982615de2565b615d49565b9150818183526020840193506020810190508385602084028201111561394357600080fd5b60005b838110156139735781613959888261422c565b845260208401935060208301925050600181019050613946565b5050505092915050565b600082601f83011261398e57600080fd5b600a6139a161399c82615e0a565b615d49565b915081838560208402820111156139b757600080fd5b60005b838110156139e757816139cd8882614256565b8452602084019350602083019250506001810190506139ba565b5050505092915050565b600082601f830112613a0257600080fd5b8135613a15613a1082615e2c565b615d49565b91508181835260208401935060208101905083856020840282011115613a3a57600080fd5b60005b83811015613a6a5781613a508882614256565b845260208401935060208301925050600181019050613a3d565b5050505092915050565b600082601f830112613a8557600080fd5b600a613a98613a9382615e54565b615d49565b91508183856020840282011115613aae57600080fd5b60005b83811015613ade5781613ac48882614241565b845260208401935060208301925050600181019050613ab1565b5050505092915050565b600082601f830112613af957600080fd5b8135613b0c613b0782615e76565b615d49565b91508181835260208401935060208101905083856020840282011115613b3157600080fd5b60005b83811015613b615781613b478882614241565b845260208401935060208301925050600181019050613b34565b5050505092915050565b600082601f830112613b7c57600080fd5b600a613b8f613b8a82615e9e565b615d49565b91508183856020840282011115613ba557600080fd5b60005b83811015613bd55781613bbb888261426b565b845260208401935060208301925050600181019050613ba8565b5050505092915050565b600082601f830112613bf057600080fd5b8135613c03613bfe82615ec0565b615d49565b91508181835260208401935060208101905083856020840282011115613c2857600080fd5b60005b83811015613c585781613c3e888261426b565b845260208401935060208301925050600181019050613c2b565b5050505092915050565b600082601f830112613c7357600080fd5b600a613c86613c8182615ee8565b615d49565b91508183856020840282011115613c9c57600080fd5b60005b83811015613ccc5781613cb288826142d4565b845260208401935060208301925050600181019050613c9f565b5050505092915050565b600082601f830112613ce757600080fd5b8135613cfa613cf582615f0a565b615d49565b91508181835260208401935060208101905083856020840282011115613d1f57600080fd5b60005b83811015613d4f5781613d3588826142d4565b845260208401935060208301925050600181019050613d22565b5050505092915050565b600082601f830112613d6a57600080fd5b600a613d7d613d7882615f32565b615d49565b91508183856020840282011115613d9357600080fd5b60005b83811015613dc35781613da988826142e9565b845260208401935060208301925050600181019050613d96565b5050505092915050565b600082601f830112613dde57600080fd5b8135613df1613dec82615f54565b615d49565b91508181835260208401935060208101905083856020840282011115613e1657600080fd5b60005b83811015613e465781613e2c88826142e9565b845260208401935060208301925050600181019050613e19565b5050505092915050565b600082601f830112613e6157600080fd5b600a613e74613e6f82615f7c565b615d49565b91508183856020840282011115613e8a57600080fd5b60005b83811015613eba5781613ea088826142fe565b845260208401935060208301925050600181019050613e8d565b5050505092915050565b600082601f830112613ed557600080fd5b8135613ee8", + "613ee382615f9e565b615d49565b91508181835260208401935060208101905083856020840282011115613f0d57600080fd5b60005b83811015613f3d5781613f2388826142fe565b845260208401935060208301925050600181019050613f10565b5050505092915050565b600082601f830112613f5857600080fd5b600a613f6b613f6682615fc6565b615d49565b91508183856020840282011115613f8157600080fd5b60005b83811015613fb15781613f978882614367565b845260208401935060208301925050600181019050613f84565b5050505092915050565b600082601f830112613fcc57600080fd5b8135613fdf613fda82615fe8565b615d49565b9150818183526020840193506020810190508385602084028201111561400457600080fd5b60005b83811015614034578161401a8882614367565b845260208401935060208301925050600181019050614007565b5050505092915050565b600082601f83011261404f57600080fd5b600a61406261405d82616010565b615d49565b9150818385602084028201111561407857600080fd5b60005b838110156140a8578161408e888261437c565b84526020840193506020830192505060018101905061407b565b5050505092915050565b600082601f8301126140c357600080fd5b81356140d66140d182616032565b615d49565b915081818352602084019350602081019050838560208402820111156140fb57600080fd5b60005b8381101561412b5781614111888261437c565b8452602084019350602083019250506001810190506140fe565b5050505092915050565b600082601f83011261414657600080fd5b600a6141596141548261605a565b615d49565b9150818385602084028201111561416f57600080fd5b60005b8381101561419f57816141858882614391565b845260208401935060208301925050600181019050614172565b5050505092915050565b600082601f8301126141ba57600080fd5b81356141cd6141c88261607c565b615d49565b915081818352602084019350602081019050838560208402820111156141f257600080fd5b60005b8381101561422257816142088882614391565b8452602084019350602083019250506001810190506141f5565b5050505092915050565b60008135905061423b816166f7565b92915050565b6000813590506142508161670e565b92915050565b60008135905061426581616725565b92915050565b60008135905061427a8161673c565b92915050565b600082601f83011261429157600080fd5b81356142a461429f826160a4565b615d49565b915080825260208301602083018583830111156142c057600080fd5b6142cb83828461668d565b50505092915050565b6000813590506142e381616753565b92915050565b6000813590506142f88161676a565b92915050565b60008135905061430d81616781565b92915050565b600082601f83011261432457600080fd5b8135614337614332826160d0565b615d49565b9150808252602083016020830185838301111561435357600080fd5b61435e83828461668d565b50505092915050565b60008135905061437681616798565b92915050565b60008135905061438b816167af565b92915050565b6000813590506143a0816167c6565b92915050565b6000602082840312156143b857600080fd5b60006143c68482850161377a565b91505092915050565b600061014082840312156143e257600080fd5b60006143f08482850161378f565b91505092915050565b60006020828403121561440b57600080fd5b600082013567ffffffffffffffff81111561442557600080fd5b61443184828501613803565b91505092915050565b6000610140828403121561444d57600080fd5b600061445b84828501613886565b91505092915050565b60006020828403121561447657600080fd5b600082013567ffffffffffffffff81111561449057600080fd5b61449c848285016138fa565b91505092915050565b600061014082840312156144b857600080fd5b60006144c68482850161397d565b91505092915050565b6000602082840312156144e157600080fd5b600082013567ffffffffffffffff8111156144fb57600080fd5b614507848285016139f1565b91505092915050565b6000610140828403121561452357600080fd5b600061453184828501613a74565b91505092915050565b60006020828403121561454c57600080fd5b600082013567ffffffffffffffff81111561456657600080fd5b61457284828501613ae8565b91505092915050565b6000610140828403121561458e57600080fd5b600061459c84828501613b6b565b91505092915050565b6000602082840312156145b757600080fd5b600082013567ffffffffffffffff8111156145d157600080fd5b6145dd84828501613bdf565b91505092915050565b600061014082840312156145f957600080fd5b600061460784828501613c62565b91505092915050565b60006020828403121561462257600080fd5b600082013567ffffffffffffffff81111561463c57600080fd5b61464884828501613cd6565b91505092915050565b6000610140828403121561466457600080fd5b600061467284828501613d59565b91505092915050565b60006020828403121561468d57600080fd5b600082013567ffffffffffffffff8111156146a757600080fd5b6146b384828501613dcd565b91505092915050565b600061014082840312156146cf57600080fd5b60006146dd84828501613e50565b91505092915050565b6000602082840312156146f857600080fd5b600082013567ffffffffffffffff81111561471257600080fd5b61471e84828501613ec4565b91505092915050565b6000610140828403121561473a57600080fd5b600061474884828501613f47565b91505092915050565b60006020828403121561476357600080fd5b600082013567ffffffffffffffff81111561477d57600080fd5b61478984828501613fbb565b91505092915050565b600061014082840312156147a557600080fd5b60006147b38482850161403e565b91505092915050565b60008060008060008061054087890312156147d657600080fd5b60006147e489828a0161403e565b9650506101406147f689828a01613d59565b95505061028061480889828a0161378f565b9450506103c087013567ffffffffffffffff81111561482657600080fd5b61483289828a01614313565b9350506103e087013567ffffffffffffffff81111561485057600080fd5b61485c89828a01614280565b92505061040061486e89828a01613886565b9150509295509295509295565b60006020828403121561488d57600080fd5b600082013567ffffffffffffffff8111156148a757600080fd5b6148b3848285016140b2565b91505092915050565b60008060008060008060c087890312156148d557600080fd5b600087013567ffffffffffffffff8111156148ef57600080fd5b6148fb89828a016140b2565b965050602087013567ffffffffffffffff81111561491857600080fd5b61492489828a01613dcd565b955050604087013567ffffffffffffffff81111561494157600080fd5b61494d89828a01613803565b945050606087013567ffffffffffffffff81111561496a57600080fd5b61497689828a01614313565b935050608087013567ffffffffffffffff81111561499357600080fd5b61499f89828a01614280565b92505060a087013567ffffffffffffffff8111156149bc57600080fd5b6149c889828a016138fa565b9150509295509295509295565b600061014082840312156149e857600080fd5b60006149f684828501614135565b91505092915050565b600060208284031215614a1157600080fd5b600082013567ffffffffffffffff811115614a2b57600080fd5b614a37848285016141a9565b91505092915050565b600060208284031215614a5257600080fd5b6000614a608482850161422c565b91505092915050565b600060208284031215614a7b57600080fd5b6000614a8984828501614241565b91505092915050565b600060208284031215614aa457600080fd5b6000614ab284828501614256565b91505092915050565b600060208284031215614acd57600080fd5b6000614adb8482850161426b565b91505092915050565b600060208284031215614af657600080fd5b600082013567ffffffffffffffff811115614b1057600080fd5b614b1c84828501614280565b91505092915050565b600060208284031215614b3757600080fd5b6000614b45848285016142d4565b91505092915050565b600060208284031215614b6057600080fd5b6000614b6e848285016142e9565b91505092915050565b600080600080600080600060e0888a031215614b9257600080fd5b6000614ba08a828b016142e9565b9750506020614bb18a828b01614391565b9650506040614bc28a828b0161377a565b9550506060614bd38a828b0161422c565b945050608088013567ffffffffffffffff811115614bf057600080fd5b614bfc8a828b01614280565b93505060a088013567ffffffffffffffff811115614c1957600080fd5b614c258a828b01614313565b92505060c0614c368a828b0161426b565b91505092959891949750929550565b600060208284031215614c5757600080fd5b6000614c65848285016142fe565b91505092915050565b600060208284031215614c8057600080fd5b600082013567ffffffffffffffff811115614c9a57600080fd5b614ca684828501614313565b91505092915050565b600060208284031215614cc157600080fd5b6000614ccf84828501614367565b91505092915050565b600060208284031215614cea57600080fd5b6000614cf88482850161437c565b91505092915050565b600060208284031215614d1357600080fd5b6000614d2184828501614391565b91505092915050565b6000614d368383614e32565b60208301905092915050565b6000614d4e8383615617565b60208301905092915050565b6000614d668383615635565b60208301905092915050565b6000614d7e8383615653565b60208301905092915050565b6000614d968383615671565b60208301905092915050565b6000614dae83836156c8565b60208301905092915050565b6000614dc683836156e6565b60208301905092915050565b6000614dde8383615704565b60208301905092915050565b6000614df6838361575b565b60208301905092915050565b6000614e0e8383615779565b60208301905092915050565b6000614e268383615797565b60208301905092915050565b614e3b81616596565b82525050565b614e4a81616596565b82525050565b614e598161621a565b614e638184616440565b9250614e6e826160fc565b8060005b83811015614e9f578151614e868782614d2a565b9650614e9183616322565b925050600181019050614e72565b505050505050565b6000614eb282616225565b614ebc818561644b565b9350614ec783616106565b8060005b83811015614ef8578151614edf8882", + "614d2a565b9750614eea8361632f565b925050600181019050614ecb565b5085935050505092915050565b614f0e81616230565b614f18818461645c565b9250614f2382616116565b8060005b83811015614f54578151614f3b8782614d42565b9650614f468361633c565b925050600181019050614f27565b505050505050565b6000614f678261623b565b614f718185616467565b9350614f7c83616120565b8060005b83811015614fad578151614f948882614d42565b9750614f9f83616349565b925050600181019050614f80565b5085935050505092915050565b614fc381616246565b614fcd8184616478565b9250614fd882616130565b8060005b83811015615009578151614ff08782614d5a565b9650614ffb83616356565b925050600181019050614fdc565b505050505050565b600061501c82616251565b6150268185616483565b93506150318361613a565b8060005b838110156150625781516150498882614d5a565b975061505483616363565b925050600181019050615035565b5085935050505092915050565b6150788161625c565b6150828184616494565b925061508d8261614a565b8060005b838110156150be5781516150a58782614d72565b96506150b083616370565b925050600181019050615091565b505050505050565b60006150d182616267565b6150db818561649f565b93506150e683616154565b8060005b838110156151175781516150fe8882614d72565b97506151098361637d565b9250506001810190506150ea565b5085935050505092915050565b61512d81616272565b61513781846164b0565b925061514282616164565b8060005b8381101561517357815161515a8782614d8a565b96506151658361638a565b925050600181019050615146565b505050505050565b60006151868261627d565b61519081856164bb565b935061519b8361616e565b8060005b838110156151cc5781516151b38882614d8a565b97506151be83616397565b92505060018101905061519f565b5085935050505092915050565b6151e281616288565b6151ec81846164cc565b92506151f78261617e565b8060005b8381101561522857815161520f8782614da2565b965061521a836163a4565b9250506001810190506151fb565b505050505050565b600061523b82616293565b61524581856164d7565b935061525083616188565b8060005b838110156152815781516152688882614da2565b9750615273836163b1565b925050600181019050615254565b5085935050505092915050565b6152978161629e565b6152a181846164e8565b92506152ac82616198565b8060005b838110156152dd5781516152c48782614dba565b96506152cf836163be565b9250506001810190506152b0565b505050505050565b60006152f0826162a9565b6152fa81856164f3565b9350615305836161a2565b8060005b8381101561533657815161531d8882614dba565b9750615328836163cb565b925050600181019050615309565b5085935050505092915050565b61534c816162b4565b6153568184616504565b9250615361826161b2565b8060005b838110156153925781516153798782614dd2565b9650615384836163d8565b925050600181019050615365565b505050505050565b60006153a5826162bf565b6153af818561650f565b93506153ba836161bc565b8060005b838110156153eb5781516153d28882614dd2565b97506153dd836163e5565b9250506001810190506153be565b5085935050505092915050565b615401816162ca565b61540b8184616520565b9250615416826161cc565b8060005b8381101561544757815161542e8782614dea565b9650615439836163f2565b92505060018101905061541a565b505050505050565b600061545a826162d5565b615464818561652b565b935061546f836161d6565b8060005b838110156154a05781516154878882614dea565b9750615492836163ff565b925050600181019050615473565b5085935050505092915050565b6154b6816162e0565b6154c0818461653c565b92506154cb826161e6565b8060005b838110156154fc5781516154e38782614e02565b96506154ee8361640c565b9250506001810190506154cf565b505050505050565b600061550f826162eb565b6155198185616547565b9350615524836161f0565b8060005b8381101561555557815161553c8882614e02565b975061554783616419565b925050600181019050615528565b5085935050505092915050565b61556b816162f6565b6155758184616558565b925061558082616200565b8060005b838110156155b15781516155988782614e1a565b96506155a383616426565b925050600181019050615584565b505050505050565b60006155c482616301565b6155ce8185616563565b93506155d98361620a565b8060005b8381101561560a5781516155f18882614e1a565b97506155fc83616433565b9250506001810190506155dd565b5085935050505092915050565b615620816165a8565b82525050565b61562f816165a8565b82525050565b61563e816165e0565b82525050565b61564d816165e0565b82525050565b61565c816165b4565b82525050565b61566b816165b4565b82525050565b61567a8161660c565b82525050565b6156898161660c565b82525050565b600061569a8261630c565b6156a48185616574565b93506156b481856020860161669c565b6156bd816166cf565b840191505092915050565b6156d181616616565b82525050565b6156e081616616565b82525050565b6156ef81616623565b82525050565b6156fe81616623565b82525050565b61570d8161662d565b82525050565b61571c8161662d565b82525050565b600061572d82616317565b6157378185616585565b935061574781856020860161669c565b615750816166cf565b840191505092915050565b6157648161663a565b82525050565b6157738161663a565b82525050565b61578281616676565b82525050565b61579181616676565b82525050565b6157a081616680565b82525050565b6157af81616680565b82525050565b60006020820190506157ca6000830184614e41565b92915050565b6000610140820190506157e66000830184614e50565b92915050565b600060208201905081810360008301526158068184614ea7565b905092915050565b6000610140820190506158246000830184614f05565b92915050565b600060208201905081810360008301526158448184614f5c565b905092915050565b6000610140820190506158626000830184614fba565b92915050565b600060208201905081810360008301526158828184615011565b905092915050565b6000610140820190506158a0600083018461506f565b92915050565b600060208201905081810360008301526158c081846150c6565b905092915050565b6000610140820190506158de6000830184615124565b92915050565b600060208201905081810360008301526158fe818461517b565b905092915050565b60006101408201905061591c60008301846151d9565b92915050565b6000602082019050818103600083015261593c8184615230565b905092915050565b60006101408201905061595a600083018461528e565b92915050565b6000602082019050818103600083015261597a81846152e5565b905092915050565b6000610140820190506159986000830184615343565b92915050565b600060208201905081810360008301526159b8818461539a565b905092915050565b6000610140820190506159d660008301846153f8565b92915050565b600060208201905081810360008301526159f6818461544f565b905092915050565b600061014082019050615a1460008301846154ad565b92915050565b600061054082019050615a3060008301896154ad565b615a3e61014083018861528e565b615a4c610280830187614e50565b8181036103c0830152615a5f8186615722565b90508181036103e0830152615a74818561568f565b9050615a84610400830184614f05565b979650505050505050565b60006020820190508181036000830152615aa98184615504565b905092915050565b600060c0820190508181036000830152615acb8189615504565b90508181036020830152615adf81886152e5565b90508181036040830152615af38187614ea7565b90508181036060830152615b078186615722565b90508181036080830152615b1b818561568f565b905081810360a0830152615b2f8184614f5c565b9050979650505050505050565b600061014082019050615b526000830184615562565b92915050565b60006020820190508181036000830152615b7281846155b9565b905092915050565b6000602082019050615b8f6000830184615626565b92915050565b6000602082019050615baa6000830184615644565b92915050565b6000602082019050615bc56000830184615662565b92915050565b6000602082019050615be06000830184615680565b92915050565b60006020820190508181036000830152615c00818461568f565b905092915050565b6000602082019050615c1d60008301846156d7565b92915050565b6000602082019050615c3860008301846156f5565b92915050565b600060e082019050615c53600083018a6156f5565b615c6060208301896157a6565b615c6d6040830188614e41565b615c7a6060830187615626565b8181036080830152615c8c818661568f565b905081810360a0830152615ca08185615722565b9050615caf60c0830184615680565b98975050505050505050565b6000602082019050615cd06000830184615713565b92915050565b60006020820190508181036000830152615cf08184615722565b905092915050565b6000602082019050615d0d600083018461576a565b92915050565b6000602082019050615d286000830184615788565b92915050565b6000602082019050615d4360008301846157a6565b92915050565b6000604051905081810181811067ffffffffffffffff82111715615d6c57600080fd5b8060405250919050565b600067ffffffffffffffff821115615d8d57600080fd5b602082029050919050565b600067ffffffffffffffff821115615daf57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615dd757600080fd5b602082029050919050565b600067ffffffffffffffff821115615df957600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615e2157600080fd5b602082029050919050565b600067ffffffffffffffff821115615e4357600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615e6b57600080fd5b602082029050919050565b600067ffffffffffffffff821115615e8d57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615eb557600080fd5b602082029050919050565b600067ffffffffffffffff821115615ed757600080fd5b602082", + "029050602081019050919050565b600067ffffffffffffffff821115615eff57600080fd5b602082029050919050565b600067ffffffffffffffff821115615f2157600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615f4957600080fd5b602082029050919050565b600067ffffffffffffffff821115615f6b57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615f9357600080fd5b602082029050919050565b600067ffffffffffffffff821115615fb557600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115615fdd57600080fd5b602082029050919050565b600067ffffffffffffffff821115615fff57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff82111561602757600080fd5b602082029050919050565b600067ffffffffffffffff82111561604957600080fd5b602082029050602081019050919050565b600067ffffffffffffffff82111561607157600080fd5b602082029050919050565b600067ffffffffffffffff82111561609357600080fd5b602082029050602081019050919050565b600067ffffffffffffffff8211156160bb57600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff8211156160e757600080fd5b601f19601f8301169050602081019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000819050919050565b6000819050602082019050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b6000600a9050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b60006165a182616656565b9050919050565b60008115159050919050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b60007fffffffffffffffffffffffffffffffff0000000000000000000000000000000082169050919050565b6000819050919050565b600081600f0b9050919050565b6000819050919050565b60008160000b9050919050565b60006fffffffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b838110156166ba57808201518184015260208101905061669f565b838111156166c9576000848401525b50505050565b6000601f19601f8301169050919050565b6166e981616596565b81146166f457600080fd5b50565b616700816165a8565b811461670b57600080fd5b50565b616717816165b4565b811461672257600080fd5b50565b61672e816165e0565b811461673957600080fd5b50565b6167458161660c565b811461675057600080fd5b50565b61675c81616616565b811461676757600080fd5b50565b61677381616623565b811461677e57600080fd5b50565b61678a8161662d565b811461679557600080fd5b50565b6167a18161663a565b81146167ac57600080fd5b50565b6167b881616676565b81146167c357600080fd5b50565b6167cf81616680565b81146167da57600080fd5b5056fea2646970667358221220c264dcc32ab9a738840db98f9acdd7c1d75f8299853e866d0a766d808ce14e9064736f6c634300060a0033" + }; + + public static final String SM_BINARY = StringUtils.joinAll("", SM_BINARY_ARRAY); + + public static final String[] ABI_ARRAY = { + "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAddrArr\",\"outputs\":[{\"internalType\":\"address[10]\",\"name\":\"\",\"type\":\"address[10]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAddrArrDyn\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBool\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBoolArr\",\"outputs\":[{\"internalType\":\"bool[10]\",\"name\":\"\",\"type\":\"bool[10]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBoolArrDyn\",\"outputs\":[{\"internalType\":\"bool[]\",\"name\":\"\",\"type\":\"bool[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBytes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBytes1\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"\",\"type\":\"bytes1\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBytes16\",\"outputs\":[{\"internalType\":\"bytes16\",\"name\":\"\",\"type\":\"bytes16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBytes16Arr\",\"outputs\":[{\"internalType\":\"bytes16[]\",\"name\":\"\",\"type\":\"bytes16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBytes16Arr10\",\"outputs\":[{\"internalType\":\"bytes16[10]\",\"name\":\"\",\"type\":\"bytes16[10]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBytes1Arr\",\"outputs\":[{\"internalType\":\"bytes1[]\",\"name\":\"\",\"type\":\"bytes1[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBytes1Arr10\",\"outputs\":[{\"internalType\":\"bytes1[10]\",\"name\":\"\",\"type\":\"bytes1[10]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBytes32\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBytes32Arr\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBytes32Arr10\",\"outputs\":[{\"internalType\":\"bytes32[10]\",\"name\":\"\",\"type\":\"bytes32[10]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getI128\",\"outputs\":[{\"internalType\":\"int128\",\"name\":\"\",\"type\":\"int128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getI128Arr\",\"outputs\":[{\"internalType\":\"int128[10]\",\"name\":\"\",\"type\":\"int128[10]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getI128ArrDyn\",\"outputs\":[{\"internalType\":\"int128[]\",\"name\":\"\",\"type\":\"int128[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getI256\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getI256Arr\",\"outputs\":[{\"internalType\":\"int256[10]\",\"name\":\"\",\"type\":\"int256[10]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getI256ArrDyn\",\"outputs\":[{\"internalType\":\"int256[]\",\"name\":\"\",\"type\":\"int256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getI8\",\"outputs\":[{\"internalType\":\"int8\",\"name\":\"\",\"type\":\"int8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getI8Arr\",\"outputs\":[{\"internalType\":\"int8[10]\",\"name\":\"\",\"type\":\"int8[10]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getI8ArrDyn\",\"outputs\":[{\"internalType\":\"int8[]\",\"name\":\"\",\"type\":\"int8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMix0\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMix1\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"int256[]\",\"name\":\"\",\"type\":\"int256[]\"},{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"bool[]\",\"name\":\"\",\"type\":\"bool[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMix2\",\"outputs\":[{\"internalType\":\"uint256[10]\",\"name\":\"\",\"type\":\"uint256[10]\"},{\"internalType\":\"int256[10]\",\"name\":\"\",\"type\":\"int256[10]\"},{\"internalType\":\"address[10]\",\"name\":\"\",\"type\":\"address[10]\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"bool[10]\",\"name\":\"\",\"type\":\"bool[10]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getU128\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getU128Arr\",\"outputs\":[{\"internalType\":\"uint128[10]\",\"name\":\"\",\"type\":\"uint128[10]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getU128ArrDyn\",\"outputs\":[{\"internalType\":\"uint128[]\",\"name\":\"\",\"type\":\"uint128[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getU256\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getU256Arr\",\"outputs\":[{\"internalType\":\"uint256[10]\",\"name\":\"\",\"type\":\"uint256[10]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getU256ArrDyn\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getU8\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getU8Arr\",\"outputs\":[{\"internalType\":\"uint8[10]\",\"name\":\"\",\"type\":\"uint8[10]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getU8ArrDyn\",\"outputs\":[{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"n\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[10]\",\"name\":\"addr_array10_param\",\"type\":\"address[10]\"}],\"name\":\"setAddrArr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"addr_array\",\"type\":\"address[]\"}],\"name\":\"setAddrArrDyn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr_para\",\"type\":\"address\"}],\"name\":\"setAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"b_para\",\"type\":\"bool\"}],\"name\":\"setBool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool[10]\",\"name\":\"b_array10_param\",\"type\":\"bool[10]\"}],\"name\":\"setBoolArr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool[]\",\"name\":\"b_array10_param\",\"type\":\"bool[]\"}],\"name\":\"setBoolArrDyn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"bs_param\",\"type\":\"bytes\"}],\"name\":\"setBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes1\",\"name\":\"b1_param\",\"type\":\"bytes1\"}],\"name\":\"setBytes1\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"b16_param\",\"type\":\"bytes16\"}],\"name\":\"setBytes16\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16[]\",\"name\":\"b16_array_param\",\"type\":\"bytes16[]\"}],\"name\":\"setBytes16Arr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"interna", + "lType\":\"bytes16[10]\",\"name\":\"b16_array10_param\",\"type\":\"bytes16[10]\"}],\"name\":\"setBytes16Arr10\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes1[]\",\"name\":\"b1_array_param\",\"type\":\"bytes1[]\"}],\"name\":\"setBytes1Arr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes1[10]\",\"name\":\"b1_array10_param\",\"type\":\"bytes1[10]\"}],\"name\":\"setBytes1Arr10\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"b32_param\",\"type\":\"bytes32\"}],\"name\":\"setBytes32\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"b32_array_param\",\"type\":\"bytes32[]\"}],\"name\":\"setBytes32Arr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[10]\",\"name\":\"b32_array10_param\",\"type\":\"bytes32[10]\"}],\"name\":\"setBytes32Arr10\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int128\",\"name\":\"i128_para\",\"type\":\"int128\"}],\"name\":\"setI128\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int128[10]\",\"name\":\"i128a_para\",\"type\":\"int128[10]\"}],\"name\":\"setI128Arr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int128[]\",\"name\":\"i128a_para\",\"type\":\"int128[]\"}],\"name\":\"setI128ArrDyn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"i256_para\",\"type\":\"int256\"}],\"name\":\"setI256\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256[10]\",\"name\":\"i256a_para\",\"type\":\"int256[10]\"}],\"name\":\"setI256Arr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256[]\",\"name\":\"i256a_para\",\"type\":\"int256[]\"}],\"name\":\"setI256ArrDyn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int8\",\"name\":\"i8_para\",\"type\":\"int8\"}],\"name\":\"setI8\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int8[10]\",\"name\":\"i8a_para\",\"type\":\"int8[10]\"}],\"name\":\"setI8Arr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int8[]\",\"name\":\"i8a_para\",\"type\":\"int8[]\"}],\"name\":\"setI8ArrDyn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"i256_para\",\"type\":\"int256\"},{\"internalType\":\"uint8\",\"name\":\"u8_para\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"addr_para\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"b_para\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"bs_para\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"s_para\",\"type\":\"string\"},{\"internalType\":\"bytes32\",\"name\":\"b32_para\",\"type\":\"bytes32\"}],\"name\":\"setMix0\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"ua_para\",\"type\":\"uint256[]\"},{\"internalType\":\"int256[]\",\"name\":\"ia_para\",\"type\":\"int256[]\"},{\"internalType\":\"address[]\",\"name\":\"addr_para\",\"type\":\"address[]\"},{\"internalType\":\"string\",\"name\":\"s_para\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"bs_para\",\"type\":\"bytes\"},{\"internalType\":\"bool[]\",\"name\":\"ba\",\"type\":\"bool[]\"}],\"name\":\"setMix1\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[10]\",\"name\":\"ua_para\",\"type\":\"uint256[10]\"},{\"internalType\":\"int256[10]\",\"name\":\"ia_para\",\"type\":\"int256[10]\"},{\"internalType\":\"address[10]\",\"name\":\"addr_para\",\"type\":\"address[10]\"},{\"internalType\":\"string\",\"name\":\"s_para\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"bs_para\",\"type\":\"bytes\"},{\"internalType\":\"bool[10]\",\"name\":\"ba\",\"type\":\"bool[10]\"}],\"name\":\"setMix2\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128\",\"name\":\"u128_para\",\"type\":\"uint128\"}],\"name\":\"setU128\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128[10]\",\"name\":\"u128a_para\",\"type\":\"uint128[10]\"}],\"name\":\"setU128Arr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint128[]\",\"name\":\"u128a_para\",\"type\":\"uint128[]\"}],\"name\":\"setU128ArrDyn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"u256_para\",\"type\":\"uint256\"}],\"name\":\"setU256\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[10]\",\"name\":\"u256a_para\",\"type\":\"uint256[10]\"}],\"name\":\"setU256Arr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"u256a_para\",\"type\":\"uint256[]\"}],\"name\":\"setU256ArrDyn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"u8_para\",\"type\":\"uint8\"}],\"name\":\"setU8\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[10]\",\"name\":\"u8a_para\",\"type\":\"uint8[10]\"}],\"name\":\"setU8Arr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"u8a_para\",\"type\":\"uint8[]\"}],\"name\":\"setU8ArrDyn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" + }; + + public static final String ABI = StringUtils.joinAll("", ABI_ARRAY); + + public static final String FUNC_GET = "get"; + + public static final String FUNC_GETADDRARR = "getAddrArr"; + + public static final String FUNC_GETADDRARRDYN = "getAddrArrDyn"; + + public static final String FUNC_GETADDRESS = "getAddress"; + + public static final String FUNC_GETBOOL = "getBool"; + + public static final String FUNC_GETBOOLARR = "getBoolArr"; + + public static final String FUNC_GETBOOLARRDYN = "getBoolArrDyn"; + + public static final String FUNC_GETBYTES = "getBytes"; + + public static final String FUNC_GETBYTES1 = "getBytes1"; + + public static final String FUNC_GETBYTES16 = "getBytes16"; + + public static final String FUNC_GETBYTES16ARR = "getBytes16Arr"; + + public static final String FUNC_GETBYTES16ARR10 = "getBytes16Arr10"; + + public static final String FUNC_GETBYTES1ARR = "getBytes1Arr"; + + public static final String FUNC_GETBYTES1ARR10 = "getBytes1Arr10"; + + public static final String FUNC_GETBYTES32 = "getBytes32"; + + public static final String FUNC_GETBYTES32ARR = "getBytes32Arr"; + + public static final String FUNC_GETBYTES32ARR10 = "getBytes32Arr10"; + + public static final String FUNC_GETI128 = "getI128"; + + public static final String FUNC_GETI128ARR = "getI128Arr"; + + public static final String FUNC_GETI128ARRDYN = "getI128ArrDyn"; + + public static final String FUNC_GETI256 = "getI256"; + + public static final String FUNC_GETI256ARR = "getI256Arr"; + + public static final String FUNC_GETI256ARRDYN = "getI256ArrDyn"; + + public static final String FUNC_GETI8 = "getI8"; + + public static final String FUNC_GETI8ARR = "getI8Arr"; + + public static final String FUNC_GETI8ARRDYN = "getI8ArrDyn"; + + public static final String FUNC_GETMIX0 = "getMix0"; + + public static final String FUNC_GETMIX1 = "getMix1"; + + public static final String FUNC_GETMIX2 = "getMix2"; + + public static final String FUNC_GETU128 = "getU128"; + + public static final String FUNC_GETU128ARR = "getU128Arr"; + + public static final String FUNC_GETU128ARRDYN = "getU128ArrDyn"; + + public static final String FUNC_GETU256 = "getU256"; + + public static final String FUNC_GETU256ARR = "getU256Arr"; + + public static final String FUNC_GETU256ARRDYN = "getU256ArrDyn"; + + public static final String FUNC_GETU8 = "getU8"; + + public static final String FUNC_GETU8ARR = "getU8Arr"; + + public static final String FUNC_GETU8ARRDYN = "getU8ArrDyn"; + + public static final String FUNC_SET = "set"; + + public static final String FUNC_SETADDRARR = "setAddrArr"; + + public static final String FUNC_SETADDRARRDYN = "setAddrArrDyn"; + + public static final String FUNC_SETADDRESS = "setAddress"; + + public static final String FUNC_SETBOOL = "setBool"; + + public static final String FUNC_SETBOOLARR = "setBoolArr"; + + public static final String FUNC_SETBOOLARRDYN = "setBoolArrDyn"; + + public static final String FUNC_SETBYTES = "setBytes"; + + public static final String FUNC_SETBYTES1 = "setBytes1"; + + public static final String FUNC_SETBYTES16 = "setBytes16"; + + public static final String FUNC_SETBYTES16ARR = "setBytes16Arr"; + + public static final String FUNC_SETBYTES16ARR10 = "setBytes16Arr10"; + + public static final String FUNC_SETBYTES1ARR = "setBytes1Arr"; + + public static final String FUNC_SETBYTES1ARR10 = "setBytes1Arr10"; + + public static final String FUNC_SETBYTES32 = "setBytes32"; + + public static final String FUNC_SETBYTES32ARR = "setBytes32Arr"; + + public static final String FUNC_SETBYTES32ARR10 = "setBytes32Arr10"; + + public static final String FUNC_SETI128 = "setI128"; + + public static final String FUNC_SETI128ARR = "setI128Arr"; + + public static final String FUNC_SETI128ARRDYN = "setI128ArrDyn"; + + public static final String FUNC_SETI256 = "setI256"; + + public static final String FUNC_SETI256ARR = "setI256Arr"; + + public static final String FUNC_SETI256ARRDYN = "setI256ArrDyn"; + + public static final String FUNC_SETI8 = "setI8"; + + public static final String FUNC_SETI8ARR = "setI8Arr"; + + public static final String FUNC_SETI8ARRDYN = "setI8ArrDyn"; + + public static final String FUNC_SETMIX0 = "setMix0"; + + public static final String FUNC_SETMIX1 = "setMix1"; + + public static final String FUNC_SETMIX2 = "setMix2"; + + public static final String FUNC_SETU128 = "setU128"; + + public static final String FUNC_SETU128ARR = "setU128Arr"; + + public static final String FUNC_SETU128ARRDYN = "setU128ArrDyn"; + + public static final String FUNC_SETU256 = "setU256"; + + public static final String FUNC_SETU256ARR = "setU256Arr"; + + public static final String FUNC_SETU256ARRDYN = "setU256ArrDyn"; + + public static final String FUNC_SETU8 = "setU8"; + + public static final String FUNC_SETU8ARR = "setU8Arr"; + + public static final String FUNC_SETU8ARRDYN = "setU8ArrDyn"; + + protected CodecTest(String contractAddress, Client client, CryptoKeyPair credential) { + super(getBinary(client.getCryptoSuite()), contractAddress, client, credential); + } + + public static String getBinary(CryptoSuite cryptoSuite) { + return (cryptoSuite.getCryptoTypeConfig() == CryptoType.ECDSA_TYPE ? BINARY : SM_BINARY); + } + + public static String getABI() { + return ABI; + } + + public String get() throws ContractException { + final Function function = + new Function( + FUNC_GET, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, String.class); + } + + public List getAddrArr() throws ContractException { + final Function function = + new Function( + FUNC_GETADDRARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public List getAddrArrDyn() throws ContractException { + final Function function = + new Function( + FUNC_GETADDRARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public String getAddress() throws ContractException { + final Function function = + new Function( + FUNC_GETADDRESS, + Arrays.asList(), + Arrays.>asList(new TypeReference

() {})); + return executeCallWithSingleValueReturn(function, String.class); + } + + public Boolean getBool() throws ContractException { + final Function function = + new Function( + FUNC_GETBOOL, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, Boolean.class); + } + + public List getBoolArr() throws ContractException { + final Function function = + new Function( + FUNC_GETBOOLARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public List getBoolArrDyn() throws ContractException { + final Function function = + new Function( + FUNC_GETBOOLARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public byte[] getBytes() throws ContractException { + final Function function = + new Function( + FUNC_GETBYTES, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, byte[].class); + } + + public byte[] getBytes1() throws ContractException { + final Function function = + new Function( + FUNC_GETBYTES1, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, byte[].class); + } + + public byte[] getBytes16() throws ContractException { + final Function function = + new Function( + FUNC_GETBYTES16, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, byte[].class); + } + + public List getBytes16Arr() throws ContractException { + final Function function = + new Function( + FUNC_GETBYTES16ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public List getBytes16Arr10() throws ContractException { + final Function function = + new Function( + FUNC_GETBYTES16ARR10, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public List getBytes1Arr() throws ContractException { + final Function function = + new Function( + FUNC_GETBYTES1ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public List getBytes1Arr10() throws ContractException { + final Function function = + new Function( + FUNC_GETBYTES1ARR10, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public byte[] getBytes32() throws ContractException { + final Function function = + new Function( + FUNC_GETBYTES32, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, byte[].class); + } + + public List getBytes32Arr() throws ContractException { + final Function function = + new Function( + FUNC_GETBYTES32ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public List getBytes32Arr10() throws ContractException { + final Function function = + new Function( + FUNC_GETBYTES32ARR10, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public BigInteger getI128() throws ContractException { + final Function function = + new Function( + FUNC_GETI128, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, BigInteger.class); + } + + public List getI128Arr() throws ContractException { + final Function function = + new Function( + FUNC_GETI128ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public List getI128ArrDyn() throws ContractException { + final Function function = + new Function( + FUNC_GETI128ARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public BigInteger getI256() throws ContractException { + final Function function = + new Function( + FUNC_GETI256, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, BigInteger.class); + } + + public List getI256Arr() throws ContractException { + final Function function = + new Function( + FUNC_GETI256ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public List getI256ArrDyn() throws ContractException { + final Function function = + new Function( + FUNC_GETI256ARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public BigInteger getI8() throws ContractException { + final Function function = + new Function( + FUNC_GETI8, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, BigInteger.class); + } + + public List getI8Arr() throws ContractException { + final Function function = + new Function( + FUNC_GETI8ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public List getI8ArrDyn() throws ContractException { + final Function function = + new Function( + FUNC_GETI8ARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public Tuple7 getMix0() + throws ContractException { + final Function function = + new Function( + FUNC_GETMIX0, + Arrays.asList(), + Arrays.>asList( + new TypeReference() {}, + new TypeReference() {}, + new TypeReference
() {}, + new TypeReference() {}, + new TypeReference() {}, + new TypeReference() {}, + new TypeReference() {})); + List results = executeCallWithMultipleValueReturn(function); + return new Tuple7( + (BigInteger) results.get(0).getValue(), + (BigInteger) results.get(1).getValue(), + (String) results.get(2).getValue(), + (Boolean) results.get(3).getValue(), + (byte[]) results.get(4).getValue(), + (String) results.get(5).getValue(), + (byte[]) results.get(6).getValue()); + } + + public Tuple6, List, List, String, byte[], List> + getMix1() throws ContractException { + final Function function = + new Function( + FUNC_GETMIX1, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {}, + new TypeReference>() {}, + new TypeReference>() {}, + new TypeReference() {}, + new TypeReference() {}, + new TypeReference>() {})); + List results = executeCallWithMultipleValueReturn(function); + return new Tuple6< + List, List, List, String, byte[], List>( + convertToNative((List) results.get(0).getValue()), + convertToNative((List) results.get(1).getValue()), + convertToNative((List
) results.get(2).getValue()), + (String) results.get(3).getValue(), + (byte[]) results.get(4).getValue(), + convertToNative((List) results.get(5).getValue())); + } + + public Tuple6, List, List, String, byte[], List> + getMix2() throws ContractException { + final Function function = + new Function( + FUNC_GETMIX2, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {}, + new TypeReference>() {}, + new TypeReference>() {}, + new TypeReference() {}, + new TypeReference() {}, + new TypeReference>() {})); + List results = executeCallWithMultipleValueReturn(function); + return new Tuple6< + List, List, List, String, byte[], List>( + convertToNative((List) results.get(0).getValue()), + convertToNative((List) results.get(1).getValue()), + convertToNative((List
) results.get(2).getValue()), + (String) results.get(3).getValue(), + (byte[]) results.get(4).getValue(), + convertToNative((List) results.get(5).getValue())); + } + + public BigInteger getU128() throws ContractException { + final Function function = + new Function( + FUNC_GETU128, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, BigInteger.class); + } + + public List getU128Arr() throws ContractException { + final Function function = + new Function( + FUNC_GETU128ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public List getU128ArrDyn() throws ContractException { + final Function function = + new Function( + FUNC_GETU128ARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public BigInteger getU256() throws ContractException { + final Function function = + new Function( + FUNC_GETU256, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, BigInteger.class); + } + + public List getU256Arr() throws ContractException { + final Function function = + new Function( + FUNC_GETU256ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public List getU256ArrDyn() throws ContractException { + final Function function = + new Function( + FUNC_GETU256ARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public BigInteger getU8() throws ContractException { + final Function function = + new Function( + FUNC_GETU8, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, BigInteger.class); + } + + public List getU8Arr() throws ContractException { + final Function function = + new Function( + FUNC_GETU8ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public List getU8ArrDyn() throws ContractException { + final Function function = + new Function( + FUNC_GETU8ARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List result = (List) executeCallWithSingleValueReturn(function, List.class); + return convertToNative(result); + } + + public TransactionReceipt set(String n) { + final Function function = + new Function( + FUNC_SET, + Arrays.asList(new Utf8String(n)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void set(String n, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SET, + Arrays.asList(new Utf8String(n)), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSet(String n) { + final Function function = + new Function( + FUNC_SET, + Arrays.asList(new Utf8String(n)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getSetInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SET, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((String) results.get(0).getValue()); + } + + public TransactionReceipt setAddrArr(List addr_array10_param) { + final Function function = + new Function( + FUNC_SETADDRARR, + Arrays.asList( + new StaticArray10
( + Address.class, + Utils.typeMap(addr_array10_param, Address.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setAddrArr(List addr_array10_param, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETADDRARR, + Arrays.asList( + new StaticArray10
( + Address.class, + Utils.typeMap(addr_array10_param, Address.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetAddrArr(List addr_array10_param) { + final Function function = + new Function( + FUNC_SETADDRARR, + Arrays.asList( + new StaticArray10
( + Address.class, + Utils.typeMap(addr_array10_param, Address.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetAddrArrInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETADDRARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>(convertToNative((List
) results.get(0).getValue())); + } + + public TransactionReceipt setAddrArrDyn(List addr_array) { + final Function function = + new Function( + FUNC_SETADDRARRDYN, + Arrays.asList( + new DynamicArray
( + Address.class, Utils.typeMap(addr_array, Address.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setAddrArrDyn(List addr_array, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETADDRARRDYN, + Arrays.asList( + new DynamicArray
( + Address.class, Utils.typeMap(addr_array, Address.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetAddrArrDyn(List addr_array) { + final Function function = + new Function( + FUNC_SETADDRARRDYN, + Arrays.asList( + new DynamicArray
( + Address.class, Utils.typeMap(addr_array, Address.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetAddrArrDynInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETADDRARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>(convertToNative((List
) results.get(0).getValue())); + } + + public TransactionReceipt setAddress(String addr_para) { + final Function function = + new Function( + FUNC_SETADDRESS, + Arrays.asList(new Address(addr_para)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setAddress(String addr_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETADDRESS, + Arrays.asList(new Address(addr_para)), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetAddress(String addr_para) { + final Function function = + new Function( + FUNC_SETADDRESS, + Arrays.asList(new Address(addr_para)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getSetAddressInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETADDRESS, + Arrays.asList(), + Arrays.>asList(new TypeReference
() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((String) results.get(0).getValue()); + } + + public TransactionReceipt setBool(Boolean b_para) { + final Function function = + new Function( + FUNC_SETBOOL, + Arrays.asList(new Bool(b_para)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setBool(Boolean b_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBOOL, + Arrays.asList(new Bool(b_para)), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBool(Boolean b_para) { + final Function function = + new Function( + FUNC_SETBOOL, + Arrays.asList(new Bool(b_para)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getSetBoolInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBOOL, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((Boolean) results.get(0).getValue()); + } + + public TransactionReceipt setBoolArr(List b_array10_param) { + final Function function = + new Function( + FUNC_SETBOOLARR, + Arrays.asList( + new StaticArray10( + Bool.class, Utils.typeMap(b_array10_param, Bool.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setBoolArr(List b_array10_param, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBOOLARR, + Arrays.asList( + new StaticArray10( + Bool.class, Utils.typeMap(b_array10_param, Bool.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBoolArr(List b_array10_param) { + final Function function = + new Function( + FUNC_SETBOOLARR, + Arrays.asList( + new StaticArray10( + Bool.class, Utils.typeMap(b_array10_param, Bool.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetBoolArrInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBOOLARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>(convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setBoolArrDyn(List b_array10_param) { + final Function function = + new Function( + FUNC_SETBOOLARRDYN, + Arrays.asList( + new DynamicArray( + Bool.class, Utils.typeMap(b_array10_param, Bool.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setBoolArrDyn(List b_array10_param, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBOOLARRDYN, + Arrays.asList( + new DynamicArray( + Bool.class, Utils.typeMap(b_array10_param, Bool.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBoolArrDyn(List b_array10_param) { + final Function function = + new Function( + FUNC_SETBOOLARRDYN, + Arrays.asList( + new DynamicArray( + Bool.class, Utils.typeMap(b_array10_param, Bool.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetBoolArrDynInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBOOLARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>(convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setBytes(byte[] bs_param) { + final Function function = + new Function( + FUNC_SETBYTES, + Arrays.asList(new DynamicBytes(bs_param)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setBytes(byte[] bs_param, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBYTES, + Arrays.asList(new DynamicBytes(bs_param)), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBytes(byte[] bs_param) { + final Function function = + new Function( + FUNC_SETBYTES, + Arrays.asList(new DynamicBytes(bs_param)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getSetBytesInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBYTES, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((byte[]) results.get(0).getValue()); + } + + public TransactionReceipt setBytes1(byte[] b1_param) { + final Function function = + new Function( + FUNC_SETBYTES1, + Arrays.asList(new Bytes1(b1_param)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setBytes1(byte[] b1_param, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBYTES1, + Arrays.asList(new Bytes1(b1_param)), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBytes1(byte[] b1_param) { + final Function function = + new Function( + FUNC_SETBYTES1, + Arrays.asList(new Bytes1(b1_param)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getSetBytes1Input(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBYTES1, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((byte[]) results.get(0).getValue()); + } + + public TransactionReceipt setBytes16(byte[] b16_param) { + final Function function = + new Function( + FUNC_SETBYTES16, + Arrays.asList(new Bytes16(b16_param)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setBytes16(byte[] b16_param, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBYTES16, + Arrays.asList(new Bytes16(b16_param)), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBytes16(byte[] b16_param) { + final Function function = + new Function( + FUNC_SETBYTES16, + Arrays.asList(new Bytes16(b16_param)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getSetBytes16Input(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBYTES16, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((byte[]) results.get(0).getValue()); + } + + public TransactionReceipt setBytes16Arr(List b16_array_param) { + final Function function = + new Function( + FUNC_SETBYTES16ARR, + Arrays.asList( + new DynamicArray( + Bytes16.class, + Utils.typeMap(b16_array_param, Bytes16.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setBytes16Arr(List b16_array_param, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBYTES16ARR, + Arrays.asList( + new DynamicArray( + Bytes16.class, + Utils.typeMap(b16_array_param, Bytes16.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBytes16Arr(List b16_array_param) { + final Function function = + new Function( + FUNC_SETBYTES16ARR, + Arrays.asList( + new DynamicArray( + Bytes16.class, + Utils.typeMap(b16_array_param, Bytes16.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetBytes16ArrInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBYTES16ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>(convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setBytes16Arr10(List b16_array10_param) { + final Function function = + new Function( + FUNC_SETBYTES16ARR10, + Arrays.asList( + new StaticArray10( + Bytes16.class, + Utils.typeMap(b16_array10_param, Bytes16.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setBytes16Arr10(List b16_array10_param, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBYTES16ARR10, + Arrays.asList( + new StaticArray10( + Bytes16.class, + Utils.typeMap(b16_array10_param, Bytes16.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBytes16Arr10(List b16_array10_param) { + final Function function = + new Function( + FUNC_SETBYTES16ARR10, + Arrays.asList( + new StaticArray10( + Bytes16.class, + Utils.typeMap(b16_array10_param, Bytes16.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetBytes16Arr10Input(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBYTES16ARR10, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>(convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setBytes1Arr(List b1_array_param) { + final Function function = + new Function( + FUNC_SETBYTES1ARR, + Arrays.asList( + new DynamicArray( + Bytes1.class, Utils.typeMap(b1_array_param, Bytes1.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setBytes1Arr(List b1_array_param, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBYTES1ARR, + Arrays.asList( + new DynamicArray( + Bytes1.class, Utils.typeMap(b1_array_param, Bytes1.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBytes1Arr(List b1_array_param) { + final Function function = + new Function( + FUNC_SETBYTES1ARR, + Arrays.asList( + new DynamicArray( + Bytes1.class, Utils.typeMap(b1_array_param, Bytes1.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetBytes1ArrInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBYTES1ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>(convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setBytes1Arr10(List b1_array10_param) { + final Function function = + new Function( + FUNC_SETBYTES1ARR10, + Arrays.asList( + new StaticArray10( + Bytes1.class, + Utils.typeMap(b1_array10_param, Bytes1.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setBytes1Arr10(List b1_array10_param, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBYTES1ARR10, + Arrays.asList( + new StaticArray10( + Bytes1.class, + Utils.typeMap(b1_array10_param, Bytes1.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBytes1Arr10(List b1_array10_param) { + final Function function = + new Function( + FUNC_SETBYTES1ARR10, + Arrays.asList( + new StaticArray10( + Bytes1.class, + Utils.typeMap(b1_array10_param, Bytes1.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetBytes1Arr10Input(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBYTES1ARR10, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>(convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setBytes32(byte[] b32_param) { + final Function function = + new Function( + FUNC_SETBYTES32, + Arrays.asList(new Bytes32(b32_param)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setBytes32(byte[] b32_param, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBYTES32, + Arrays.asList(new Bytes32(b32_param)), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBytes32(byte[] b32_param) { + final Function function = + new Function( + FUNC_SETBYTES32, + Arrays.asList(new Bytes32(b32_param)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getSetBytes32Input(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBYTES32, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((byte[]) results.get(0).getValue()); + } + + public TransactionReceipt setBytes32Arr(List b32_array_param) { + final Function function = + new Function( + FUNC_SETBYTES32ARR, + Arrays.asList( + new DynamicArray( + Bytes32.class, + Utils.typeMap(b32_array_param, Bytes32.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setBytes32Arr(List b32_array_param, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBYTES32ARR, + Arrays.asList( + new DynamicArray( + Bytes32.class, + Utils.typeMap(b32_array_param, Bytes32.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBytes32Arr(List b32_array_param) { + final Function function = + new Function( + FUNC_SETBYTES32ARR, + Arrays.asList( + new DynamicArray( + Bytes32.class, + Utils.typeMap(b32_array_param, Bytes32.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetBytes32ArrInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBYTES32ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>(convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setBytes32Arr10(List b32_array10_param) { + final Function function = + new Function( + FUNC_SETBYTES32ARR10, + Arrays.asList( + new StaticArray10( + Bytes32.class, + Utils.typeMap(b32_array10_param, Bytes32.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setBytes32Arr10(List b32_array10_param, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBYTES32ARR10, + Arrays.asList( + new StaticArray10( + Bytes32.class, + Utils.typeMap(b32_array10_param, Bytes32.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBytes32Arr10(List b32_array10_param) { + final Function function = + new Function( + FUNC_SETBYTES32ARR10, + Arrays.asList( + new StaticArray10( + Bytes32.class, + Utils.typeMap(b32_array10_param, Bytes32.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetBytes32Arr10Input(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBYTES32ARR10, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>(convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setI128(BigInteger i128_para) { + final Function function = + new Function( + FUNC_SETI128, + Arrays.asList(new Int128(i128_para)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setI128(BigInteger i128_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETI128, + Arrays.asList(new Int128(i128_para)), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetI128(BigInteger i128_para) { + final Function function = + new Function( + FUNC_SETI128, + Arrays.asList(new Int128(i128_para)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getSetI128Input(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETI128, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((BigInteger) results.get(0).getValue()); + } + + public TransactionReceipt setI128Arr(List i128a_para) { + final Function function = + new Function( + FUNC_SETI128ARR, + Arrays.asList( + new StaticArray10( + Int128.class, Utils.typeMap(i128a_para, Int128.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setI128Arr(List i128a_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETI128ARR, + Arrays.asList( + new StaticArray10( + Int128.class, Utils.typeMap(i128a_para, Int128.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetI128Arr(List i128a_para) { + final Function function = + new Function( + FUNC_SETI128ARR, + Arrays.asList( + new StaticArray10( + Int128.class, Utils.typeMap(i128a_para, Int128.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetI128ArrInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETI128ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>( + convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setI128ArrDyn(List i128a_para) { + final Function function = + new Function( + FUNC_SETI128ARRDYN, + Arrays.asList( + new DynamicArray( + Int128.class, Utils.typeMap(i128a_para, Int128.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setI128ArrDyn(List i128a_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETI128ARRDYN, + Arrays.asList( + new DynamicArray( + Int128.class, Utils.typeMap(i128a_para, Int128.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetI128ArrDyn(List i128a_para) { + final Function function = + new Function( + FUNC_SETI128ARRDYN, + Arrays.asList( + new DynamicArray( + Int128.class, Utils.typeMap(i128a_para, Int128.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetI128ArrDynInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETI128ARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>( + convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setI256(BigInteger i256_para) { + final Function function = + new Function( + FUNC_SETI256, + Arrays.asList(new Int256(i256_para)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setI256(BigInteger i256_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETI256, + Arrays.asList(new Int256(i256_para)), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetI256(BigInteger i256_para) { + final Function function = + new Function( + FUNC_SETI256, + Arrays.asList(new Int256(i256_para)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getSetI256Input(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETI256, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((BigInteger) results.get(0).getValue()); + } + + public TransactionReceipt setI256Arr(List i256a_para) { + final Function function = + new Function( + FUNC_SETI256ARR, + Arrays.asList( + new StaticArray10( + Int256.class, Utils.typeMap(i256a_para, Int256.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setI256Arr(List i256a_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETI256ARR, + Arrays.asList( + new StaticArray10( + Int256.class, Utils.typeMap(i256a_para, Int256.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetI256Arr(List i256a_para) { + final Function function = + new Function( + FUNC_SETI256ARR, + Arrays.asList( + new StaticArray10( + Int256.class, Utils.typeMap(i256a_para, Int256.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetI256ArrInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETI256ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>( + convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setI256ArrDyn(List i256a_para) { + final Function function = + new Function( + FUNC_SETI256ARRDYN, + Arrays.asList( + new DynamicArray( + Int256.class, Utils.typeMap(i256a_para, Int256.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setI256ArrDyn(List i256a_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETI256ARRDYN, + Arrays.asList( + new DynamicArray( + Int256.class, Utils.typeMap(i256a_para, Int256.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetI256ArrDyn(List i256a_para) { + final Function function = + new Function( + FUNC_SETI256ARRDYN, + Arrays.asList( + new DynamicArray( + Int256.class, Utils.typeMap(i256a_para, Int256.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetI256ArrDynInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETI256ARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>( + convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setI8(BigInteger i8_para) { + final Function function = + new Function( + FUNC_SETI8, + Arrays.asList(new Int8(i8_para)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setI8(BigInteger i8_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETI8, + Arrays.asList(new Int8(i8_para)), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetI8(BigInteger i8_para) { + final Function function = + new Function( + FUNC_SETI8, + Arrays.asList(new Int8(i8_para)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getSetI8Input(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETI8, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((BigInteger) results.get(0).getValue()); + } + + public TransactionReceipt setI8Arr(List i8a_para) { + final Function function = + new Function( + FUNC_SETI8ARR, + Arrays.asList( + new StaticArray10( + Int8.class, Utils.typeMap(i8a_para, Int8.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setI8Arr(List i8a_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETI8ARR, + Arrays.asList( + new StaticArray10( + Int8.class, Utils.typeMap(i8a_para, Int8.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetI8Arr(List i8a_para) { + final Function function = + new Function( + FUNC_SETI8ARR, + Arrays.asList( + new StaticArray10( + Int8.class, Utils.typeMap(i8a_para, Int8.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetI8ArrInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETI8ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>( + convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setI8ArrDyn(List i8a_para) { + final Function function = + new Function( + FUNC_SETI8ARRDYN, + Arrays.asList( + new DynamicArray( + Int8.class, Utils.typeMap(i8a_para, Int8.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setI8ArrDyn(List i8a_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETI8ARRDYN, + Arrays.asList( + new DynamicArray( + Int8.class, Utils.typeMap(i8a_para, Int8.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetI8ArrDyn(List i8a_para) { + final Function function = + new Function( + FUNC_SETI8ARRDYN, + Arrays.asList( + new DynamicArray( + Int8.class, Utils.typeMap(i8a_para, Int8.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetI8ArrDynInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETI8ARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>( + convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setMix0( + BigInteger i256_para, + BigInteger u8_para, + String addr_para, + Boolean b_para, + byte[] bs_para, + String s_para, + byte[] b32_para) { + final Function function = + new Function( + FUNC_SETMIX0, + Arrays.asList( + new Int256(i256_para), + new Uint8(u8_para), + new Address(addr_para), + new Bool(b_para), + new DynamicBytes(bs_para), + new Utf8String(s_para), + new Bytes32(b32_para)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setMix0( + BigInteger i256_para, + BigInteger u8_para, + String addr_para, + Boolean b_para, + byte[] bs_para, + String s_para, + byte[] b32_para, + TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETMIX0, + Arrays.asList( + new Int256(i256_para), + new Uint8(u8_para), + new Address(addr_para), + new Bool(b_para), + new DynamicBytes(bs_para), + new Utf8String(s_para), + new Bytes32(b32_para)), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetMix0( + BigInteger i256_para, + BigInteger u8_para, + String addr_para, + Boolean b_para, + byte[] bs_para, + String s_para, + byte[] b32_para) { + final Function function = + new Function( + FUNC_SETMIX0, + Arrays.asList( + new Int256(i256_para), + new Uint8(u8_para), + new Address(addr_para), + new Bool(b_para), + new DynamicBytes(bs_para), + new Utf8String(s_para), + new Bytes32(b32_para)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple7 getSetMix0Input( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETMIX0, + Arrays.asList(), + Arrays.>asList( + new TypeReference() {}, + new TypeReference() {}, + new TypeReference
() {}, + new TypeReference() {}, + new TypeReference() {}, + new TypeReference() {}, + new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple7( + (BigInteger) results.get(0).getValue(), + (BigInteger) results.get(1).getValue(), + (String) results.get(2).getValue(), + (Boolean) results.get(3).getValue(), + (byte[]) results.get(4).getValue(), + (String) results.get(5).getValue(), + (byte[]) results.get(6).getValue()); + } + + public TransactionReceipt setMix1( + List ua_para, + List ia_para, + List addr_para, + String s_para, + byte[] bs_para, + List ba) { + final Function function = + new Function( + FUNC_SETMIX1, + Arrays.asList( + new DynamicArray( + Uint256.class, Utils.typeMap(ua_para, Uint256.class)), + new DynamicArray( + Int256.class, Utils.typeMap(ia_para, Int256.class)), + new DynamicArray
( + Address.class, Utils.typeMap(addr_para, Address.class)), + new Utf8String(s_para), + new DynamicBytes(bs_para), + new DynamicArray(Bool.class, Utils.typeMap(ba, Bool.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setMix1( + List ua_para, + List ia_para, + List addr_para, + String s_para, + byte[] bs_para, + List ba, + TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETMIX1, + Arrays.asList( + new DynamicArray( + Uint256.class, Utils.typeMap(ua_para, Uint256.class)), + new DynamicArray( + Int256.class, Utils.typeMap(ia_para, Int256.class)), + new DynamicArray
( + Address.class, Utils.typeMap(addr_para, Address.class)), + new Utf8String(s_para), + new DynamicBytes(bs_para), + new DynamicArray(Bool.class, Utils.typeMap(ba, Bool.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetMix1( + List ua_para, + List ia_para, + List addr_para, + String s_para, + byte[] bs_para, + List ba) { + final Function function = + new Function( + FUNC_SETMIX1, + Arrays.asList( + new DynamicArray( + Uint256.class, Utils.typeMap(ua_para, Uint256.class)), + new DynamicArray( + Int256.class, Utils.typeMap(ia_para, Int256.class)), + new DynamicArray
( + Address.class, Utils.typeMap(addr_para, Address.class)), + new Utf8String(s_para), + new DynamicBytes(bs_para), + new DynamicArray(Bool.class, Utils.typeMap(ba, Bool.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple6, List, List, String, byte[], List> + getSetMix1Input(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETMIX1, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {}, + new TypeReference>() {}, + new TypeReference>() {}, + new TypeReference() {}, + new TypeReference() {}, + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple6< + List, List, List, String, byte[], List>( + convertToNative((List) results.get(0).getValue()), + convertToNative((List) results.get(1).getValue()), + convertToNative((List
) results.get(2).getValue()), + (String) results.get(3).getValue(), + (byte[]) results.get(4).getValue(), + convertToNative((List) results.get(5).getValue())); + } + + public TransactionReceipt setMix2( + List ua_para, + List ia_para, + List addr_para, + String s_para, + byte[] bs_para, + List ba) { + final Function function = + new Function( + FUNC_SETMIX2, + Arrays.asList( + new StaticArray10( + Uint256.class, Utils.typeMap(ua_para, Uint256.class)), + new StaticArray10( + Int256.class, Utils.typeMap(ia_para, Int256.class)), + new StaticArray10
( + Address.class, Utils.typeMap(addr_para, Address.class)), + new Utf8String(s_para), + new DynamicBytes(bs_para), + new StaticArray10(Bool.class, Utils.typeMap(ba, Bool.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setMix2( + List ua_para, + List ia_para, + List addr_para, + String s_para, + byte[] bs_para, + List ba, + TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETMIX2, + Arrays.asList( + new StaticArray10( + Uint256.class, Utils.typeMap(ua_para, Uint256.class)), + new StaticArray10( + Int256.class, Utils.typeMap(ia_para, Int256.class)), + new StaticArray10
( + Address.class, Utils.typeMap(addr_para, Address.class)), + new Utf8String(s_para), + new DynamicBytes(bs_para), + new StaticArray10(Bool.class, Utils.typeMap(ba, Bool.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetMix2( + List ua_para, + List ia_para, + List addr_para, + String s_para, + byte[] bs_para, + List ba) { + final Function function = + new Function( + FUNC_SETMIX2, + Arrays.asList( + new StaticArray10( + Uint256.class, Utils.typeMap(ua_para, Uint256.class)), + new StaticArray10( + Int256.class, Utils.typeMap(ia_para, Int256.class)), + new StaticArray10
( + Address.class, Utils.typeMap(addr_para, Address.class)), + new Utf8String(s_para), + new DynamicBytes(bs_para), + new StaticArray10(Bool.class, Utils.typeMap(ba, Bool.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple6, List, List, String, byte[], List> + getSetMix2Input(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETMIX2, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {}, + new TypeReference>() {}, + new TypeReference>() {}, + new TypeReference() {}, + new TypeReference() {}, + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple6< + List, List, List, String, byte[], List>( + convertToNative((List) results.get(0).getValue()), + convertToNative((List) results.get(1).getValue()), + convertToNative((List
) results.get(2).getValue()), + (String) results.get(3).getValue(), + (byte[]) results.get(4).getValue(), + convertToNative((List) results.get(5).getValue())); + } + + public TransactionReceipt setU128(BigInteger u128_para) { + final Function function = + new Function( + FUNC_SETU128, + Arrays.asList(new Uint128(u128_para)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setU128(BigInteger u128_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETU128, + Arrays.asList(new Uint128(u128_para)), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetU128(BigInteger u128_para) { + final Function function = + new Function( + FUNC_SETU128, + Arrays.asList(new Uint128(u128_para)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getSetU128Input(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETU128, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((BigInteger) results.get(0).getValue()); + } + + public TransactionReceipt setU128Arr(List u128a_para) { + final Function function = + new Function( + FUNC_SETU128ARR, + Arrays.asList( + new StaticArray10( + Uint128.class, Utils.typeMap(u128a_para, Uint128.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setU128Arr(List u128a_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETU128ARR, + Arrays.asList( + new StaticArray10( + Uint128.class, Utils.typeMap(u128a_para, Uint128.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetU128Arr(List u128a_para) { + final Function function = + new Function( + FUNC_SETU128ARR, + Arrays.asList( + new StaticArray10( + Uint128.class, Utils.typeMap(u128a_para, Uint128.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetU128ArrInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETU128ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>( + convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setU128ArrDyn(List u128a_para) { + final Function function = + new Function( + FUNC_SETU128ARRDYN, + Arrays.asList( + new DynamicArray( + Uint128.class, Utils.typeMap(u128a_para, Uint128.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setU128ArrDyn(List u128a_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETU128ARRDYN, + Arrays.asList( + new DynamicArray( + Uint128.class, Utils.typeMap(u128a_para, Uint128.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetU128ArrDyn(List u128a_para) { + final Function function = + new Function( + FUNC_SETU128ARRDYN, + Arrays.asList( + new DynamicArray( + Uint128.class, Utils.typeMap(u128a_para, Uint128.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetU128ArrDynInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETU128ARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>( + convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setU256(BigInteger u256_para) { + final Function function = + new Function( + FUNC_SETU256, + Arrays.asList(new Uint256(u256_para)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setU256(BigInteger u256_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETU256, + Arrays.asList(new Uint256(u256_para)), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetU256(BigInteger u256_para) { + final Function function = + new Function( + FUNC_SETU256, + Arrays.asList(new Uint256(u256_para)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getSetU256Input(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETU256, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((BigInteger) results.get(0).getValue()); + } + + public TransactionReceipt setU256Arr(List u256a_para) { + final Function function = + new Function( + FUNC_SETU256ARR, + Arrays.asList( + new StaticArray10( + Uint256.class, Utils.typeMap(u256a_para, Uint256.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setU256Arr(List u256a_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETU256ARR, + Arrays.asList( + new StaticArray10( + Uint256.class, Utils.typeMap(u256a_para, Uint256.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetU256Arr(List u256a_para) { + final Function function = + new Function( + FUNC_SETU256ARR, + Arrays.asList( + new StaticArray10( + Uint256.class, Utils.typeMap(u256a_para, Uint256.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetU256ArrInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETU256ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>( + convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setU256ArrDyn(List u256a_para) { + final Function function = + new Function( + FUNC_SETU256ARRDYN, + Arrays.asList( + new DynamicArray( + Uint256.class, Utils.typeMap(u256a_para, Uint256.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setU256ArrDyn(List u256a_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETU256ARRDYN, + Arrays.asList( + new DynamicArray( + Uint256.class, Utils.typeMap(u256a_para, Uint256.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetU256ArrDyn(List u256a_para) { + final Function function = + new Function( + FUNC_SETU256ARRDYN, + Arrays.asList( + new DynamicArray( + Uint256.class, Utils.typeMap(u256a_para, Uint256.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetU256ArrDynInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETU256ARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>( + convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setU8(BigInteger u8_para) { + final Function function = + new Function( + FUNC_SETU8, + Arrays.asList(new Uint8(u8_para)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setU8(BigInteger u8_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETU8, + Arrays.asList(new Uint8(u8_para)), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetU8(BigInteger u8_para) { + final Function function = + new Function( + FUNC_SETU8, + Arrays.asList(new Uint8(u8_para)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getSetU8Input(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETU8, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((BigInteger) results.get(0).getValue()); + } + + public TransactionReceipt setU8Arr(List u8a_para) { + final Function function = + new Function( + FUNC_SETU8ARR, + Arrays.asList( + new StaticArray10( + Uint8.class, Utils.typeMap(u8a_para, Uint8.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setU8Arr(List u8a_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETU8ARR, + Arrays.asList( + new StaticArray10( + Uint8.class, Utils.typeMap(u8a_para, Uint8.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetU8Arr(List u8a_para) { + final Function function = + new Function( + FUNC_SETU8ARR, + Arrays.asList( + new StaticArray10( + Uint8.class, Utils.typeMap(u8a_para, Uint8.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetU8ArrInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETU8ARR, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>( + convertToNative((List) results.get(0).getValue())); + } + + public TransactionReceipt setU8ArrDyn(List u8a_para) { + final Function function = + new Function( + FUNC_SETU8ARRDYN, + Arrays.asList( + new DynamicArray( + Uint8.class, Utils.typeMap(u8a_para, Uint8.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public void setU8ArrDyn(List u8a_para, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETU8ARRDYN, + Arrays.asList( + new DynamicArray( + Uint8.class, Utils.typeMap(u8a_para, Uint8.class))), + Collections.>emptyList()); + asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetU8ArrDyn(List u8a_para) { + final Function function = + new Function( + FUNC_SETU8ARRDYN, + Arrays.asList( + new DynamicArray( + Uint8.class, Utils.typeMap(u8a_para, Uint8.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1> getSetU8ArrDynInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETU8ARRDYN, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>( + convertToNative((List) results.get(0).getValue())); + } + + public static CodecTest load(String contractAddress, Client client, CryptoKeyPair credential) { + return new CodecTest(contractAddress, client, credential); + } + + public static CodecTest deploy(Client client, CryptoKeyPair credential) + throws ContractException { + return deploy( + CodecTest.class, client, credential, getBinary(client.getCryptoSuite()), null); + } +} diff --git a/src/integration-test/java/org/fisco/bcos/sdk/contract/ComplexCodecTest.java b/src/integration-test/java/org/fisco/bcos/sdk/contract/ComplexCodecTest.java new file mode 100644 index 000000000..ca0d19d0f --- /dev/null +++ b/src/integration-test/java/org/fisco/bcos/sdk/contract/ComplexCodecTest.java @@ -0,0 +1,889 @@ +package org.fisco.bcos.sdk.contract; + +import java.math.BigInteger; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.fisco.bcos.sdk.abi.FunctionEncoder; +import org.fisco.bcos.sdk.abi.FunctionReturnDecoder; +import org.fisco.bcos.sdk.abi.TypeReference; +import org.fisco.bcos.sdk.abi.datatypes.*; +import org.fisco.bcos.sdk.abi.datatypes.generated.*; +import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple1; +import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple2; +import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple3; +import org.fisco.bcos.sdk.client.Client; +import org.fisco.bcos.sdk.crypto.CryptoSuite; +import org.fisco.bcos.sdk.crypto.keypair.CryptoKeyPair; +import org.fisco.bcos.sdk.model.CryptoType; +import org.fisco.bcos.sdk.model.TransactionReceipt; +import org.fisco.bcos.sdk.model.callback.TransactionCallback; +import org.fisco.bcos.sdk.transaction.model.exception.ContractException; + +@SuppressWarnings("unchecked") +public class ComplexCodecTest extends Contract { + public static final String[] BINARY_ARRAY = { + "60806040523480156200001157600080fd5b5060405162002f7938038062002f79833981016040819052620000349162000329565b8051805182916004916200005091839160209091019062000076565b5060208281015180516200006b9260018501920190620000da565b5090505050620004f5565b828054828255906000526020600020908101928215620000c8579160200282015b82811115620000c85782518051620000b791849160209091019062000126565b509160200191906001019062000097565b50620000d6929150620001a2565b5090565b82805482825590600052602060002090810192821562000118579160200282015b8281111562000118578251825591602001919060010190620000fb565b50620000d6929150620001c3565b8280546200013490620004b8565b90600052602060002090601f01602090048101928262000158576000855562000118565b82601f106200017357805160ff191683800117855562000118565b8280016001018555821562000118579182018281111562000118578251825591602001919060010190620000fb565b80821115620000d6576000620001b98282620001da565b50600101620001a2565b5b80821115620000d65760008155600101620001c4565b508054620001e890620004b8565b6000825580601f10620001f9575050565b601f016020900490600052602060002090810190620002199190620001c3565b50565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156200025757620002576200021c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200028857620002886200021c565b604052919050565b60006001600160401b03821115620002ac57620002ac6200021c565b5060051b60200190565b600082601f830112620002c857600080fd5b81516020620002e1620002db8362000290565b6200025d565b82815260059290921b840181019181810190868411156200030157600080fd5b8286015b848110156200031e578051835291830191830162000305565b509695505050505050565b600060208083850312156200033d57600080fd5b82516001600160401b03808211156200035557600080fd5b818501915060408083880312156200036c57600080fd5b6200037662000232565b8351838111156200038657600080fd5b8401601f810189136200039857600080fd5b8051620003a9620002db8262000290565b81815260059190911b8201870190878101908b831115620003c957600080fd5b8884015b838110156200047e57805188811115620003e75760008081fd5b8501603f81018e13620003fa5760008081fd5b8a810151898111156200041157620004116200021c565b62000425601f8201601f19168d016200025d565b8181528f8a8385010111156200043b5760008081fd5b60005b828110156200045b578381018b01518282018f01528d016200043e565b828111156200046d5760008e84840101525b5085525050918901918901620003cd565b508452505050838501519150828211156200049857600080fd5b620004a688838601620002b6565b85820152809550505050505092915050565b600181811c90821680620004cd57607f821691505b60208210811415620004ef57634e487b7160e01b600052602260045260246000fd5b50919050565b612a7480620005056000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063793f0d221161009757806395c0bf161161006657806395c0bf161461025d578063a1e122e014610270578063b837ecdc14610291578063c4d6d214146102b157600080fd5b8063793f0d22146101ea578063840ac22d146101fd578063873665a11461021d5780639091aad41461023d57600080fd5b8063393c9451116100d3578063393c945114610184578063507968e11461019757806367481cfc146101b75780636e446ffb146101d757600080fd5b80630413cfad146101055780631592c9921461012e5780631af01f3f1461014f578063219d62901461016f575b600080fd5b610118610113366004611cb5565b6102c4565b6040516101259190611e23565b60405180910390f35b61014161013c366004611ec8565b6103fb565b604051908152602001610125565b61016261015d366004611f50565b610438565b604051610125919061207a565b610177610627565b60405161012591906120dc565b6101776101923660046121dc565b61091e565b6101aa6101a5366004611ec8565b610ad9565b6040516101259190612218565b6101ca6101c5366004612259565b610b9e565b6040516101259190612343565b6101416101e5366004611ec8565b610cb0565b6101776101f8366004612351565b610ce5565b61021061020b3660046123ce565b610f46565b60405161012591906124c5565b61023061022b366004612546565b61105d565b6040516101259190612579565b61025061024b3660046125c7565b6111ce565b604051610125919061266a565b6101aa61026b366004611ec8565b611273565b61028361027e3660046121dc565b6112af565b6040516101259291906126cc565b6102a461029f366004612719565b6113c0565b60405161012591906127f2565b6101626102bf36600461285b565b611449565b80516060906102da906000906020850190611603565b506000805480602002602001604051908101604052809291908181526020016000905b828210156103f057838290600052602060002001805480602002602001604051908101604052809291908181526020016000905b828210156103dd5783829060005260206000200180546103509061295d565b80601f016020809104026020016040519081016040528092919081815260200182805461037c9061295d565b80156103c95780601f1061039e576101008083540402835291602001916103c9565b820191906000526020600020905b8154815290600101906020018083116103ac57829003601f168201915b505050505081526020019060010190610331565b50505050815260200190600101906102fd565b505050509050919050565b6001828154811061040b57600080fd5b90600052602060002001818154811061042357600080fd5b90600052602060002001600091509150505481565b6040805180820182526060808252602082015281516001808252818401909352909160009190816020015b6060815260200190600190039081610463579050509050838160008151811061048e5761048e612998565b6020026020010181905250604051806040016040528082815260200184815250600460008201518160000190805190602001906104cc929190611660565b5060208281015180516104e592600185019201906116b9565b505060408051600480546060602082028401810185529383018181529294509092849291849160009085015b828210156105bd5783829060005260206000200180546105309061295d565b80601f016020809104026020016040519081016040528092919081815260200182805461055c9061295d565b80156105a95780601f1061057e576101008083540402835291602001916105a9565b820191906000526020600020905b81548152906001019060200180831161058c57829003601f168201915b505050505081526020019060010190610511565b5050505081526020016001820180548060200260200160405190810160405280929190818152602001828054801561061457602002820191906000526020600020905b815481526020019060010190808311610600575b5050505050815250509150505b92915050565b604080516002808252606082810190935260009190816020015b6040805180820190915260608082526020820152815260200190600190039081610641579050506040805160048054606060208202840181018552938301818152949550919390928492849160009085015b8282101561073f5783829060005260206000200180546106b29061295d565b80601f01602080910402602001604051908101604052809291908181526020018280546106de9061295d565b801561072b5780601f106107005761010080835404028352916020019161072b565b820191906000526020600020905b81548152906001019060200180831161070e57829003601f168201915b505050505081526020019060010190610693565b5050505081526020016001820180548060200260200160405190810160405280929190818152602001828054801561079657602002820191906000526020600020905b815481526020019060010190808311610782575b505050505081525050816000815181106107b2576107b2612998565b6020026020010181905250600460405180604001604052908160008201805480602002602001604051908101604052809291908181526020016000905b8282101561089b57838290600052602060002001805461080e9061295d565b80601f016020809104026020016040519081016040528092919081815260200182805461083a9061295d565b80156108875780601f1061085c57610100808354040283529160200191610887565b820191906000526020600020905b81548152906001019060200180831161086a57829003601f168201915b5050505050815260200190600101906107ef565b505050508152602001600182018054806020026020016040519081016040528092919081815260200182805480156108f257602002820191906000526020600020905b8154815260200190600101908083116108de575b5050505050815250508160018151811061090e5761090e612998565b6020908102919091010152919050565b604080516002808252606082810190935260009190816020015b6040805180820190915260608082526020820152815260200190600190039081610938579050506040805160048054606060208202840181018552938301818152949550919390928492849160009085015b82821015610a365783829060005260206000200180546109a99061295d565b80601f01602080910402602001604051908101604052809291908181526020018280546109d59061295d565b8015610a225780601f106109f757610100808354040283529160200191610a22565b820191906000526020600020905b815481529060010190602001808311610a0557829003601f168201915b50505050508152602001906001019061098a565b50505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015610a8d57602002820191906000526020600020905b815481526020019060010190808311610a79575b50505050508152505081600081518110610aa957610aa9612998565b60200260200101819052508281600181518110610ac857610ac8612998565b602090810291909101015292915050565b60008281548110610ae957600080fd5b906000526020600020018181548110610b", + "0157600080fd5b90600052602060002001600091509150508054610b1d9061295d565b80601f0160208091040260200160405190810160405280929190818152602001828054610b499061295d565b8015610b965780601f10610b6b57610100808354040283529160200191610b96565b820191906000526020600020905b815481529060010190602001808311610b7957829003601f168201915b505050505081565b610ba6611700565b604051806060016040528083600001516001610bc291906129c4565b600f0b815260200183602001516001610bdb9190612a13565b6001600160801b0390811682526040808601516020938401528351928401518216600160801b029290911691909117600690815590820151610c21906007906001611724565b50506040805160608101825260068054600f81900b8352600160801b90046001600160801b031660208084019190915283519081018085529294509092840191600790600190826000855b825461010083900a900460030b8152602060078301819004938401936001036004909301929092029101808411610c6c5790505b5050505050815250509050919050565b60038281548110610cc057600080fd5b90600052602060002090600202018160028110610cdc57600080fd5b01549150829050565b604080516002808252606082810190935260009190816020015b6060815260200190600190039081610cff5790505090508481600081518110610d2a57610d2a612998565b602002602001018190525060405180604001604052808281526020018581525060046000820151816000019080519060200190610d68929190611660565b506020828101518051610d8192600185019201906116b9565b5090505060008360ff166001600160401b03811115610da257610da2611b71565b604051908082528060200260200182016040528015610de757816020015b6040805180820190915260608082526020820152815260200190600190039081610dc05790505b506040805160048054606060208202840181018552938301818152949550919390928492849160009085015b82821015610ebf578382906000526020600020018054610e329061295d565b80601f0160208091040260200160405190810160405280929190818152602001828054610e5e9061295d565b8015610eab5780601f10610e8057610100808354040283529160200191610eab565b820191906000526020600020905b815481529060010190602001808311610e8e57829003601f168201915b505050505081526020019060010190610e13565b50505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015610f1657602002820191906000526020600020905b815481526020019060010190808311610f02575b50505050508152505081600081518110610f3257610f32612998565b602090810291909101015295945050505050565b8051606090610f5c9060029060208501906117be565b506002805480602002602001604051908101604052809291908181526020016000905b828210156103f057600084815260208120604080518082019091529160028086029092019190835b8282101561104a578382018054610fbd9061295d565b80601f0160208091040260200160405190810160405280929190818152602001828054610fe99061295d565b80156110365780601f1061100b57610100808354040283529160200191611036565b820191906000526020600020905b81548152906001019060200180831161101957829003601f168201915b505050505081526020019060010190610fa7565b5050505081526020019060010190610f7f565b60408051602080820183526001808352835160608181018652600f88900b82526001600160801b03878116948301859052958201859052948716600160801b909302929092176006908155906110b7906007908590611724565b50506040805160608082018352600f88900b82526001600160801b03871660208301528183018590528251600280825291810190935290925060009190816020015b611101611700565b8152602001906001900390816110f9579050506040805160608101825260068054600f81900b8352600160801b90046001600160801b031660208084019190915283519081018085529495509193909284019190600790600190826000855b825461010083900a900460030b8152602060078301819004938401936001036004909301929092029101808411611160579050505050505081525050816000815181106111af576111af612998565b60200260200101819052508181600181518110610f3257610f32612998565b80516060906111e4906001906020850190611814565b506001805480602002602001604051908101604052809291908181526020016000905b828210156103f05760008481526020908190208301805460408051828502810185019091528181529283018282801561125f57602002820191906000526020600020905b81548152602001906001019080831161124b575b505050505081526020019060010190611207565b6002828154811061128357600080fd5b9060005260206000209060020201816002811061129f57600080fd5b018054909250610b1d915061295d565b604080518082019091526060808252602082015260606112e2604051806040016040528060608152602001606081525090565b8351805185916004916112fc918391602090910190611660565b50602082810151805161131592600185019201906116b9565b50600291506113219050565b60405190808252806020026020018201604052801561136657816020015b604080518082019091526060808252602082015281526020019060019003908161133f5790505b5060208201819052805185919060009061138257611382612998565b60200260200101819052508381602001516001815181106113a5576113a5612998565b60200260200101819052508081602001519250925050915091565b80516060906113d690600390602085019061186d565b506003805480602002602001604051908101604052809291908181526020016000905b828210156103f05760008481526020902060408051808201918290529160028581029091019182845b815481526020019060010190808311611422575050505050815260200190600101906113f9565b604080518082019091526060808252602082015260008260200151511161146f57600080fd5b816020015160008151811061148657611486612998565b6020026020010151600460008201518160000190805190602001906114ac929190611660565b5060208281015180516114c592600185019201906116b9565b505060408051600480546060602082028401810185529383018181529294509092849291849160009085015b8282101561159d5783829060005260206000200180546115109061295d565b80601f016020809104026020016040519081016040528092919081815260200182805461153c9061295d565b80156115895780601f1061155e57610100808354040283529160200191611589565b820191906000526020600020905b81548152906001019060200180831161156c57829003601f168201915b5050505050815260200190600101906114f1565b50505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015610ca057602002820191906000526020600020905b8154815260200190600101908083116115e0575050505050815250509050919050565b828054828255906000526020600020908101928215611650579160200282015b8281111561165057825180516116409184916020909101906118c3565b5091602001919060010190611623565b5061165c92915061191c565b5090565b8280548282559060005260206000209081019282156116ad579160200282015b828111156116ad578251805161169d918491602090910190611939565b5091602001919060010190611680565b5061165c9291506119ac565b8280548282559060005260206000209081019282156116f4579160200282015b828111156116f45782518255916020019190600101906116d9565b5061165c9291506119c9565b604080516060810182526000808252602082015290810161171f6119de565b905290565b6001830191839082156116f45791602002820160005b8382111561178157835183826101000a81548163ffffffff021916908360030b63ffffffff160217905550926020019260040160208160030104928301926001030261173a565b80156117b15782816101000a81549063ffffffff0219169055600401602081600301049283019260010302611781565b505061165c9291506119c9565b828054828255906000526020600020906002028101928215611808579160200282015b828111156118085782516117f890839060026119fc565b50916020019190600201906117e1565b5061165c929150611a3c565b828054828255906000526020600020908101928215611861579160200282015b8281111561186157825180516118519184916020909101906116b9565b5091602001919060010190611834565b5061165c929150611a59565b8280548282559060005260206000209060020281019282156118b7579160200282015b828111156118b75782516118a79083906002611a76565b5091602001919060020190611890565b5061165c929150611aa3565b828054828255906000526020600020908101928215611910579160200282015b828111156119105782518051611900918491602090910190611939565b50916020019190600101906118e3565b5061165c929150611abd565b8082111561165c5760006119308282611ada565b5060010161191c565b8280546119459061295d565b90600052602060002090601f01602090048101928261196757600085556116f4565b82601f1061198057805160ff19168380011785556116f4565b828001600101855582156116f457918201828111156116f45782518255916020019190600101906116d9565b8082111561165c5760006119c08282611afb565b506001016119ac565b5b8082111561165c57600081556001016119ca565b60405180602001604052806001906020820280368337509192915050565b8260028101928215611910579160200282015b828111156119105782518051611a2c918491602090910190611939565b5091602001919060010190611a0f565b8082111561165c576000611a508282611b35565b50600201611a3c565b8082111561165c576000611a6d8282611b53565b50600101611a59565b82600281019282156116f457916020028201828111156116f45782518255916020019190600101906116d9565b8082111561165c5760008082556001820155600201611aa3565b8082111561165c576000611ad18282611afb565b50600101611abd565b5080546000825590600052602060002090810190611af89190611abd565b5056", + "5b508054611b079061295d565b6000825580601f10611b17575050565b601f016020900490600052602060002090810190611af891906119c9565b506000611b428282611afb565b50611b51906001016000611afb565b565b5080546000825590600052602060002090810190611af891906119c9565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715611ba957611ba9611b71565b60405290565b604051606081016001600160401b0381118282101715611ba957611ba9611b71565b604051602081016001600160401b0381118282101715611ba957611ba9611b71565b604051601f8201601f191681016001600160401b0381118282101715611c1b57611c1b611b71565b604052919050565b60006001600160401b03821115611c3c57611c3c611b71565b5060051b60200190565b600082601f830112611c5757600080fd5b81356001600160401b03811115611c7057611c70611b71565b611c83601f8201601f1916602001611bf3565b818152846020838601011115611c9857600080fd5b816020850160208301376000918101602001919091529392505050565b60006020808385031215611cc857600080fd5b6001600160401b038084351115611cde57600080fd5b8335840185601f820112611cf157600080fd5b8035611d04611cff82611c23565b611bf3565b81815260059190911b82018401908481019088831115611d2357600080fd5b8584015b83811015611dc9578581351115611d3d57600080fd5b803585018a603f820112611d5057600080fd5b87810135611d60611cff82611c23565b81815260059190911b820160400190898101908d831115611d8057600080fd5b604084015b83811015611db8578a81351115611d9b57600080fd5b611dab8f60408335880101611c46565b8352918b01918b01611d85565b508652505050918601918601611d27565b5098975050505050505050565b6000815180845260005b81811015611dfc57602081850181015186830182015201611de0565b81811115611e0e576000602083870101525b50601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060059250604081841b8701018488016000805b84811015611eb957898403603f19018652825180518086529089019089860190808a1b87018b01855b82811015611ea357601f19898303018452611e91828651611dd6565b948d0194938d01939150600101611e75565b50988b0198965050509288019250600101611e4c565b50919998505050505050505050565b60008060408385031215611edb57600080fd5b50508035926020909101359150565b600082601f830112611efb57600080fd5b81356020611f0b611cff83611c23565b82815260059290921b84018101918181019086841115611f2a57600080fd5b8286015b84811015611f455780358352918301918301611f2e565b509695505050505050565b60008060408385031215611f6357600080fd5b82356001600160401b0380821115611f7a57600080fd5b611f8686838701611c46565b93506020850135915080821115611f9c57600080fd5b50611fa985828601611eea565b9150509250929050565b600081518084526020808501808196508360051b8101915082860160005b85811015611ffb578284038952611fe9848351611dd6565b98850198935090840190600101611fd1565b5091979650505050505050565b600081518084526020808501945080840160005b838110156120385781518752958201959082019060010161201c565b509495945050505050565b60008151604084526120586040850182611fb3565b9050602083015184820360208601526120718282612008565b95945050505050565b60208152600061208d6020830184612043565b9392505050565b600081518084526020808501808196508360051b8101915082860160005b85811015611ffb5782840389526120ca848351612043565b988501989350908401906001016120b2565b60208152600061208d6020830184612094565b600082601f83011261210057600080fd5b81356020612110611cff83611c23565b82815260059290921b8401810191818101908684111561212f57600080fd5b8286015b84811015611f455780356001600160401b038111156121525760008081fd5b6121608986838b0101611c46565b845250918301918301612133565b60006040828403121561218057600080fd5b612188611b87565b905081356001600160401b03808211156121a157600080fd5b6121ad858386016120ef565b835260208401359150808211156121c357600080fd5b506121d084828501611eea565b60208301525092915050565b6000602082840312156121ee57600080fd5b81356001600160401b0381111561220457600080fd5b6122108482850161216e565b949350505050565b60208152600061208d6020830184611dd6565b8035600f81900b811461223d57600080fd5b919050565b80356001600160801b038116811461223d57600080fd5b60006060828403121561226b57600080fd5b612273611baf565b61227c8361222b565b8152602061228b818501612242565b8183015284605f85011261229e57600080fd5b6122a6611bd1565b8060608601878111156122b857600080fd5b604087015b818110156122e45780358060030b81146122d75760008081fd5b84529284019284016122bd565b505060408401525090949350505050565b8051600f0b825260206001600160801b0381830151168184015260408201516040840160005b600181101561233b57825160030b8252918301919083019060010161231b565b505050505050565b6060810161062182846122f5565b60008060006060848603121561236657600080fd5b83356001600160401b038082111561237d57600080fd5b61238987838801611c46565b9450602086013591508082111561239f57600080fd5b506123ac86828701611eea565b925050604084013560ff811681146123c357600080fd5b809150509250925092565b600060208083850312156123e157600080fd5b6001600160401b0380843511156123f757600080fd5b8335840185601f82011261240a57600080fd5b8035612418611cff82611c23565b81815260059190911b8201840190848101908883111561243757600080fd5b8584015b83811015611dc957858135111561245157600080fd5b803585018a603f82011261246457600080fd5b61246c611b87565b80606083018d81111561247e57600080fd5b8a84015b818110156124b4578a8135111561249857600080fd5b6124a78f8d8335880101611c46565b8452928b01928b01612482565b50508552505091860191860161243b565b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b84811015611eb957898403603f19018652825184888101845b600281101561253157878203835261251f828551611dd6565b938c0193928c01929150600101612506565b50978a019795505050918701916001016124ed565b6000806040838503121561255957600080fd5b6125628361222b565b915061257060208401612242565b90509250929050565b6020808252825182820181905260009190848201906040850190845b818110156125bb576125a88385516122f5565b9284019260609290920191600101612595565b50909695505050505050565b600060208083850312156125da57600080fd5b82356001600160401b03808211156125f157600080fd5b818501915085601f83011261260557600080fd5b8135612613611cff82611c23565b81815260059190911b8301840190848101908883111561263257600080fd5b8585015b83811015611dc95780358581111561264e5760008081fd5b61265c8b89838a0101611eea565b845250918601918601612636565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156126bf57603f198886030184526126ad858351612008565b94509285019290850190600101612691565b5092979650505050505050565b60408152600083516040808401526126e76080840182611fb3565b90506020850151603f198483030160608501526127048282612094565b91505082810360208401526120718185612094565b6000602080838503121561272c57600080fd5b82356001600160401b0381111561274257600080fd5b8301601f808201861361275457600080fd5b8135612762611cff82611c23565b81815260069190911b8301840190848101908883111561278157600080fd5b938501935b828510156127e657888486011261279d5760008081fd5b6127a5611b87565b80604087018b8111156127b85760008081fd5b875b818110156127d157803584529289019289016127ba565b50508352506040949094019390850190612786565b98975050505050505050565b60208082528251828201819052600091906040908185019086840185805b8381101561284d57825185835b600281101561283a5782518252918901919089019060010161281d565b5050509385019391860191600101612810565b509298975050505050505050565b6000602080838503121561286e57600080fd5b82356001600160401b038082111561288557600080fd5b908401906040828703121561289957600080fd5b6128a1611b87565b8235828111156128b057600080fd5b6128bc888286016120ef565b82525083830135828111156128d057600080fd5b80840193505086601f8401126128e557600080fd5b82356128f3611cff82611c23565b81815260059190911b8401850190858101908983111561291257600080fd5b8686015b8381101561294a5780358681111561292e5760008081fd5b61293c8c8a838b010161216e565b845250918701918701612916565b5095830195909552509695505050505050565b600181811c9082168061297157607f821691505b6020821081141561299257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600081600f0b83600f0b600082128260016001607f1b03038213811516156129ee576129ee6129ae565b8260016001607f1b0319038212811615612a0a57612a0a6129ae565b50019392505050565b60006001600160801b03808316818516808303821115612a3557612a356129ae565b0194935050505056fea2646970667358221220cbb4b742e9d5b7365ce5b03a554cae0a308d71a3733ba78a8c8ce6eb1e1b9e3d64736f6c634300080b0033" + }; + + public static final String BINARY = + org.fisco.bcos.sdk.utils.StringUtils.joinAll("", BINARY_ARRAY); + + public static final String[] SM_BINARY_ARRAY = { + "60806040523480156200001157600080fd5b5060405162002f8338038062002f83833981016040819052620000349162000329565b8051805182916004916200005091839160209091019062000076565b5060208281015180516200006b9260018501920190620000da565b5090505050620004f5565b828054828255906000526020600020908101928215620000c8579160200282015b82811115620000c85782518051620000b791849160209091019062000126565b509160200191906001019062000097565b50620000d6929150620001a2565b5090565b82805482825590600052602060002090810192821562000118579160200282015b8281111562000118578251825591602001919060010190620000fb565b50620000d6929150620001c3565b8280546200013490620004b8565b90600052602060002090601f01602090048101928262000158576000855562000118565b82601f106200017357805160ff191683800117855562000118565b8280016001018555821562000118579182018281111562000118578251825591602001919060010190620000fb565b80821115620000d6576000620001b98282620001da565b50600101620001a2565b5b80821115620000d65760008155600101620001c4565b508054620001e890620004b8565b6000825580601f10620001f9575050565b601f016020900490600052602060002090810190620002199190620001c3565b50565b63b95aa35560e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156200025757620002576200021c565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200028857620002886200021c565b604052919050565b60006001600160401b03821115620002ac57620002ac6200021c565b5060051b60200190565b600082601f830112620002c857600080fd5b81516020620002e1620002db8362000290565b6200025d565b82815260059290921b840181019181810190868411156200030157600080fd5b8286015b848110156200031e578051835291830191830162000305565b509695505050505050565b600060208083850312156200033d57600080fd5b82516001600160401b03808211156200035557600080fd5b818501915060408083880312156200036c57600080fd5b6200037662000232565b8351838111156200038657600080fd5b8401601f810189136200039857600080fd5b8051620003a9620002db8262000290565b81815260059190911b8201870190878101908b831115620003c957600080fd5b8884015b838110156200047e57805188811115620003e75760008081fd5b8501603f81018e13620003fa5760008081fd5b8a810151898111156200041157620004116200021c565b62000425601f8201601f19168d016200025d565b8181528f8a8385010111156200043b5760008081fd5b60005b828110156200045b578381018b01518282018f01528d016200043e565b828111156200046d5760008e84840101525b5085525050918901918901620003cd565b508452505050838501519150828211156200049857600080fd5b620004a688838601620002b6565b85820152809550505050505092915050565b600181811c90821680620004cd57607f821691505b60208210811415620004ef5763b95aa35560e01b600052602260045260246000fd5b50919050565b612a7e80620005056000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c8063a2030f0811610097578063cf0eeb9211610066578063cf0eeb921461025d578063d1b032f91461027e578063d4da0d8c14610291578063f79a6b6a146102b157600080fd5b8063a2030f081461020f578063a312b5f114610224578063a3d819e314610237578063ca60819c1461024a57600080fd5b80634676de9a116100d35780634676de9a1461018e57806354cebc8d146101ae57806373a96cee146101cf57806388c15074146101ef57600080fd5b80631062ff361461010557806332c313081461012e57806336793c591461014e5780633a07f2131461016e575b600080fd5b610118610113366004611ba9565b6102c4565b6040516101259190611c2a565b60405180910390f35b61014161013c366004611dbc565b61044b565b6040516101259190611f12565b61016161015c366004611fa2565b61056d565b604051610125919061207b565b61018161017c36600461214a565b6105f6565b6040516101259190612228565b6101a161019c36600461228a565b61069b565b6040516101259190612326565b6101c16101bc366004612334565b6107ad565b604051908152602001610125565b6101e26101dd366004612334565b6107ea565b6040516101259190612356565b6102026101fd36600461245d565b6108a7565b60405161012591906125eb565b610217610a61565b6040516101259190612646565b610217610232366004612659565b610d58565b610202610245366004612695565b610f13565b6101e2610258366004612334565b611101565b61027061026b366004612659565b611145565b6040516101259291906126f8565b6101c161028c366004612334565b611256565b6102a461029f366004612745565b61128b565b6040516101259190612854565b6102176102bf3660046128ea565b6113b7565b60408051602080820183526001808352835160608181018652600f88900b82526001600160801b03878116948301859052958201859052948716600160801b9093029290921760069081559061031e906007908590611618565b50506040805160608082018352600f88900b82526001600160801b03871660208301528183018590528251600280825291810190935290925060009190816020015b6103686116b7565b815260200190600190039081610360579050506040805160608101825260068054600f81900b8352600160801b90046001600160801b031660208084019190915283519081018085529495509193909284019190600790600190826000855b825461010083900a900460030b81526020600783018190049384019360010360049093019290920291018084116103c75790505050505050815250508160008151811061041657610416612967565b6020026020010181905250818160018151811061043557610435612967565b6020908102919091010152925050505b92915050565b80516060906104619060029060208501906116db565b506002805480602002602001604051908101604052809291908181526020016000905b8282101561056257600084815260208120604080518082019091529160028086029092019190835b8282101561054f5783820180546104c29061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546104ee9061297d565b801561053b5780601f106105105761010080835404028352916020019161053b565b820191906000526020600020905b81548152906001019060200180831161051e57829003601f168201915b5050505050815260200190600101906104ac565b5050505081526020019060010190610484565b505050509050919050565b8051606090610583906003906020850190611731565b506003805480602002602001604051908101604052809291908181526020016000905b828210156105625760008481526020902060408051808201918290529160028581029091019182845b8154815260200190600101908083116105cf575050505050815260200190600101906105a6565b805160609061060c906001906020850190611787565b506001805480602002602001604051908101604052809291908181526020016000905b828210156105625760008481526020908190208301805460408051828502810185019091528181529283018282801561068757602002820191906000526020600020905b815481526020019060010190808311610673575b50505050508152602001906001019061062f565b6106a36116b7565b6040518060600160405280836000015160016106bf91906129ce565b600f0b8152602001836020015160016106d89190612a1d565b6001600160801b0390811682526040808601516020938401528351928401518216600160801b02929091169190911760069081559082015161071e906007906001611618565b50506040805160608101825260068054600f81900b8352600160801b90046001600160801b031660208084019190915283519081018085529294509092840191600790600190826000855b825461010083900a900460030b81526020600783018190049384019360010360049093019290920291018084116107695790505b5050505050815250509050919050565b600182815481106107bd57600080fd5b9060005260206000200181815481106107d557600080fd5b90600052602060002001600091509150505481565b600282815481106107fa57600080fd5b9060005260206000209060020201816002811061081657600080fd5b018054909250610826915061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546108529061297d565b801561089f5780601f106108745761010080835404028352916020019161089f565b820191906000526020600020905b81548152906001019060200180831161088257829003601f168201915b505050505081565b60408051808201909152606080825260208201526000826020015151116108cd57600080fd5b81602001516000815181106108e4576108e4612967565b60200260200101516004600082015181600001908051906020019061090a9291906117e0565b5060208281015180516109239260018501920190611839565b505060408051600480546060602082028401810185529383018181529294509092849291849160009085015b828210156109fb57838290600052602060002001805461096e9061297d565b80601f016020809104026020016040519081016040528092919081815260200182805461099a9061297d565b80156109e75780601f106109bc576101008083540402835291602001916109e7565b820191906000526020600020905b8154815290600101906020018083116109ca57829003601f168201915b50505050508152602001906001019061094f565b5050505081526020016001820180548060200260200160405190810160405280929190818152602001828054801561079d57602002820191906000526020600020905b815481526020019060010190808311610a3e575050505050815250509050919050565b604080516002808252606082810190935260009190816020015b6040805180820190915260608082526020820152815260200190600190039081610a7b579050506040805160048054606060208202840181018552938301818152949550919390928492849160009085015b82821015610b79578382906000526020600020018054610aec9061297d565b80601f0160208091040260200160", + "405190810160405280929190818152602001828054610b189061297d565b8015610b655780601f10610b3a57610100808354040283529160200191610b65565b820191906000526020600020905b815481529060010190602001808311610b4857829003601f168201915b505050505081526020019060010190610acd565b50505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015610bd057602002820191906000526020600020905b815481526020019060010190808311610bbc575b50505050508152505081600081518110610bec57610bec612967565b6020026020010181905250600460405180604001604052908160008201805480602002602001604051908101604052809291908181526020016000905b82821015610cd5578382906000526020600020018054610c489061297d565b80601f0160208091040260200160405190810160405280929190818152602001828054610c749061297d565b8015610cc15780601f10610c9657610100808354040283529160200191610cc1565b820191906000526020600020905b815481529060010190602001808311610ca457829003601f168201915b505050505081526020019060010190610c29565b50505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015610d2c57602002820191906000526020600020905b815481526020019060010190808311610d18575b50505050508152505081600181518110610d4857610d48612967565b6020908102919091010152919050565b604080516002808252606082810190935260009190816020015b6040805180820190915260608082526020820152815260200190600190039081610d72579050506040805160048054606060208202840181018552938301818152949550919390928492849160009085015b82821015610e70578382906000526020600020018054610de39061297d565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0f9061297d565b8015610e5c5780601f10610e3157610100808354040283529160200191610e5c565b820191906000526020600020905b815481529060010190602001808311610e3f57829003601f168201915b505050505081526020019060010190610dc4565b50505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015610ec757602002820191906000526020600020905b815481526020019060010190808311610eb3575b50505050508152505081600081518110610ee357610ee3612967565b60200260200101819052508281600181518110610f0257610f02612967565b602090810291909101015292915050565b6040805180820182526060808252602082015281516001808252818401909352909160009190816020015b6060815260200190600190039081610f3e5790505090508381600081518110610f6957610f69612967565b602002602001018190525060405180604001604052808281526020018481525060046000820151816000019080519060200190610fa79291906117e0565b506020828101518051610fc09260018501920190611839565b505060408051600480546060602082028401810185529383018181529294509092849291849160009085015b8282101561109857838290600052602060002001805461100b9061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546110379061297d565b80156110845780601f1061105957610100808354040283529160200191611084565b820191906000526020600020905b81548152906001019060200180831161106757829003601f168201915b505050505081526020019060010190610fec565b505050508152602001600182018054806020026020016040519081016040528092919081815260200182805480156110ef57602002820191906000526020600020905b8154815260200190600101908083116110db575b50505050508152505091505092915050565b6000828154811061111157600080fd5b90600052602060002001818154811061112957600080fd5b906000526020600020016000915091505080546108269061297d565b60408051808201909152606080825260208201526060611178604051806040016040528060608152602001606081525090565b8351805185916004916111929183916020909101906117e0565b5060208281015180516111ab9260018501920190611839565b50600291506111b79050565b6040519080825280602002602001820160405280156111fc57816020015b60408051808201909152606080825260208201528152602001906001900390816111d55790505b5060208201819052805185919060009061121857611218612967565b602002602001018190525083816020015160018151811061123b5761123b612967565b60200260200101819052508081602001519250925050915091565b6003828154811061126657600080fd5b9060005260206000209060020201816002811061128257600080fd5b01549150829050565b80516060906112a1906000906020850190611874565b506000805480602002602001604051908101604052809291908181526020016000905b8282101561056257838290600052602060002001805480602002602001604051908101604052809291908181526020016000905b828210156113a45783829060005260206000200180546113179061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546113439061297d565b80156113905780601f1061136557610100808354040283529160200191611390565b820191906000526020600020905b81548152906001019060200180831161137357829003601f168201915b5050505050815260200190600101906112f8565b50505050815260200190600101906112c4565b604080516002808252606082810190935260009190816020015b60608152602001906001900390816113d157905050905084816000815181106113fc576113fc612967565b60200260200101819052506040518060400160405280828152602001858152506004600082015181600001908051906020019061143a9291906117e0565b5060208281015180516114539260018501920190611839565b5090505060008360ff166001600160401b0381111561147457611474611c78565b6040519080825280602002602001820160405280156114b957816020015b60408051808201909152606080825260208201528152602001906001900390816114925790505b506040805160048054606060208202840181018552938301818152949550919390928492849160009085015b828210156115915783829060005260206000200180546115049061297d565b80601f01602080910402602001604051908101604052809291908181526020018280546115309061297d565b801561157d5780601f106115525761010080835404028352916020019161157d565b820191906000526020600020905b81548152906001019060200180831161156057829003601f168201915b5050505050815260200190600101906114e5565b505050508152602001600182018054806020026020016040519081016040528092919081815260200182805480156115e857602002820191906000526020600020905b8154815260200190600101908083116115d4575b5050505050815250508160008151811061160457611604612967565b602090810291909101015295945050505050565b6001830191839082156116a75791602002820160005b8382111561167557835183826101000a81548163ffffffff021916908360030b63ffffffff160217905550926020019260040160208160030104928301926001030261162e565b80156116a55782816101000a81549063ffffffff0219169055600401602081600301049283019260010302611675565b505b506116b39291506118cd565b5090565b60408051606081018252600080825260208201529081016116d66118e2565b905290565b828054828255906000526020600020906002028101928215611725579160200282015b828111156117255782516117159083906002611900565b50916020019190600201906116fe565b506116b392915061194c565b82805482825590600052602060002090600202810192821561177b579160200282015b8281111561177b57825161176b9083906002611969565b5091602001919060020190611754565b506116b3929150611996565b8280548282559060005260206000209081019282156117d4579160200282015b828111156117d457825180516117c4918491602090910190611839565b50916020019190600101906117a7565b506116b39291506119b0565b82805482825590600052602060002090810192821561182d579160200282015b8281111561182d578251805161181d9184916020909101906119cd565b5091602001919060010190611800565b506116b3929150611a40565b8280548282559060005260206000209081019282156116a7579160200282015b828111156116a7578251825591602001919060010190611859565b8280548282559060005260206000209081019282156118c1579160200282015b828111156118c157825180516118b1918491602090910190611a5d565b5091602001919060010190611894565b506116b3929150611aaa565b5b808211156116b357600081556001016118ce565b60405180602001604052806001906020820280368337509192915050565b8260028101928215611940579160200282015b8281111561194057825180516119309184916020909101906119cd565b5091602001919060010190611913565b506116b3929150611ac7565b808211156116b35760006119608282611ae4565b5060020161194c565b82600281019282156116a757916020028201828111156116a7578251825591602001919060010190611859565b808211156116b35760008082556001820155600201611996565b808211156116b35760006119c48282611b02565b506001016119b0565b8280546119d99061297d565b90600052602060002090601f0160209004810192826119fb57600085556116a7565b82601f10611a1457805160ff19168380011785556116a7565b828001600101855582156116a757918201828111156116a7578251825591602001919060010190611859565b808211156116b3576000611a548282611b23565b50600101611a40565b828054828255906000526020600020908101928215611940579160200282015b828111156119405782518051611a9a9184916020909101906119cd565b5091602001919060010190611a7d565b808211156116b3576000611abe8282611b5d565b50600101611aaa565b808211156116b3576000611adb8282611b23565b50600101611ac7565b506000611af18282611b23565b50611b009060010160", + "00611b23565b565b5080546000825590600052602060002090810190611b2091906118cd565b50565b508054611b2f9061297d565b6000825580601f10611b3f575050565b601f016020900490600052602060002090810190611b2091906118cd565b5080546000825590600052602060002090810190611b209190611ac7565b8035600f81900b8114611b8d57600080fd5b919050565b80356001600160801b0381168114611b8d57600080fd5b60008060408385031215611bbc57600080fd5b611bc583611b7b565b9150611bd360208401611b92565b90509250929050565b8051600f0b825260206001600160801b0381830151168184015260408201516040840160005b6001811015611c2257825160030b82529183019190830190600101611c02565b505050505050565b6020808252825182820181905260009190848201906040850190845b81811015611c6c57611c59838551611bdc565b9284019260609290920191600101611c46565b50909695505050505050565b63b95aa35560e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715611cb057611cb0611c78565b60405290565b604080519081016001600160401b0381118282101715611cb057611cb0611c78565b604051602081016001600160401b0381118282101715611cb057611cb0611c78565b604051601f8201601f191681016001600160401b0381118282101715611d2257611d22611c78565b604052919050565b60006001600160401b03821115611d4357611d43611c78565b5060051b60200190565b600082601f830112611d5e57600080fd5b81356001600160401b03811115611d7757611d77611c78565b611d8a601f8201601f1916602001611cfa565b818152846020838601011115611d9f57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020808385031215611dcf57600080fd5b6001600160401b038084351115611de557600080fd5b8335840185601f820112611df857600080fd5b8035611e0b611e0682611d2a565b611cfa565b81815260059190911b82018401908481019088831115611e2a57600080fd5b8584015b83811015611eb8578581351115611e4457600080fd5b803585018a603f820112611e5757600080fd5b611e5f611cb6565b80606083018d811115611e7157600080fd5b8a84015b81811015611ea7578a81351115611e8b57600080fd5b611e9a8f8d8335880101611d4d565b8452928b01928b01611e75565b505085525050918601918601611e2e565b5098975050505050505050565b6000815180845260005b81811015611eeb57602081850181015186830182015201611ecf565b81811115611efd576000602083870101525b50601f01601f19169290920160200192915050565b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b84811015611f9357898403603f19018652825184888101845b6002811015611f7e578782038352611f6c828551611ec5565b938c0193928c01929150600101611f53565b50978a01979550505091870191600101611f3a565b50919998505050505050505050565b60006020808385031215611fb557600080fd5b82356001600160401b03811115611fcb57600080fd5b8301601f8082018613611fdd57600080fd5b8135611feb611e0682611d2a565b81815260069190911b8301840190848101908883111561200a57600080fd5b938501935b8285101561206f5788848601126120265760008081fd5b61202e611cb6565b80604087018b8111156120415760008081fd5b875b8181101561205a5780358452928901928901612043565b5050835250604094909401939085019061200f565b98975050505050505050565b60208082528251828201819052600091906040908185019086840185805b838110156120d657825185835b60028110156120c3578251825291890191908901906001016120a6565b5050509385019391860191600101612099565b509298975050505050505050565b600082601f8301126120f557600080fd5b81356020612105611e0683611d2a565b82815260059290921b8401810191818101908684111561212457600080fd5b8286015b8481101561213f5780358352918301918301612128565b509695505050505050565b6000602080838503121561215d57600080fd5b82356001600160401b038082111561217457600080fd5b818501915085601f83011261218857600080fd5b8135612196611e0682611d2a565b81815260059190911b830184019084810190888311156121b557600080fd5b8585015b83811015611eb8578035858111156121d15760008081fd5b6121df8b89838a01016120e4565b8452509186019186016121b9565b600081518084526020808501945080840160005b8381101561221d57815187529582019590820190600101612201565b509495945050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561227d57603f1988860301845261226b8583516121ed565b9450928501929085019060010161224f565b5092979650505050505050565b60006060828403121561229c57600080fd5b6122a4611c8e565b6122ad83611b7b565b815260206122bc818501611b92565b8183015284605f8501126122cf57600080fd5b6122d7611cd8565b8060608601878111156122e957600080fd5b604087015b818110156123155780358060030b81146123085760008081fd5b84529284019284016122ee565b505060408401525090949350505050565b606081016104458284611bdc565b6000806040838503121561234757600080fd5b50508035926020909101359150565b6020815260006123696020830184611ec5565b9392505050565b600082601f83011261238157600080fd5b81356020612391611e0683611d2a565b82815260059290921b840181019181810190868411156123b057600080fd5b8286015b8481101561213f5780356001600160401b038111156123d35760008081fd5b6123e18986838b0101611d4d565b8452509183019183016123b4565b60006040828403121561240157600080fd5b612409611cb6565b905081356001600160401b038082111561242257600080fd5b61242e85838601612370565b8352602084013591508082111561244457600080fd5b50612451848285016120e4565b60208301525092915050565b6000602080838503121561247057600080fd5b82356001600160401b038082111561248757600080fd5b908401906040828703121561249b57600080fd5b6124a3611cb6565b8235828111156124b257600080fd5b6124be88828601612370565b82525083830135828111156124d257600080fd5b80840193505086601f8401126124e757600080fd5b82356124f5611e0682611d2a565b81815260059190911b8401850190858101908983111561251457600080fd5b8686015b8381101561254c578035868111156125305760008081fd5b61253e8c8a838b01016123ef565b845250918701918701612518565b5095830195909552509695505050505050565b600081518084526020808501808196508360051b8101915082860160005b858110156125a7578284038952612595848351611ec5565b9885019893509084019060010161257d565b5091979650505050505050565b60008151604084526125c9604085018261255f565b9050602083015184820360208601526125e282826121ed565b95945050505050565b60208152600061236960208301846125b4565b600081518084526020808501808196508360051b8101915082860160005b858110156125a75782840389526126348483516125b4565b9885019893509084019060010161261c565b60208152600061236960208301846125fe565b60006020828403121561266b57600080fd5b81356001600160401b0381111561268157600080fd5b61268d848285016123ef565b949350505050565b600080604083850312156126a857600080fd5b82356001600160401b03808211156126bf57600080fd5b6126cb86838701611d4d565b935060208501359150808211156126e157600080fd5b506126ee858286016120e4565b9150509250929050565b6040815260008351604080840152612713608084018261255f565b90506020850151603f1984830301606085015261273082826125fe565b91505082810360208401526125e281856125fe565b6000602080838503121561275857600080fd5b6001600160401b03808435111561276e57600080fd5b8335840185601f82011261278157600080fd5b803561278f611e0682611d2a565b81815260059190911b820184019084810190888311156127ae57600080fd5b8584015b83811015611eb85785813511156127c857600080fd5b803585018a603f8201126127db57600080fd5b878101356127eb611e0682611d2a565b81815260059190911b820160400190898101908d83111561280b57600080fd5b604084015b83811015612843578a8135111561282657600080fd5b6128368f60408335880101611d4d565b8352918b01918b01612810565b5086525050509186019186016127b2565b6000602080830181845280855180835260408601915060059250604081841b8701018488016000805b84811015611f9357898403603f19018652825180518086529089019089860190808a1b87018b01855b828110156128d457601f198983030184526128c2828651611ec5565b948d0194938d019391506001016128a6565b50988b019896505050928801925060010161287d565b6000806000606084860312156128ff57600080fd5b83356001600160401b038082111561291657600080fd5b61292287838801611d4d565b9450602086013591508082111561293857600080fd5b50612945868287016120e4565b925050604084013560ff8116811461295c57600080fd5b809150509250925092565b63b95aa35560e01b600052603260045260246000fd5b600181811c9082168061299157607f821691505b602082108114156129b25763b95aa35560e01b600052602260045260246000fd5b50919050565b63b95aa35560e01b600052601160045260246000fd5b600081600f0b83600f0b600082128260016001607f1b03038213811516156129f8576129f86129b8565b8260016001607f1b0319038212811615612a1457612a146129b8565b50019392505050565b60006001600160801b03808316818516808303821115612a3f57612a3f6129b8565b0194935050505056fea26469706673582212201466f6713a2501bd1383248e08f74a427b97bf1f6b89f6509b5e080047c75f2464736f6c634300080b0033" + }; + + public static final String SM_BINARY = + org.fisco.bcos.sdk.utils.StringUtils.joinAll("", SM_BINARY_ARRAY); + + public static final String[] ABI_ARRAY = { + "[{\"inputs\":[{\"components\":[{\"internalType\":\"string[]\",\"name\":\"value_str\",\"type\":\"string[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"bytes32_in_struct\",\"type\":\"bytes32[]\"}],\"internalType\":\"struct StructA\",\"name\":\"a\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"b32_array_array\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"b32_s_array_array\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"b_array_array\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"b_s_array_array\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"int128\",\"name\":\"i1\",\"type\":\"int128\"},{\"internalType\":\"uint128\",\"name\":\"u1\",\"type\":\"uint128\"},{\"internalType\":\"int32[1]\",\"name\":\"b1\",\"type\":\"int32[1]\"}],\"internalType\":\"struct StaticStruct\",\"name\":\"b\",\"type\":\"tuple\"}],\"name\":\"buildStaticStruct\",\"outputs\":[{\"components\":[{\"internalType\":\"int128\",\"name\":\"i1\",\"type\":\"int128\"},{\"internalType\":\"uint128\",\"name\":\"u1\",\"type\":\"uint128\"},{\"internalType\":\"int32[1]\",\"name\":\"b1\",\"type\":\"int32[1]\"}],\"internalType\":\"struct StaticStruct\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int128\",\"name\":\"i1\",\"type\":\"int128\"},{\"internalType\":\"uint128\",\"name\":\"u1\",\"type\":\"uint128\"}],\"name\":\"buildStaticStruct\",\"outputs\":[{\"components\":[{\"internalType\":\"int128\",\"name\":\"i1\",\"type\":\"int128\"},{\"internalType\":\"uint128\",\"name\":\"u1\",\"type\":\"uint128\"},{\"internalType\":\"int32[1]\",\"name\":\"b1\",\"type\":\"int32[1]\"}],\"internalType\":\"struct StaticStruct[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"value_str\",\"type\":\"string\"},{\"internalType\":\"bytes32[]\",\"name\":\"_b\",\"type\":\"bytes32[]\"}],\"name\":\"buildStructA\",\"outputs\":[{\"components\":[{\"internalType\":\"string[]\",\"name\":\"value_str\",\"type\":\"string[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"bytes32_in_struct\",\"type\":\"bytes32[]\"}],\"internalType\":\"struct StructA\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"value_str\",\"type\":\"string\"},{\"internalType\":\"bytes32[]\",\"name\":\"_b\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8\",\"name\":\"size\",\"type\":\"uint8\"}],\"name\":\"buildStructA\",\"outputs\":[{\"components\":[{\"internalType\":\"string[]\",\"name\":\"value_str\",\"type\":\"string[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"bytes32_in_struct\",\"type\":\"bytes32[]\"}],\"internalType\":\"struct StructA[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"string[]\",\"name\":\"value_str\",\"type\":\"string[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"bytes32_in_struct\",\"type\":\"bytes32[]\"}],\"internalType\":\"struct StructA\",\"name\":\"a\",\"type\":\"tuple\"}],\"name\":\"buildStructB\",\"outputs\":[{\"components\":[{\"internalType\":\"string[]\",\"name\":\"d_str\",\"type\":\"string[]\"},{\"components\":[{\"internalType\":\"string[]\",\"name\":\"value_str\",\"type\":\"string[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"bytes32_in_struct\",\"type\":\"bytes32[]\"}],\"internalType\":\"struct StructA[]\",\"name\":\"a_struct\",\"type\":\"tuple[]\"}],\"internalType\":\"struct StructB\",\"name\":\"\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"string[]\",\"name\":\"value_str\",\"type\":\"string[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"bytes32_in_struct\",\"type\":\"bytes32[]\"}],\"internalType\":\"struct StructA[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStructA\",\"outputs\":[{\"components\":[{\"internalType\":\"string[]\",\"name\":\"value_str\",\"type\":\"string[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"bytes32_in_struct\",\"type\":\"bytes32[]\"}],\"internalType\":\"struct StructA[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"string[]\",\"name\":\"value_str\",\"type\":\"string[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"bytes32_in_struct\",\"type\":\"bytes32[]\"}],\"internalType\":\"struct StructA\",\"name\":\"a\",\"type\":\"tuple\"}],\"name\":\"getStructA\",\"outputs\":[{\"components\":[{\"internalType\":\"string[]\",\"name\":\"value_str\",\"type\":\"string[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"bytes32_in_struct\",\"type\":\"bytes32[]\"}],\"internalType\":\"struct StructA[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"string[]\",\"name\":\"d_str\",\"type\":\"string[]\"},{\"components\":[{\"internalType\":\"string[]\",\"name\":\"value_str\",\"type\":\"string[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"bytes32_in_struct\",\"type\":\"bytes32[]\"}],\"internalType\":\"struct StructA[]\",\"name\":\"a_struct\",\"type\":\"tuple[]\"}],\"internalType\":\"struct StructB\",\"name\":\"b\",\"type\":\"tuple\"}],\"name\":\"getStructAInStructB\",\"outputs\":[{\"components\":[{\"internalType\":\"string[]\",\"name\":\"value_str\",\"type\":\"string[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"bytes32_in_struct\",\"type\":\"bytes32[]\"}],\"internalType\":\"struct StructA\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[][]\",\"name\":\"b\",\"type\":\"bytes32[][]\"}],\"name\":\"setBytes32ArrayArray\",\"outputs\":[{\"internalType\":\"bytes32[][]\",\"name\":\"\",\"type\":\"bytes32[][]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[2][]\",\"name\":\"b\",\"type\":\"bytes32[2][]\"}],\"name\":\"setBytes32StaticArrayArray\",\"outputs\":[{\"internalType\":\"bytes32[2][]\",\"name\":\"\",\"type\":\"bytes32[2][]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[][]\",\"name\":\"b\",\"type\":\"bytes[][]\"}],\"name\":\"setBytesArrayArray\",\"outputs\":[{\"internalType\":\"bytes[][]\",\"name\":\"\",\"type\":\"bytes[][]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[2][]\",\"name\":\"b\",\"type\":\"bytes[2][]\"}],\"name\":\"setBytesStaticArrayArray\",\"outputs\":[{\"internalType\":\"bytes[2][]\",\"name\":\"\",\"type\":\"bytes[2][]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" + }; + + public static final String ABI = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", ABI_ARRAY); + + public static final String FUNC_B32_ARRAY_ARRAY = "b32_array_array"; + + public static final String FUNC_B32_S_ARRAY_ARRAY = "b32_s_array_array"; + + public static final String FUNC_B_ARRAY_ARRAY = "b_array_array"; + + public static final String FUNC_B_S_ARRAY_ARRAY = "b_s_array_array"; + + public static final String FUNC_BUILDSTATICSTRUCT = "buildStaticStruct"; + + public static final String FUNC_BUILDSTRUCTA = "buildStructA"; + + public static final String FUNC_BUILDSTRUCTB = "buildStructB"; + + public static final String FUNC_GETSTRUCTA = "getStructA"; + + public static final String FUNC_GETSTRUCTAINSTRUCTB = "getStructAInStructB"; + + public static final String FUNC_SETBYTES32ARRAYARRAY = "setBytes32ArrayArray"; + + public static final String FUNC_SETBYTES32STATICARRAYARRAY = "setBytes32StaticArrayArray"; + + public static final String FUNC_SETBYTESARRAYARRAY = "setBytesArrayArray"; + + public static final String FUNC_SETBYTESSTATICARRAYARRAY = "setBytesStaticArrayArray"; + + protected ComplexCodecTest(String contractAddress, Client client, CryptoKeyPair credential) { + super(getBinary(client.getCryptoSuite()), contractAddress, client, credential); + } + + public static String getBinary(CryptoSuite cryptoSuite) { + return (cryptoSuite.getCryptoTypeConfig() == CryptoType.ECDSA_TYPE ? BINARY : SM_BINARY); + } + + public static String getABI() { + return ABI; + } + + public byte[] b32_array_array(BigInteger param0, BigInteger param1) throws ContractException { + final Function function = + new Function( + FUNC_B32_ARRAY_ARRAY, + Arrays.asList( + new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(param0), + new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(param1)), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, byte[].class); + } + + public byte[] b32_s_array_array(BigInteger param0, BigInteger param1) throws ContractException { + final Function function = + new Function( + FUNC_B32_S_ARRAY_ARRAY, + Arrays.asList( + new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(param0), + new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(param1)), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, byte[].class); + } + + public byte[] b_array_array(BigInteger param0, BigInteger param1) throws ContractException { + final Function function = + new Function( + FUNC_B_ARRAY_ARRAY, + Arrays.asList( + new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(param0), + new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(param1)), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, byte[].class); + } + + public byte[] b_s_array_array(BigInteger param0, BigInteger param1) throws ContractException { + final Function function = + new Function( + FUNC_B_S_ARRAY_ARRAY, + Arrays.asList( + new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(param0), + new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(param1)), + Arrays.>asList(new TypeReference() {})); + return executeCallWithSingleValueReturn(function, byte[].class); + } + + public TransactionReceipt buildStaticStruct(StaticStruct b) { + final Function function = + new Function( + FUNC_BUILDSTATICSTRUCT, + Arrays.asList(b), + Collections.>emptyList()); + return executeTransaction(function); + } + + public byte[] buildStaticStruct(StaticStruct b, TransactionCallback callback) { + final Function function = + new Function( + FUNC_BUILDSTATICSTRUCT, + Arrays.asList(b), + Collections.>emptyList()); + return asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForBuildStaticStruct(StaticStruct b) { + final Function function = + new Function( + FUNC_BUILDSTATICSTRUCT, + Arrays.asList(b), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getBuildStaticStructTupleInput( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_BUILDSTATICSTRUCT, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((StaticStruct) results.get(0)); + } + + public Tuple1 getBuildStaticStructTupleOutput( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getOutput(); + final Function function = + new Function( + FUNC_BUILDSTATICSTRUCT, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((StaticStruct) results.get(0)); + } + + public TransactionReceipt buildStaticStruct(BigInteger i1, BigInteger u1) { + final Function function = + new Function( + FUNC_BUILDSTATICSTRUCT, + Arrays.asList(new Int128(i1), new Uint128(u1)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public byte[] buildStaticStruct(BigInteger i1, BigInteger u1, TransactionCallback callback) { + final Function function = + new Function( + FUNC_BUILDSTATICSTRUCT, + Arrays.asList(new Int128(i1), new Uint128(u1)), + Collections.>emptyList()); + return asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForBuildStaticStruct(BigInteger i1, BigInteger u1) { + final Function function = + new Function( + FUNC_BUILDSTATICSTRUCT, + Arrays.asList(new Int128(i1), new Uint128(u1)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple2 getBuildStaticStructInt128Uint128Input( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_BUILDSTATICSTRUCT, + Arrays.asList(), + Arrays.>asList( + new TypeReference() {}, new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple2( + (BigInteger) results.get(0).getValue(), (BigInteger) results.get(1).getValue()); + } + + public Tuple1> getBuildStaticStructInt128Uint128Output( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getOutput(); + final Function function = + new Function( + FUNC_BUILDSTATICSTRUCT, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>( + new DynamicArray<>( + StaticStruct.class, (List) results.get(0).getValue())); + } + + public TransactionReceipt buildStructA(String value_str, List _b) { + final Function function = + new Function( + FUNC_BUILDSTRUCTA, + Arrays.asList( + new Utf8String(value_str), + new DynamicArray( + Bytes32.class, + org.fisco.bcos.sdk.abi.Utils.typeMap(_b, Bytes32.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public byte[] buildStructA(String value_str, List _b, TransactionCallback callback) { + final Function function = + new Function( + FUNC_BUILDSTRUCTA, + Arrays.asList( + new Utf8String(value_str), + new DynamicArray( + Bytes32.class, + org.fisco.bcos.sdk.abi.Utils.typeMap(_b, Bytes32.class))), + Collections.>emptyList()); + return asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForBuildStructA(String value_str, List _b) { + final Function function = + new Function( + FUNC_BUILDSTRUCTA, + Arrays.asList( + new Utf8String(value_str), + new DynamicArray( + Bytes32.class, + org.fisco.bcos.sdk.abi.Utils.typeMap(_b, Bytes32.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple2> getBuildStructAStringBytes32bytes32Input( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_BUILDSTRUCTA, + Arrays.asList(), + Arrays.>asList( + new TypeReference() {}, + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple2>( + (String) results.get(0).getValue(), + convertToNative((List) results.get(1).getValue())); + } + + public Tuple1 getBuildStructAStringBytes32bytes32Output( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getOutput(); + final Function function = + new Function( + FUNC_BUILDSTRUCTA, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((StructA) results.get(0)); + } + + public TransactionReceipt buildStructA(String value_str, List _b, BigInteger size) { + final Function function = + new Function( + FUNC_BUILDSTRUCTA, + Arrays.asList( + new Utf8String(value_str), + new DynamicArray( + Bytes32.class, + org.fisco.bcos.sdk.abi.Utils.typeMap(_b, Bytes32.class)), + new Uint8(size)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public byte[] buildStructA( + String value_str, List _b, BigInteger size, TransactionCallback callback) { + final Function function = + new Function( + FUNC_BUILDSTRUCTA, + Arrays.asList( + new Utf8String(value_str), + new DynamicArray( + Bytes32.class, + org.fisco.bcos.sdk.abi.Utils.typeMap(_b, Bytes32.class)), + new Uint8(size)), + Collections.>emptyList()); + return asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForBuildStructA( + String value_str, List _b, BigInteger size) { + final Function function = + new Function( + FUNC_BUILDSTRUCTA, + Arrays.asList( + new Utf8String(value_str), + new DynamicArray( + Bytes32.class, + org.fisco.bcos.sdk.abi.Utils.typeMap(_b, Bytes32.class)), + new Uint8(size)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple3, BigInteger> getBuildStructAStringBytes32bytes32Uint8Input( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_BUILDSTRUCTA, + Arrays.asList(), + Arrays.>asList( + new TypeReference() {}, + new TypeReference>() {}, + new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple3, BigInteger>( + (String) results.get(0).getValue(), + convertToNative((List) results.get(1).getValue()), + (BigInteger) results.get(2).getValue()); + } + + public Tuple1> getBuildStructAStringBytes32bytes32Uint8Output( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getOutput(); + final Function function = + new Function( + FUNC_BUILDSTRUCTA, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>( + new DynamicArray<>(StructA.class, (List) results.get(0).getValue())); + } + + public TransactionReceipt buildStructB(StructA a) { + final Function function = + new Function( + FUNC_BUILDSTRUCTB, + Arrays.asList(a), + Collections.>emptyList()); + return executeTransaction(function); + } + + public byte[] buildStructB(StructA a, TransactionCallback callback) { + final Function function = + new Function( + FUNC_BUILDSTRUCTB, + Arrays.asList(a), + Collections.>emptyList()); + return asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForBuildStructB(StructA a) { + final Function function = + new Function( + FUNC_BUILDSTRUCTB, + Arrays.asList(a), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getBuildStructBInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_BUILDSTRUCTB, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((StructA) results.get(0)); + } + + public Tuple2> getBuildStructBOutput( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getOutput(); + final Function function = + new Function( + FUNC_BUILDSTRUCTB, + Arrays.asList(), + Arrays.>asList( + new TypeReference() {}, + new TypeReference>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple2>( + (StructB) results.get(0), + new DynamicArray<>(StructA.class, (List) results.get(1).getValue())); + } + + public List getStructA() throws ContractException { + final Function function = + new Function( + FUNC_GETSTRUCTA, + Arrays.asList(), + Arrays.>asList( + new TypeReference>() {})); + return executeCallWithSingleValueReturn(function, List.class); + } + + public List getStructA(StructA a) throws ContractException { + final Function function = + new Function( + FUNC_GETSTRUCTA, + Arrays.asList(a), + Arrays.>asList( + new TypeReference>() {})); + return executeCallWithSingleValueReturn(function, List.class); + } + + public TransactionReceipt getStructAInStructB(StructB b) { + final Function function = + new Function( + FUNC_GETSTRUCTAINSTRUCTB, + Arrays.asList(b), + Collections.>emptyList()); + return executeTransaction(function); + } + + public byte[] getStructAInStructB(StructB b, TransactionCallback callback) { + final Function function = + new Function( + FUNC_GETSTRUCTAINSTRUCTB, + Arrays.asList(b), + Collections.>emptyList()); + return asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForGetStructAInStructB(StructB b) { + final Function function = + new Function( + FUNC_GETSTRUCTAINSTRUCTB, + Arrays.asList(b), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1 getGetStructAInStructBInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_GETSTRUCTAINSTRUCTB, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((StructB) results.get(0)); + } + + public Tuple1 getGetStructAInStructBOutput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getOutput(); + final Function function = + new Function( + FUNC_GETSTRUCTAINSTRUCTB, + Arrays.asList(), + Arrays.>asList(new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1((StructA) results.get(0)); + } + + public TransactionReceipt setBytes32ArrayArray(List> b) { + final Function function = + new Function( + FUNC_SETBYTES32ARRAYARRAY, + Arrays.asList( + new DynamicArray( + DynamicArray.class, + org.fisco.bcos.sdk.abi.Utils.typeMap( + b, DynamicArray.class, Bytes32.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public byte[] setBytes32ArrayArray(List> b, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBYTES32ARRAYARRAY, + Arrays.asList( + new DynamicArray( + DynamicArray.class, + org.fisco.bcos.sdk.abi.Utils.typeMap( + b, DynamicArray.class, Bytes32.class))), + Collections.>emptyList()); + return asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBytes32ArrayArray(List> b) { + final Function function = + new Function( + FUNC_SETBYTES32ARRAYARRAY, + Arrays.asList( + new DynamicArray( + DynamicArray.class, + org.fisco.bcos.sdk.abi.Utils.typeMap( + b, DynamicArray.class, Bytes32.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1>> getSetBytes32ArrayArrayInput( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBYTES32ARRAYARRAY, + Arrays.asList(), + Arrays.>asList( + new TypeReference>>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>>( + convertToNative((List>) results.get(0).getValue())); + } + + public Tuple1>> getSetBytes32ArrayArrayOutput( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getOutput(); + final Function function = + new Function( + FUNC_SETBYTES32ARRAYARRAY, + Arrays.asList(), + Arrays.>asList( + new TypeReference>>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>>( + convertToNative((List>) results.get(0).getValue())); + } + + public TransactionReceipt setBytes32StaticArrayArray(List> b) { + final Function function = + new Function( + FUNC_SETBYTES32STATICARRAYARRAY, + Arrays.asList( + new DynamicArray( + StaticArray2.class, + org.fisco.bcos.sdk.abi.Utils.typeMap( + b, StaticArray2.class, Bytes32.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public byte[] setBytes32StaticArrayArray(List> b, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBYTES32STATICARRAYARRAY, + Arrays.asList( + new DynamicArray( + StaticArray2.class, + org.fisco.bcos.sdk.abi.Utils.typeMap( + b, StaticArray2.class, Bytes32.class))), + Collections.>emptyList()); + return asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBytes32StaticArrayArray(List> b) { + final Function function = + new Function( + FUNC_SETBYTES32STATICARRAYARRAY, + Arrays.asList( + new DynamicArray( + StaticArray2.class, + org.fisco.bcos.sdk.abi.Utils.typeMap( + b, StaticArray2.class, Bytes32.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1>> getSetBytes32StaticArrayArrayInput( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBYTES32STATICARRAYARRAY, + Arrays.asList(), + Arrays.>asList( + new TypeReference>>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>>( + convertToNative((List>) results.get(0).getValue())); + } + + public Tuple1>> getSetBytes32StaticArrayArrayOutput( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getOutput(); + final Function function = + new Function( + FUNC_SETBYTES32STATICARRAYARRAY, + Arrays.asList(), + Arrays.>asList( + new TypeReference>>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>>( + convertToNative((List>) results.get(0).getValue())); + } + + public TransactionReceipt setBytesArrayArray(List> b) { + final Function function = + new Function( + FUNC_SETBYTESARRAYARRAY, + Arrays.asList( + new DynamicArray( + DynamicArray.class, + org.fisco.bcos.sdk.abi.Utils.typeMap( + b, DynamicArray.class, DynamicBytes.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public byte[] setBytesArrayArray(List> b, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBYTESARRAYARRAY, + Arrays.asList( + new DynamicArray( + DynamicArray.class, + org.fisco.bcos.sdk.abi.Utils.typeMap( + b, DynamicArray.class, DynamicBytes.class))), + Collections.>emptyList()); + return asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBytesArrayArray(List> b) { + final Function function = + new Function( + FUNC_SETBYTESARRAYARRAY, + Arrays.asList( + new DynamicArray( + DynamicArray.class, + org.fisco.bcos.sdk.abi.Utils.typeMap( + b, DynamicArray.class, DynamicBytes.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1>> getSetBytesArrayArrayInput( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBYTESARRAYARRAY, + Arrays.asList(), + Arrays.>asList( + new TypeReference>>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>>( + convertToNative((List>) results.get(0).getValue())); + } + + public Tuple1>> getSetBytesArrayArrayOutput( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getOutput(); + final Function function = + new Function( + FUNC_SETBYTESARRAYARRAY, + Arrays.asList(), + Arrays.>asList( + new TypeReference>>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>>( + convertToNative((List>) results.get(0).getValue())); + } + + public TransactionReceipt setBytesStaticArrayArray(List> b) { + final Function function = + new Function( + FUNC_SETBYTESSTATICARRAYARRAY, + Arrays.asList( + new DynamicArray( + DynamicArray.class, + org.fisco.bcos.sdk.abi.Utils.typeMap( + b, DynamicArray.class, DynamicBytes.class))), + Collections.>emptyList()); + return executeTransaction(function); + } + + public byte[] setBytesStaticArrayArray(List> b, TransactionCallback callback) { + final Function function = + new Function( + FUNC_SETBYTESSTATICARRAYARRAY, + Arrays.asList( + new DynamicArray( + StaticArray2.class, + org.fisco.bcos.sdk.abi.Utils.typeMap( + b, StaticArray2.class, DynamicBytes.class))), + Collections.>emptyList()); + return asyncExecuteTransaction(function, callback); + } + + public String getSignedTransactionForSetBytesStaticArrayArray(List> b) { + final Function function = + new Function( + FUNC_SETBYTESSTATICARRAYARRAY, + Arrays.asList( + new DynamicArray( + StaticArray2.class, + org.fisco.bcos.sdk.abi.Utils.typeMap( + b, StaticArray2.class, DynamicBytes.class))), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public Tuple1>> getSetBytesStaticArrayArrayInput( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_SETBYTESSTATICARRAYARRAY, + Arrays.asList(), + Arrays.>asList( + new TypeReference>>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>>( + convertToNative((List>) results.get(0).getValue())); + } + + public Tuple1>> getSetBytesStaticArrayArrayOutput( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getOutput(); + final Function function = + new Function( + FUNC_SETBYTESSTATICARRAYARRAY, + Arrays.asList(), + Arrays.>asList( + new TypeReference>>() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple1>>( + convertToNative((List>) results.get(0).getValue())); + } + + public static ComplexCodecTest load( + String contractAddress, Client client, CryptoKeyPair credential) { + return new ComplexCodecTest(contractAddress, client, credential); + } + + public static ComplexCodecTest deploy(Client client, CryptoKeyPair credential, StructA a) + throws ContractException { + String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.asList(a)); + return deploy( + ComplexCodecTest.class, + client, + credential, + getBinary(client.getCryptoSuite()), + encodedConstructor); + } + + public static class StructA extends DynamicStruct { + public List value_str; + + public List bytes32_in_struct; + + public StructA( + DynamicArray value_str, DynamicArray bytes32_in_struct) { + super(value_str, bytes32_in_struct); + this.value_str = + value_str + .getValue() + .stream() + .map(Utf8String::getValue) + .collect(java.util.stream.Collectors.toList()); + this.bytes32_in_struct = + bytes32_in_struct + .getValue() + .stream() + .map(Bytes32::getValue) + .collect(java.util.stream.Collectors.toList()); + } + + public StructA(List value_str, List bytes32_in_struct) { + super( + new DynamicArray( + Utf8String.class, + value_str + .stream() + .map(Utf8String::new) + .collect(java.util.stream.Collectors.toList())), + new DynamicArray( + Bytes32.class, + bytes32_in_struct + .stream() + .map(Bytes32::new) + .collect(java.util.stream.Collectors.toList()))); + this.value_str = value_str; + this.bytes32_in_struct = bytes32_in_struct; + } + } + + public static class StaticStruct extends org.fisco.bcos.sdk.abi.datatypes.StaticStruct { + public BigInteger i1; + + public BigInteger u1; + + public List b1; + + public StaticStruct(Int128 i1, Uint128 u1, StaticArray1 b1) { + super(i1, u1, b1); + this.i1 = i1.getValue(); + this.u1 = u1.getValue(); + this.b1 = + b1.getValue() + .stream() + .map(Int32::getValue) + .collect(java.util.stream.Collectors.toList()); + } + + public StaticStruct(BigInteger i1, BigInteger u1, List b1) { + super( + new Int128(i1), + new Uint128(u1), + new StaticArray1( + Int32.class, + b1.stream() + .map(Int32::new) + .collect(java.util.stream.Collectors.toList()))); + this.i1 = i1; + this.u1 = u1; + this.b1 = b1; + } + } + + public static class StructB extends DynamicStruct { + public List d_str; + + public DynamicArray a_struct; + + public StructB(DynamicArray d_str, DynamicArray a_struct) { + super(d_str, a_struct); + this.d_str = + d_str.getValue() + .stream() + .map(Utf8String::getValue) + .collect(java.util.stream.Collectors.toList()); + this.a_struct = a_struct; + } + + public StructB(List d_str, DynamicArray a_struct) { + super( + new DynamicArray( + Utf8String.class, + d_str.stream() + .map(Utf8String::new) + .collect(java.util.stream.Collectors.toList())), + a_struct); + this.d_str = d_str; + this.a_struct = a_struct; + } + } +} diff --git a/src/integration-test/java/org/fisco/bcos/sdk/contract/EventSubDemo.java b/src/integration-test/java/org/fisco/bcos/sdk/contract/EventSubDemo.java new file mode 100644 index 000000000..428b071a8 --- /dev/null +++ b/src/integration-test/java/org/fisco/bcos/sdk/contract/EventSubDemo.java @@ -0,0 +1,583 @@ +package org.fisco.bcos.sdk.contract; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.fisco.bcos.sdk.abi.FunctionReturnDecoder; +import org.fisco.bcos.sdk.abi.TypeReference; +import org.fisco.bcos.sdk.abi.datatypes.*; +import org.fisco.bcos.sdk.abi.datatypes.generated.Bytes32; +import org.fisco.bcos.sdk.abi.datatypes.generated.Int256; +import org.fisco.bcos.sdk.abi.datatypes.generated.Uint256; +import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple2; +import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple3; +import org.fisco.bcos.sdk.client.Client; +import org.fisco.bcos.sdk.crypto.CryptoSuite; +import org.fisco.bcos.sdk.crypto.keypair.CryptoKeyPair; +import org.fisco.bcos.sdk.model.CryptoType; +import org.fisco.bcos.sdk.model.TransactionReceipt; +import org.fisco.bcos.sdk.model.callback.TransactionCallback; +import org.fisco.bcos.sdk.transaction.model.exception.ContractException; + +@SuppressWarnings("unchecked") +public class EventSubDemo extends Contract { + public static final String[] BINARY_ARRAY = { + "608060405234801561001057600080fd5b50610766806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063274b9f101461004657806375a71ca0146100705780639b80b05014610092575b600080fd5b610059610054366004610453565b6100a7565b60405161006792919061050a565b60405180910390f35b61008361007e366004610552565b61015e565b604051610067939291906105a2565b6100a56100a03660046105ca565b610247565b005b60006060837f347ac5ea9ec0d19b3b6ad2651257cc684ecca0e41558fc1c578516e90bcf45f260405160405180910390a2826040516100e69190610637565b604051908190038120907f5f886b86d4364df6c5d7d9a65705aac01b180e2a136442a9921860ca0fdf49db90600090a2826040516101249190610637565b6040519081900381209085907f3752a357a949d58944fee07631779eb98f8c1ba788096770cc9cbc014e2375b890600090a3509192909150565b6000806060857f34d6d9becd7a327109612b0e636ca3bea6263a273c0256df42fbdf3d92e467f960405160405180910390a260405185907f335e9c894374ff443b4a42deadc7dce6dba3b921062aef988a13ed1fba42034390600090a2836040516101c99190610637565b604051908190038120907fdb84d7c006c4de68f9c0bd50b8b81ed31f29ebeec325c872d36445c6565d757c90600090a2836040516102079190610637565b60405190819003812090869088907f6a69e35d4db25f48425c10a32d6e2553fdc3af0e5096cb309b0049c2235e197990600090a450939492935090919050565b604080516001808252818301909252600091816020015b61028260405180606001604052806060815260200160608152602001600081525090565b81526020019060019003908161025e579050509050604051806060016040528085815260200184815260200183815250816000815181106102c5576102c5610653565b60200260200101819052507f6e8b295299c2e7d6f65fcccc3b54ca076974ed2db26b305fe48716ec468a4ee6816040516102ff9190610669565b60405180910390a17f5358be4df107be4d9b023fc323f41d7109610225c6ef211b9d375b9fbd7ccc4f84848460405161033a939291906106fa565b60405180910390a1826040516103509190610637565b6040518091039020846040516103669190610637565b604051908190038120907f8c21d0fee2cb98bb839d8a17a9fe8e11839e85be0675622169aca05cda58260890600090a360405182907f8f922f97953a95596e8c51012daa271d3dd61455382767329dec1c997ed1fbf190600090a250505050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff808411156103f8576103f86103c7565b604051601f8501601f19908116603f01168101908282118183101715610420576104206103c7565b8160405280935085815286868601111561043957600080fd5b858560208301376000602087830101525050509392505050565b6000806040838503121561046657600080fd5b82359150602083013567ffffffffffffffff81111561048457600080fd5b8301601f8101851361049557600080fd5b6104a4858235602084016103dd565b9150509250929050565b60005b838110156104c95781810151838201526020016104b1565b838111156104d8576000848401525b50505050565b600081518084526104f68160208601602086016104ae565b601f01601f19169290920160200192915050565b82815260406020820152600061052360408301846104de565b949350505050565b600082601f83011261053c57600080fd5b61054b838335602085016103dd565b9392505050565b60008060006060848603121561056757600080fd5b8335925060208401359150604084013567ffffffffffffffff81111561058c57600080fd5b6105988682870161052b565b9150509250925092565b8381528260208201526060604082015260006105c160608301846104de565b95945050505050565b6000806000606084860312156105df57600080fd5b833567ffffffffffffffff808211156105f757600080fd5b6106038783880161052b565b9450602086013591508082111561061957600080fd5b506106268682870161052b565b925050604084013590509250925092565b600082516106498184602087016104ae565b9190910192915050565b634e487b7160e01b600052603260045260246000fd5b60006020808301818452808551808352604092508286019150828160051b87010184880160005b838110156106ec57603f198984030185528151606081518186526106b6828701826104de565b915050888201518582038a8701526106ce82826104de565b92890151958901959095525094870194925090860190600101610690565b509098975050505050505050565b60608152600061070d60608301866104de565b828103602084015261071f81866104de565b91505082604083015294935050505056fea264697066735822122089d55dc51975d823956db3c79734aa364503e977f601f3788cbd34b23bb53d6364736f6c634300080b0033" + }; + + public static final String BINARY = + org.fisco.bcos.sdk.utils.StringUtils.joinAll("", BINARY_ARRAY); + + public static final String[] SM_BINARY_ARRAY = { + "608060405234801561001057600080fd5b50610766806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063612d2bff14610046578063d2ae49dd1461005b578063e1ddfaf714610085575b600080fd5b61005961005436600461047a565b6100a7565b005b61006e6100693660046104e7565b610227565b60405161007c92919061059e565b60405180910390f35b6100986100933660046105bf565b6102de565b60405161007c9392919061060f565b604080516001808252818301909252600091816020015b6100e260405180606001604052806060815260200160608152602001600081525090565b8152602001906001900390816100be5790505090506040518060600160405280858152602001848152602001838152508160008151811061012557610125610637565b60200260200101819052507f3ae910f84d81af606d026c30f74703483eb1967fe2ce0739958df871c45354dc8160405161015f919061064d565b60405180910390a17fb8ab06736b3dfec12a172981931c9e25724e33b9d0902dcc3d776d1957fed49584848460405161019a939291906106de565b60405180910390a1826040516101b09190610714565b6040518091039020846040516101c69190610714565b604051908190038120907f7d5d4b35565e8ef6f3e083591478c95dcb35dedf5d0ac6355dde5d9f9e0e5bd390600090a360405182907fe083dc30f45290272bf5496ad6e0c7a5051ed7c6aa2042d26d38a69aa579042190600090a250505050565b60006060837fa088533085dfc0ff7c4d3bbdb59aaff77bbd3c33e7d9ab03a5925f992f9b82a660405160405180910390a2826040516102669190610714565b604051908190038120907fd93dc2cb92c6566fa1747478cf11424fea23528fdb5cbfb18b3d9a617e88531a90600090a2826040516102a49190610714565b6040519081900381209085907f2f05c1c5ee846538bc6a5c8740a4385209bd1569ec55feb14b9a9af7d018730d90600090a3509192909150565b6000806060857f5cbb1b4a7272b6d2f504f0a84614866e3b1c10358e1aff1650b1261492fc134760405160405180910390a260405185907fd8b50b6b74c748d297159108a50fc320d5c4c12ba2ec65a752f8bc35e0422cd190600090a2836040516103499190610714565b604051908190038120907fcb4a0749276a06a00950a4a6d16baf41ed5148d70c2ee5a255bb6c02ee6ad95f90600090a2836040516103879190610714565b60405190819003812090869088907ff16a378efaa9313a2841e3199e34474dcc5449d20b6cc8d5e9f97ef97429b1c390600090a450939492935090919050565b63b95aa35560e01b600052604160045260246000fd5b600067ffffffffffffffff808411156103f8576103f86103c7565b604051601f8501601f19908116603f01168101908282118183101715610420576104206103c7565b8160405280935085815286868601111561043957600080fd5b858560208301376000602087830101525050509392505050565b600082601f83011261046457600080fd5b610473838335602085016103dd565b9392505050565b60008060006060848603121561048f57600080fd5b833567ffffffffffffffff808211156104a757600080fd5b6104b387838801610453565b945060208601359150808211156104c957600080fd5b506104d686828701610453565b925050604084013590509250925092565b600080604083850312156104fa57600080fd5b82359150602083013567ffffffffffffffff81111561051857600080fd5b8301601f8101851361052957600080fd5b610538858235602084016103dd565b9150509250929050565b60005b8381101561055d578181015183820152602001610545565b8381111561056c576000848401525b50505050565b6000815180845261058a816020860160208601610542565b601f01601f19169290920160200192915050565b8281526040602082015260006105b76040830184610572565b949350505050565b6000806000606084860312156105d457600080fd5b8335925060208401359150604084013567ffffffffffffffff8111156105f957600080fd5b61060586828701610453565b9150509250925092565b83815282602082015260606040820152600061062e6060830184610572565b95945050505050565b63b95aa35560e01b600052603260045260246000fd5b60006020808301818452808551808352604092508286019150828160051b87010184880160005b838110156106d057603f1989840301855281516060815181865261069a82870182610572565b915050888201518582038a8701526106b28282610572565b92890151958901959095525094870194925090860190600101610674565b509098975050505050505050565b6060815260006106f16060830186610572565b82810360208401526107038186610572565b915050826040830152949350505050565b60008251610726818460208701610542565b919091019291505056fea2646970667358221220d061c428ac904f1378671d62012d32a5eb0e8c70131d6b5db8364510214eb88b64736f6c634300080b0033" + }; + + public static final String SM_BINARY = + org.fisco.bcos.sdk.utils.StringUtils.joinAll("", SM_BINARY_ARRAY); + + public static final String[] ABI_ARRAY = { + "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"u\",\"type\":\"uint256\"}],\"name\":\"Echo\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"int256\",\"name\":\"i\",\"type\":\"int256\"}],\"name\":\"Echo\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"s\",\"type\":\"string\"}],\"name\":\"Echo\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"u\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"int256\",\"name\":\"i\",\"type\":\"int256\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"s\",\"type\":\"string\"}],\"name\":\"Echo\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"bsn\",\"type\":\"bytes32\"}],\"name\":\"Echo\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes\",\"name\":\"bs\",\"type\":\"bytes\"}],\"name\":\"Echo\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"bsn\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes\",\"name\":\"bs\",\"type\":\"bytes\"}],\"name\":\"Echo\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"from_account\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"to_account\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"from_account\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"string\",\"name\":\"to_account\",\"type\":\"string\"}],\"name\":\"TransferAccount\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TransferAmount\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"string\",\"name\":\"from_account\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"to_account\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"struct EventSubDemo.TransactionData[]\",\"name\":\"transaction_data\",\"type\":\"tuple[]\"}],\"name\":\"TransferData\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"bsn\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"bs\",\"type\":\"bytes\"}],\"name\":\"echo\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"u\",\"type\":\"uint256\"},{\"internalType\":\"int256\",\"name\":\"i\",\"type\":\"int256\"},{\"internalType\":\"string\",\"name\":\"s\",\"type\":\"string\"}],\"name\":\"echo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"from_account\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"to_account\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" + }; + + public static final String ABI = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", ABI_ARRAY); + + public static final String FUNC_ECHO = "echo"; + + public static final String FUNC_TRANSFER = "transfer"; + + public static final Event ECHOUINT256_EVENT = + new Event( + "Echo", Arrays.>asList(new TypeReference(true) {}));; + + public static final Event ECHOINT256_EVENT = + new Event("Echo", Arrays.>asList(new TypeReference(true) {}));; + + public static final Event ECHOSTRING_EVENT = + new Event( + "Echo", + Arrays.>asList(new TypeReference(true) {}));; + + public static final Event ECHOUINT256INT256STRING_EVENT = + new Event( + "Echo", + Arrays.>asList( + new TypeReference(true) {}, + new TypeReference(true) {}, + new TypeReference(true) {}));; + + public static final Event ECHOBYTES32_EVENT = + new Event( + "Echo", Arrays.>asList(new TypeReference(true) {}));; + + public static final Event ECHOBYTES_EVENT = + new Event( + "Echo", + Arrays.>asList(new TypeReference(true) {}));; + + public static final Event ECHOBYTES32BYTES_EVENT = + new Event( + "Echo", + Arrays.>asList( + new TypeReference(true) {}, + new TypeReference(true) {}));; + + public static final Event TRANSFER_EVENT = + new Event( + "Transfer", + Arrays.>asList( + new TypeReference() {}, + new TypeReference() {}, + new TypeReference() {}));; + + public static final Event TRANSFERACCOUNT_EVENT = + new Event( + "TransferAccount", + Arrays.>asList( + new TypeReference(true) {}, + new TypeReference(true) {}));; + + public static final Event TRANSFERAMOUNT_EVENT = + new Event( + "TransferAmount", + Arrays.>asList(new TypeReference(true) {}));; + + public static final Event TRANSFERDATA_EVENT = + new Event( + "TransferData", + Arrays.>asList( + new TypeReference>() {}));; + + protected EventSubDemo(String contractAddress, Client client, CryptoKeyPair credential) { + super(getBinary(client.getCryptoSuite()), contractAddress, client, credential); + } + + public static String getBinary(CryptoSuite cryptoSuite) { + return (cryptoSuite.getCryptoTypeConfig() == CryptoType.ECDSA_TYPE ? BINARY : SM_BINARY); + } + + public static String getABI() { + return ABI; + } + + public List getEchoUint256Events( + TransactionReceipt transactionReceipt) { + List valueList = + extractEventParametersWithLog(ECHOUINT256_EVENT, transactionReceipt); + ArrayList responses = + new ArrayList(valueList.size()); + for (EventValuesWithLog eventValues : valueList) { + EchoUint256EventResponse typedResponse = new EchoUint256EventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.u = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public List getEchoInt256Events( + TransactionReceipt transactionReceipt) { + List valueList = + extractEventParametersWithLog(ECHOINT256_EVENT, transactionReceipt); + ArrayList responses = + new ArrayList(valueList.size()); + for (EventValuesWithLog eventValues : valueList) { + EchoInt256EventResponse typedResponse = new EchoInt256EventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.i = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public List getEchoStringEvents( + TransactionReceipt transactionReceipt) { + List valueList = + extractEventParametersWithLog(ECHOSTRING_EVENT, transactionReceipt); + ArrayList responses = + new ArrayList(valueList.size()); + for (EventValuesWithLog eventValues : valueList) { + EchoStringEventResponse typedResponse = new EchoStringEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.s = (byte[]) eventValues.getIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public List getEchoUint256Int256StringEvents( + TransactionReceipt transactionReceipt) { + List valueList = + extractEventParametersWithLog(ECHOUINT256INT256STRING_EVENT, transactionReceipt); + ArrayList responses = + new ArrayList(valueList.size()); + for (EventValuesWithLog eventValues : valueList) { + EchoUint256Int256StringEventResponse typedResponse = + new EchoUint256Int256StringEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.u = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.i = (BigInteger) eventValues.getIndexedValues().get(1).getValue(); + typedResponse.s = (byte[]) eventValues.getIndexedValues().get(2).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public List getEchoBytes32Events( + TransactionReceipt transactionReceipt) { + List valueList = + extractEventParametersWithLog(ECHOBYTES32_EVENT, transactionReceipt); + ArrayList responses = + new ArrayList(valueList.size()); + for (EventValuesWithLog eventValues : valueList) { + EchoBytes32EventResponse typedResponse = new EchoBytes32EventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.bsn = (byte[]) eventValues.getIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public List getEchoBytesEvents(TransactionReceipt transactionReceipt) { + List valueList = + extractEventParametersWithLog(ECHOBYTES_EVENT, transactionReceipt); + ArrayList responses = + new ArrayList(valueList.size()); + for (EventValuesWithLog eventValues : valueList) { + EchoBytesEventResponse typedResponse = new EchoBytesEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.bs = (byte[]) eventValues.getIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public List getEchoBytes32BytesEvents( + TransactionReceipt transactionReceipt) { + List valueList = + extractEventParametersWithLog(ECHOBYTES32BYTES_EVENT, transactionReceipt); + ArrayList responses = + new ArrayList(valueList.size()); + for (EventValuesWithLog eventValues : valueList) { + EchoBytes32BytesEventResponse typedResponse = new EchoBytes32BytesEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.bsn = (byte[]) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.bs = (byte[]) eventValues.getIndexedValues().get(1).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public List getTransferEvents(TransactionReceipt transactionReceipt) { + List valueList = + extractEventParametersWithLog(TRANSFER_EVENT, transactionReceipt); + ArrayList responses = + new ArrayList(valueList.size()); + for (EventValuesWithLog eventValues : valueList) { + TransferEventResponse typedResponse = new TransferEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.from_account = + (String) eventValues.getNonIndexedValues().get(0).getValue(); + typedResponse.to_account = (String) eventValues.getNonIndexedValues().get(1).getValue(); + typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public List getTransferAccountEvents( + TransactionReceipt transactionReceipt) { + List valueList = + extractEventParametersWithLog(TRANSFERACCOUNT_EVENT, transactionReceipt); + ArrayList responses = + new ArrayList(valueList.size()); + for (EventValuesWithLog eventValues : valueList) { + TransferAccountEventResponse typedResponse = new TransferAccountEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.from_account = (byte[]) eventValues.getIndexedValues().get(0).getValue(); + typedResponse.to_account = (byte[]) eventValues.getIndexedValues().get(1).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public List getTransferAmountEvents( + TransactionReceipt transactionReceipt) { + List valueList = + extractEventParametersWithLog(TRANSFERAMOUNT_EVENT, transactionReceipt); + ArrayList responses = + new ArrayList(valueList.size()); + for (EventValuesWithLog eventValues : valueList) { + TransferAmountEventResponse typedResponse = new TransferAmountEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.amount = (BigInteger) eventValues.getIndexedValues().get(0).getValue(); + responses.add(typedResponse); + } + return responses; + } + + public List getTransferDataEvents( + TransactionReceipt transactionReceipt) { + List valueList = + extractEventParametersWithLog(TRANSFERDATA_EVENT, transactionReceipt); + ArrayList responses = + new ArrayList(valueList.size()); + for (EventValuesWithLog eventValues : valueList) { + TransferDataEventResponse typedResponse = new TransferDataEventResponse(); + typedResponse.log = eventValues.getLog(); + typedResponse.transaction_data = + (DynamicArray) eventValues.getNonIndexedValues().get(0); + responses.add(typedResponse); + } + return responses; + } + + public TransactionReceipt echo(byte[] bsn, byte[] bs) { + final Function function = + new Function( + FUNC_ECHO, + Arrays.asList(new Bytes32(bsn), new DynamicBytes(bs)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public String getSignedTransactionForEcho(byte[] bsn, byte[] bs) { + final Function function = + new Function( + FUNC_ECHO, + Arrays.asList(new Bytes32(bsn), new DynamicBytes(bs)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public byte[] echo(byte[] bsn, byte[] bs, TransactionCallback callback) { + final Function function = + new Function( + FUNC_ECHO, + Arrays.asList(new Bytes32(bsn), new DynamicBytes(bs)), + Collections.>emptyList()); + return asyncExecuteTransaction(function, callback); + } + + public Tuple2 getEchoBytes32BytesInput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_ECHO, + Arrays.asList(), + Arrays.>asList( + new TypeReference() {}, + new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple2( + (byte[]) results.get(0).getValue(), (byte[]) results.get(1).getValue()); + } + + public Tuple2 getEchoBytes32BytesOutput(TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getOutput(); + final Function function = + new Function( + FUNC_ECHO, + Arrays.asList(), + Arrays.>asList( + new TypeReference() {}, + new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple2( + (byte[]) results.get(0).getValue(), (byte[]) results.get(1).getValue()); + } + + public TransactionReceipt echo(BigInteger u, BigInteger i, String s) { + final Function function = + new Function( + FUNC_ECHO, + Arrays.asList(new Uint256(u), new Int256(i), new Utf8String(s)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public String getSignedTransactionForEcho(BigInteger u, BigInteger i, String s) { + final Function function = + new Function( + FUNC_ECHO, + Arrays.asList(new Uint256(u), new Int256(i), new Utf8String(s)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public byte[] echo(BigInteger u, BigInteger i, String s, TransactionCallback callback) { + final Function function = + new Function( + FUNC_ECHO, + Arrays.asList(new Uint256(u), new Int256(i), new Utf8String(s)), + Collections.>emptyList()); + return asyncExecuteTransaction(function, callback); + } + + public Tuple3 getEchoUint256Int256StringInput( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_ECHO, + Arrays.asList(), + Arrays.>asList( + new TypeReference() {}, + new TypeReference() {}, + new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple3( + (BigInteger) results.get(0).getValue(), + (BigInteger) results.get(1).getValue(), + (String) results.get(2).getValue()); + } + + public Tuple3 getEchoUint256Int256StringOutput( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getOutput(); + final Function function = + new Function( + FUNC_ECHO, + Arrays.asList(), + Arrays.>asList( + new TypeReference() {}, + new TypeReference() {}, + new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple3( + (BigInteger) results.get(0).getValue(), + (BigInteger) results.get(1).getValue(), + (String) results.get(2).getValue()); + } + + public TransactionReceipt transfer(String from_account, String to_account, BigInteger amount) { + final Function function = + new Function( + FUNC_TRANSFER, + Arrays.asList( + new Utf8String(from_account), + new Utf8String(to_account), + new Uint256(amount)), + Collections.>emptyList()); + return executeTransaction(function); + } + + public String getSignedTransactionForTransfer( + String from_account, String to_account, BigInteger amount) { + final Function function = + new Function( + FUNC_TRANSFER, + Arrays.asList( + new Utf8String(from_account), + new Utf8String(to_account), + new Uint256(amount)), + Collections.>emptyList()); + return createSignedTransaction(function); + } + + public byte[] transfer( + String from_account, + String to_account, + BigInteger amount, + TransactionCallback callback) { + final Function function = + new Function( + FUNC_TRANSFER, + Arrays.asList( + new Utf8String(from_account), + new Utf8String(to_account), + new Uint256(amount)), + Collections.>emptyList()); + return asyncExecuteTransaction(function, callback); + } + + public Tuple3 getTransferInput( + TransactionReceipt transactionReceipt) { + String data = transactionReceipt.getInput().substring(10); + final Function function = + new Function( + FUNC_TRANSFER, + Arrays.asList(), + Arrays.>asList( + new TypeReference() {}, + new TypeReference() {}, + new TypeReference() {})); + List results = FunctionReturnDecoder.decode(data, function.getOutputParameters()); + return new Tuple3( + (String) results.get(0).getValue(), + (String) results.get(1).getValue(), + (BigInteger) results.get(2).getValue()); + } + + public static EventSubDemo load( + String contractAddress, Client client, CryptoKeyPair credential) { + return new EventSubDemo(contractAddress, client, credential); + } + + public static EventSubDemo deploy(Client client, CryptoKeyPair credential) + throws ContractException { + return deploy( + EventSubDemo.class, client, credential, getBinary(client.getCryptoSuite()), null); + } + + public static class TransactionData extends DynamicStruct { + public String from_account; + + public String to_account; + + public BigInteger amount; + + public TransactionData(Utf8String from_account, Utf8String to_account, Uint256 amount) { + super(from_account, to_account, amount); + this.from_account = from_account.getValue(); + this.to_account = to_account.getValue(); + this.amount = amount.getValue(); + } + + public TransactionData(String from_account, String to_account, BigInteger amount) { + super(new Utf8String(from_account), new Utf8String(to_account), new Uint256(amount)); + this.from_account = from_account; + this.to_account = to_account; + this.amount = amount; + } + } + + public static class EchoUint256EventResponse { + public TransactionReceipt.Logs log; + + public BigInteger u; + } + + public static class EchoInt256EventResponse { + public TransactionReceipt.Logs log; + + public BigInteger i; + } + + public static class EchoStringEventResponse { + public TransactionReceipt.Logs log; + + public byte[] s; + } + + public static class EchoUint256Int256StringEventResponse { + public TransactionReceipt.Logs log; + + public BigInteger u; + + public BigInteger i; + + public byte[] s; + } + + public static class EchoBytes32EventResponse { + public TransactionReceipt.Logs log; + + public byte[] bsn; + } + + public static class EchoBytesEventResponse { + public TransactionReceipt.Logs log; + + public byte[] bs; + } + + public static class EchoBytes32BytesEventResponse { + public TransactionReceipt.Logs log; + + public byte[] bsn; + + public byte[] bs; + } + + public static class TransferEventResponse { + public TransactionReceipt.Logs log; + + public String from_account; + + public String to_account; + + public BigInteger amount; + } + + public static class TransferAccountEventResponse { + public TransactionReceipt.Logs log; + + public byte[] from_account; + + public byte[] to_account; + } + + public static class TransferAmountEventResponse { + public TransactionReceipt.Logs log; + + public BigInteger amount; + } + + public static class TransferDataEventResponse { + public TransactionReceipt.Logs log; + + public DynamicArray transaction_data; + } +} diff --git a/src/integration-test/java/org/fisco/bcos/sdk/precompiled/PrecompiledTest.java b/src/integration-test/java/org/fisco/bcos/sdk/precompiled/PrecompiledTest.java index 45d635915..3c08b877e 100644 --- a/src/integration-test/java/org/fisco/bcos/sdk/precompiled/PrecompiledTest.java +++ b/src/integration-test/java/org/fisco/bcos/sdk/precompiled/PrecompiledTest.java @@ -144,8 +144,6 @@ public void test2CnsService() throws ConfigException { cnsService.registerCNS(contractName, contractVersion, contractAddress, ""); // query the cns information List cnsInfos = cnsService.selectByName(contractName); - Assert.assertTrue(cnsInfos.get(0).getAbi().equals("")); - Assert.assertTrue(cnsInfos.get(0).getVersion().equals(contractVersion)); if (retCode.getCode() == PrecompiledRetCode.CODE_SUCCESS.getCode()) { boolean containContractAddress = false; @@ -155,11 +153,15 @@ public void test2CnsService() throws ConfigException { } } Assert.assertTrue(containContractAddress); + Assert.assertEquals("", cnsInfos.get(0).getAbi()); + Assert.assertEquals(cnsInfos.get(0).getVersion(), contractVersion); + Assert.assertEquals(cnsInfos.get(0).getName(), contractName); + // query contractAddress + String contractAddress1 = + cnsService.getContractAddress(contractName, contractVersion); + Assert.assertEquals(contractAddress1, contractAddress); } - Assert.assertTrue(cnsInfos.get(0).getName().equals(contractName)); - // query contractAddress - cnsService.getContractAddress(contractName, contractVersion); // insert another cns info String contractVersion2 = "2.0"; retCode = cnsService.registerCNS(contractName, contractVersion2, contractAddress, ""); @@ -176,7 +178,7 @@ public void test2CnsService() throws ConfigException { .getContractAddress(contractName, contractVersion2) .equals(contractAddress)); } - // insert anther cns for other contract + // insert another cns for other contract HelloWorld helloWorld2 = HelloWorld.deploy(client, cryptoKeyPair); String contractAddress2 = helloWorld2.getContractAddress(); String contractName2 = "hello"; @@ -227,6 +229,7 @@ private void testSystemConfigService( // Assert.assertTrue(queriedValue.equals(updatedValue)); // Assert.assertTrue(queriedValue.equals(value.add(BigInteger.valueOf(1000)))); } + // Note: Please make sure that the ut is before the permission-related ut @Test public void test5CRUDService() throws ConfigException, ContractException { @@ -353,6 +356,7 @@ public void run() { class FakeTransactionCallback implements PrecompiledCallback { public TransactionReceipt receipt; + // wait until get the transactionReceipt @Override public void onResponse(RetCode retCode) { @@ -602,6 +606,10 @@ public void test8GovernanceService() throws ConfigException { Assert.assertTrue(receipt.getStatus().equals("0x0")); // Assert.assertTrue("test_unfreeze".equals(helloWorld.get())); + RetCode retCode1 = chainGovernanceService.revokeOperator(cryptoKeyPair2.getAddress()); + Assert.assertEquals( + retCode1.getMessage(), PrecompiledRetCode.CODE_SUCCESS.getMessage()); + // revoke the committeeMember chainGovernanceService.revokeCommitteeMember(cryptoKeyPair.getAddress()); Assert.assertTrue(chainGovernanceService.listCommitteeMembers().size() == 0); diff --git a/src/integration-test/java/org/fisco/bcos/sdk/transaction/codec/CodecComplexTest.java b/src/integration-test/java/org/fisco/bcos/sdk/transaction/codec/CodecComplexTest.java new file mode 100644 index 000000000..8db7ae275 --- /dev/null +++ b/src/integration-test/java/org/fisco/bcos/sdk/transaction/codec/CodecComplexTest.java @@ -0,0 +1,212 @@ +package org.fisco.bcos.sdk.transaction.codec; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; +import org.apache.commons.lang3.StringUtils; +import org.bouncycastle.util.encoders.Hex; +import org.fisco.bcos.sdk.BcosSDK; +import org.fisco.bcos.sdk.abi.datatypes.DynamicArray; +import org.fisco.bcos.sdk.abi.datatypes.Utf8String; +import org.fisco.bcos.sdk.abi.datatypes.generated.Bytes32; +import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple1; +import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple2; +import org.fisco.bcos.sdk.client.Client; +import org.fisco.bcos.sdk.contract.ComplexCodecTest; +import org.fisco.bcos.sdk.model.ConstantConfig; +import org.fisco.bcos.sdk.model.TransactionReceipt; +import org.junit.Assert; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class CodecComplexTest { + private static final String CONFIG_FILE = + "src/integration-test/resources/" + ConstantConfig.CONFIG_FILE_NAME; + private final Client client; + + public CodecComplexTest() { + // init the sdk, and set the config options. + BcosSDK sdk = BcosSDK.build(CONFIG_FILE); + client = sdk.getClient(1); + } + + @Test + public void test1ComplexCodecWithType() throws Exception { + String bytes32Str = "ffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff"; + + DynamicArray array = + new DynamicArray<>(Utf8String.class, new Utf8String("test")); + DynamicArray bytes32DynamicArray = + new DynamicArray<>(Bytes32.class, Bytes32.DEFAULT); + ComplexCodecTest complexCodecTest = + ComplexCodecTest.deploy( + client, + client.getCryptoSuite().getCryptoKeyPair(), + new ComplexCodecTest.StructA(array, bytes32DynamicArray)); + + Assert.assertEquals(complexCodecTest.getDeployReceipt().getStatus(), "0x0"); + Assert.assertTrue(StringUtils.isNotBlank(complexCodecTest.getContractAddress())); + // test call get struct + { + List structA = complexCodecTest.getStructA(); + Assert.assertEquals(structA.size(), 2); + Assert.assertEquals(structA.get(0).value_str.get(0), "test"); + + List stringList = new ArrayList<>(); + stringList.add("test2"); + List bytes = new ArrayList<>(); + bytes.add(Hex.decode(bytes32Str)); + List structA1 = + complexCodecTest.getStructA(new ComplexCodecTest.StructA(stringList, bytes)); + Assert.assertEquals(structA1.size(), 2); + Assert.assertEquals(structA1.get(0).value_str.get(0), "test"); + Assert.assertEquals(structA1.get(1).value_str.get(0), "test2"); + Assert.assertEquals( + Hex.toHexString(structA1.get(1).bytes32_in_struct.get(0)), bytes32Str); + } + + // test bytes[][] set and get + { + byte[] b = Hex.decode("1234"); + List bs = new ArrayList<>(); + bs.add(b); + List> bss = new ArrayList<>(); + bss.add(bs); + TransactionReceipt transactionReceipt = complexCodecTest.setBytesArrayArray(bss); + Assert.assertEquals(transactionReceipt.getStatus(), "0x0"); + Tuple1>> setBytesArrayArrayOutput = + complexCodecTest.getSetBytesArrayArrayOutput(transactionReceipt); + byte[] bytes = setBytesArrayArrayOutput.getValue1().get(0).get(0); + Assert.assertEquals( + Hex.toHexString(setBytesArrayArrayOutput.getValue1().get(0).get(0)), "1234"); + } + + // test bytes32[][] set and get + { + byte[] b = + org.fisco.bcos.sdk.utils.Hex.decode( + "ffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff"); + List bs = new ArrayList<>(); + bs.add(b); + List> bss = new ArrayList<>(); + bss.add(bs); + + TransactionReceipt transactionReceipt = complexCodecTest.setBytes32ArrayArray(bss); + Assert.assertEquals(transactionReceipt.getStatus(), "0x0"); + Tuple1>> setBytes32ArrayArrayOutput = + complexCodecTest.getSetBytes32ArrayArrayOutput(transactionReceipt); + Assert.assertEquals( + Hex.toHexString(setBytes32ArrayArrayOutput.getValue1().get(0).get(0)), + "ffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff"); + } + + /* FIXME: array is fixed, and sol2java bytes[2][] to dynamic + // test bytes[2][] set and get + { + byte[] b1 = org.fisco.bcos.sdk.utils.Hex.decode("ffffffff1234567890123456ffffffffffffffff1234567890123456ff111111"); + byte[] b2 = Hex.decode("abcdef"); + List bs = new ArrayList<>(); + bs.add(b1); + bs.add(b2); + List> bss = new ArrayList<>(); + bss.add(bs); + bss.add(bs); + TransactionReceipt transactionReceipt = complexCodecTest.setBytesStaticArrayArray(bss); + Assert.assertEquals(transactionReceipt.getStatus(), "0x0"); + Tuple1>> setBytesStaticArrayArrayOutput = complexCodecTest.getSetBytesStaticArrayArrayOutput(transactionReceipt); + Assert.assertEquals(Hex.toHexString(setBytesStaticArrayArrayOutput.getValue1().get(0).get(0)), "ffffffff1234567890123456ffffffffffffffff1234567890123456ff111111"); + } + */ + + // test bytes32[2][] set and get + { + byte[] b1 = + org.fisco.bcos.sdk.utils.Hex.decode( + "ffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff"); + byte[] b2 = + org.fisco.bcos.sdk.utils.Hex.decode( + "ffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff"); + List bs = new ArrayList<>(); + bs.add(b1); + bs.add(b2); + List> bss = new ArrayList<>(); + bss.add(bs); + TransactionReceipt transactionReceipt = + complexCodecTest.setBytes32StaticArrayArray(bss); + Assert.assertEquals(transactionReceipt.getStatus(), "0x0"); + Tuple1>> setBytes32StaticArrayArrayOutput = + complexCodecTest.getSetBytes32StaticArrayArrayOutput(transactionReceipt); + Assert.assertEquals( + Hex.toHexString(setBytes32StaticArrayArrayOutput.getValue1().get(0).get(0)), + "ffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff"); + } + + // test struct set and get + { + List bytes32DynamicArrays = new ArrayList<>(); + bytes32DynamicArrays.add(Bytes32.DEFAULT.getValue()); + List arrays = new ArrayList<>(); + arrays.add("test2132131"); + + TransactionReceipt receipt = + complexCodecTest.buildStructA("12312312312", bytes32DynamicArrays); + Tuple1 buildStructAOutput = + complexCodecTest.getBuildStructAStringBytes32bytes32Output(receipt); + Assert.assertEquals(buildStructAOutput.getValue1().value_str.get(0), "12312312312"); + Assert.assertEquals(buildStructAOutput.getValue1().bytes32_in_struct.size(), 1); + + TransactionReceipt transactionReceipt = + complexCodecTest.buildStructB( + new ComplexCodecTest.StructA(arrays, bytes32DynamicArrays)); + Assert.assertEquals(transactionReceipt.getStatus(), "0x0"); + Tuple2> + buildStructBOutput = complexCodecTest.getBuildStructBOutput(transactionReceipt); + Assert.assertEquals(buildStructBOutput.getValue1().a_struct.getValue().size(), 2); + Assert.assertEquals(buildStructBOutput.getValue2().getValue().size(), 2); + Assert.assertEquals( + buildStructBOutput.getValue1().a_struct.getValue().get(0).value_str.get(0), + "test2132131"); + Assert.assertEquals( + buildStructBOutput.getValue2().getValue().get(0).value_str.get(0), + "test2132131"); + } + + // test static struct set and get + { + List staticArray = new ArrayList<>(); + staticArray.add(BigInteger.ONE); + // use static struct params, get single struct + TransactionReceipt transactionReceipt = + complexCodecTest.buildStaticStruct( + new ComplexCodecTest.StaticStruct( + BigInteger.valueOf(-128), + BigInteger.valueOf(256), + staticArray)); + Assert.assertEquals(transactionReceipt.getStatus(), "0x0"); + Tuple1 buildStaticStructTupleOutput = + complexCodecTest.getBuildStaticStructTupleOutput(transactionReceipt); + Assert.assertEquals(buildStaticStructTupleOutput.getValue1().b1.size(), 1); + Assert.assertEquals(buildStaticStructTupleOutput.getValue1().b1.get(0), BigInteger.ONE); + Assert.assertEquals( + buildStaticStructTupleOutput.getValue1().i1, BigInteger.valueOf(-127)); + Assert.assertEquals( + buildStaticStructTupleOutput.getValue1().u1, BigInteger.valueOf(257)); + + // use number params, get static struct list + TransactionReceipt transactionReceipt1 = + complexCodecTest.buildStaticStruct(BigInteger.valueOf(-256), BigInteger.TEN); + Assert.assertEquals(transactionReceipt1.getStatus(), "0x0"); + Tuple1> + buildStaticStructInt128Uint128Output = + complexCodecTest.getBuildStaticStructInt128Uint128Output( + transactionReceipt1); + Assert.assertEquals( + buildStaticStructInt128Uint128Output.getValue1().getValue().size(), 2); + Assert.assertEquals( + buildStaticStructInt128Uint128Output.getValue1().getValue().get(0).b1.size(), + 1); + } + } +} diff --git a/src/integration-test/java/org/fisco/bcos/sdk/transaction/codec/CodecTest.java b/src/integration-test/java/org/fisco/bcos/sdk/transaction/codec/CodecTest.java new file mode 100644 index 000000000..c20837a5b --- /dev/null +++ b/src/integration-test/java/org/fisco/bcos/sdk/transaction/codec/CodecTest.java @@ -0,0 +1,359 @@ +package org.fisco.bcos.sdk.transaction.codec; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; +import org.fisco.bcos.sdk.BcosSDK; +import org.fisco.bcos.sdk.abi.Constant; +import org.fisco.bcos.sdk.client.Client; +import org.fisco.bcos.sdk.model.ConstantConfig; +import org.fisco.bcos.sdk.model.TransactionReceipt; +import org.fisco.bcos.sdk.utils.Hex; +import org.junit.Assert; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class CodecTest { + private static final String configFile = + "src/integration-test/resources/" + ConstantConfig.CONFIG_FILE_NAME; + + @Test + public void test1NumericType() throws Exception { + BcosSDK sdk = BcosSDK.build(configFile); + Client client = sdk.getClient(1); + org.fisco.bcos.sdk.contract.CodecTest codecTest = + org.fisco.bcos.sdk.contract.CodecTest.deploy( + client, client.getCryptoSuite().getCryptoKeyPair()); + // string + TransactionReceipt receipt = codecTest.set("Test test"); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + String s = codecTest.get(); + Assert.assertEquals("Test test", s); + // u8 + receipt = codecTest.setU8(BigInteger.TEN); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + + BigInteger u8 = codecTest.getU8(); + Assert.assertEquals(BigInteger.TEN, u8); + + // u128 + // 2^63-1 * 2^63-1 + receipt = codecTest.setU128(Constant.MAX_UINT128); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + BigInteger u128 = codecTest.getU128(); + Assert.assertEquals(0, Constant.MAX_UINT128.compareTo(u128)); + // u256 + receipt = codecTest.setU256(Constant.MAX_UINT256); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + BigInteger u256 = codecTest.getU256(); + Assert.assertEquals(Constant.MAX_UINT256, u256); + // i8 + receipt = codecTest.setI8(BigInteger.valueOf(-1)); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + BigInteger i8 = codecTest.getI8(); + Assert.assertEquals(BigInteger.valueOf(-1), i8); + // i128 + receipt = codecTest.setI128(Constant.MIN_INT128); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + BigInteger i128 = codecTest.getI128(); + Assert.assertEquals(0, Constant.MIN_INT128.compareTo(i128)); + + receipt = codecTest.setI128(Constant.MAX_INT128); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + BigInteger maxI128 = codecTest.getI128(); + Assert.assertEquals(0, Constant.MAX_INT128.compareTo(maxI128)); + // i256 + receipt = codecTest.setI256(BigInteger.valueOf(-123456789)); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + BigInteger i256 = codecTest.getI256(); + Assert.assertEquals(-123456789, i256.longValue()); + } + + @Test + public void test2ByteType() throws Exception { + BcosSDK sdk = BcosSDK.build(configFile); + Client client = sdk.getClient(1); + org.fisco.bcos.sdk.contract.CodecTest codecTest = + org.fisco.bcos.sdk.contract.CodecTest.deploy( + client, client.getCryptoSuite().getCryptoKeyPair()); + + // address + TransactionReceipt receipt = + codecTest.setAddress("0x0000000000000000000000000000000000000000"); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + String address = codecTest.getAddress(); + Assert.assertEquals("0x0000000000000000000000000000000000000000", address); + // bytes1 + receipt = codecTest.setBytes1(Hex.decode("ff")); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + byte[] bytes1 = codecTest.getBytes1(); + Assert.assertEquals("ff", Hex.toHexString(bytes1)); + // bytes16 + String bytes16Str = "ffffffff1234567890123456ffffffff"; + receipt = codecTest.setBytes16(Hex.decode(bytes16Str)); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + byte[] bytes16 = codecTest.getBytes16(); + Assert.assertEquals(bytes16Str, Hex.toHexString(bytes16)); + // bytes32 + receipt = codecTest.setBytes32(Hex.decode(bytes16Str + bytes16Str)); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + byte[] bytes32 = codecTest.getBytes32(); + Assert.assertEquals(bytes16Str + bytes16Str, Hex.toHexString(bytes32)); + // bytes + receipt = codecTest.setBytes(Hex.decode(bytes16Str + bytes16Str + bytes16Str)); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + byte[] bytes = codecTest.getBytes(); + Assert.assertEquals(bytes16Str + bytes16Str + bytes16Str, Hex.toHexString(bytes)); + } + + @Test + public void test3UintNumericArrayType() throws Exception { + BcosSDK sdk = BcosSDK.build(configFile); + Client client = sdk.getClient(1); + org.fisco.bcos.sdk.contract.CodecTest codecTest = + org.fisco.bcos.sdk.contract.CodecTest.deploy( + client, client.getCryptoSuite().getCryptoKeyPair()); + + List uint8Arr10 = new ArrayList<>(); + List uint128Arr10 = new ArrayList<>(); + List uint256Arr10 = new ArrayList<>(); + for (int i = 0; i < 10; i++) { + uint8Arr10.add(BigInteger.valueOf(i)); + uint128Arr10.add(Constant.MAX_UINT128.subtract(BigInteger.valueOf(i))); + uint256Arr10.add(Constant.MAX_UINT256.subtract(BigInteger.valueOf(i))); + } + /// static array + System.out.println("=============uint static array============="); + // uint8[10] + TransactionReceipt receipt = codecTest.setU8Arr(uint8Arr10); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + List u8Arr = codecTest.getU8Arr(); + for (int i = 0; i < u8Arr.size(); i++) { + Assert.assertEquals(uint8Arr10.get(i), u8Arr.get(i)); + } + // uint128[10] + receipt = codecTest.setU128Arr(uint128Arr10); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + List u128Arr = codecTest.getU128Arr(); + for (int i = 0; i < u128Arr.size(); i++) { + Assert.assertEquals(uint128Arr10.get(i), u128Arr.get(i)); + } + // uint256[10] + receipt = codecTest.setU256Arr(uint256Arr10); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + List u256Arr = codecTest.getU256Arr(); + for (int i = 0; i < u256Arr.size(); i++) { + Assert.assertEquals(uint256Arr10.get(i), u256Arr.get(i)); + } + /// dynamic array + System.out.println("=============uint dynamic array============="); + // uint8[] + uint8Arr10.add(BigInteger.valueOf(10)); + receipt = codecTest.setU8ArrDyn(uint8Arr10); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + List u8ArrDyn = codecTest.getU8ArrDyn(); + for (int i = 0; i < u8ArrDyn.size(); i++) { + Assert.assertEquals(uint8Arr10.get(i), u8ArrDyn.get(i)); + } + // uint128[] + uint128Arr10.add(Constant.MAX_UINT128.subtract(BigInteger.valueOf(10))); + receipt = codecTest.setU128ArrDyn(uint128Arr10); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + List u128ArrDyn = codecTest.getU128ArrDyn(); + for (int i = 0; i < u128ArrDyn.size(); i++) { + Assert.assertEquals(uint128Arr10.get(i), u128ArrDyn.get(i)); + } + // uint256[] + uint256Arr10.add(Constant.MAX_UINT256.subtract(BigInteger.valueOf(10))); + receipt = codecTest.setU256ArrDyn(uint256Arr10); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + List u256ArrDyn = codecTest.getU256ArrDyn(); + for (int i = 0; i < u256ArrDyn.size(); i++) { + Assert.assertEquals(uint256Arr10.get(i), u256ArrDyn.get(i)); + } + } + + @Test + public void test4IntNumericArrayType() throws Exception { + BcosSDK sdk = BcosSDK.build(configFile); + Client client = sdk.getClient(1); + org.fisco.bcos.sdk.contract.CodecTest codecTest = + org.fisco.bcos.sdk.contract.CodecTest.deploy( + client, client.getCryptoSuite().getCryptoKeyPair()); + + List int8Arr10 = new ArrayList<>(); + List int128Arr10 = new ArrayList<>(); + List int256Arr10 = new ArrayList<>(); + for (int i = 0; i < 10; i++) { + int8Arr10.add(BigInteger.valueOf(i)); + int128Arr10.add(Constant.MAX_INT128.subtract(BigInteger.valueOf(i))); + int256Arr10.add(BigInteger.valueOf(1234567890L + i)); + } + /// static array + System.out.println("=============int static array============="); + // int8[10] + TransactionReceipt receipt = codecTest.setI8Arr(int8Arr10); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + List i8Arr = codecTest.getI8Arr(); + for (int i = 0; i < i8Arr.size(); i++) { + Assert.assertEquals(int8Arr10.get(i), i8Arr.get(i)); + } + // int128[10] + receipt = codecTest.setI128Arr(int128Arr10); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + List i128Arr = codecTest.getI128Arr(); + for (int i = 0; i < i128Arr.size(); i++) { + Assert.assertEquals(int128Arr10.get(i), i128Arr.get(i)); + } + // int256[10] + receipt = codecTest.setI256Arr(int256Arr10); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + List i256Arr = codecTest.getI256Arr(); + for (int i = 0; i < i256Arr.size(); i++) { + Assert.assertEquals(int256Arr10.get(i), i256Arr.get(i)); + } + /// dynamic array + System.out.println("=============int dynamic array============="); + // int8[] + int8Arr10.add(BigInteger.valueOf(10)); + receipt = codecTest.setI8ArrDyn(int8Arr10); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + List i8ArrDyn = codecTest.getI8ArrDyn(); + for (int i = 0; i < i8ArrDyn.size(); i++) { + Assert.assertEquals(int8Arr10.get(i), i8ArrDyn.get(i)); + } + // int128[] + int128Arr10.add(Constant.MAX_INT128.subtract(BigInteger.valueOf(10))); + receipt = codecTest.setI128ArrDyn(int128Arr10); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + List i128ArrDyn = codecTest.getI128ArrDyn(); + for (int i = 0; i < i128ArrDyn.size(); i++) { + Assert.assertEquals(int128Arr10.get(i), i128ArrDyn.get(i)); + } + // int256[] + int256Arr10.add(BigInteger.valueOf(1234567890L + 10)); + receipt = codecTest.setI256ArrDyn(int256Arr10); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + List i256ArrDyn = codecTest.getI256ArrDyn(); + for (int i = 0; i < i256ArrDyn.size(); i++) { + Assert.assertEquals(int256Arr10.get(i), i256ArrDyn.get(i)); + } + } + + @Test + public void test5IntByteArrayType() throws Exception { + BcosSDK sdk = BcosSDK.build(configFile); + Client client = sdk.getClient(1); + org.fisco.bcos.sdk.contract.CodecTest codecTest = + org.fisco.bcos.sdk.contract.CodecTest.deploy( + client, client.getCryptoSuite().getCryptoKeyPair()); + + List bytes1Arr = new ArrayList<>(); + List bytes16Arr = new ArrayList<>(); + List bytes32Arr = new ArrayList<>(); + for (int i = 0; i < 10; i++) { + bytes1Arr.add(Hex.decode("f" + i)); + bytes16Arr.add(Hex.decode("ffffffff1234567890123456fffffff" + i)); + bytes32Arr.add( + Hex.decode( + "ffffffff1234567890123456fffffff" + + i + + "ffffffff1234567890123456fffffff" + + i)); + } + /// static array + System.out.println("=============bytes static array============="); + // bytes1[10] + TransactionReceipt receipt = codecTest.setBytes1Arr10(bytes1Arr); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + List bytes1Arr10 = codecTest.getBytes1Arr10(); + for (int i = 0; i < bytes1Arr10.size(); i++) { + Assert.assertEquals( + Hex.toHexString(bytes1Arr.get(i)), Hex.toHexString(bytes1Arr10.get(i))); + } + // bytes16[10] + receipt = codecTest.setBytes16Arr10(bytes16Arr); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + List bytes16Arr10 = codecTest.getBytes16Arr10(); + for (int i = 0; i < bytes16Arr10.size(); i++) { + Assert.assertEquals( + Hex.toHexString(bytes16Arr.get(i)), Hex.toHexString(bytes16Arr10.get(i))); + } + // bytes32[10] + receipt = codecTest.setBytes32Arr10(bytes32Arr); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + + List bytes32Arr10 = codecTest.getBytes32Arr10(); + for (int i = 0; i < bytes32Arr10.size(); i++) { + Assert.assertEquals( + Hex.toHexString(bytes32Arr.get(i)), Hex.toHexString(bytes32Arr10.get(i))); + } + + /// dynamic array + System.out.println("=============bytes dynamic array============="); + // bytes1[] + bytes1Arr.add(Hex.decode("ff")); + receipt = codecTest.setBytes1Arr(bytes1Arr); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + + List bytes1ArrD = codecTest.getBytes1Arr(); + for (int i = 0; i < bytes1ArrD.size(); i++) { + Assert.assertEquals( + Hex.toHexString(bytes1Arr.get(i)), Hex.toHexString(bytes1ArrD.get(i))); + } + // bytes16[] + bytes16Arr.add(Hex.decode("ffffffff1234567890123456ffffffff")); + receipt = codecTest.setBytes16Arr(bytes16Arr); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + + List bytes16ArrD = codecTest.getBytes16Arr(); + for (int i = 0; i < bytes16ArrD.size(); i++) { + Assert.assertEquals( + Hex.toHexString(bytes16Arr.get(i)), Hex.toHexString(bytes16ArrD.get(i))); + } + // bytes32[] + bytes32Arr.add( + Hex.decode("ffffffff1234567890123456ffffffffffffffff1234567890123456ffffffff")); + receipt = codecTest.setBytes32Arr(bytes32Arr); + Assert.assertEquals(receipt.getStatus(), "0x0"); + System.out.println(receipt.getOutput()); + + List bytes32ArrD = codecTest.getBytes32Arr(); + for (int i = 0; i < bytes32Arr10.size(); i++) { + Assert.assertEquals( + Hex.toHexString(bytes32Arr.get(i)), Hex.toHexString(bytes32ArrD.get(i))); + } + } +} diff --git a/src/integration-test/java/org/fisco/bcos/sdk/transaction/codec/EvenDemoTest.java b/src/integration-test/java/org/fisco/bcos/sdk/transaction/codec/EvenDemoTest.java new file mode 100644 index 000000000..9c4b9bbcb --- /dev/null +++ b/src/integration-test/java/org/fisco/bcos/sdk/transaction/codec/EvenDemoTest.java @@ -0,0 +1,78 @@ +package org.fisco.bcos.sdk.transaction.codec; + +import java.math.BigInteger; +import java.util.List; +import org.apache.commons.lang3.StringUtils; +import org.fisco.bcos.sdk.BcosSDK; +import org.fisco.bcos.sdk.client.Client; +import org.fisco.bcos.sdk.contract.EventSubDemo; +import org.fisco.bcos.sdk.model.ConstantConfig; +import org.fisco.bcos.sdk.model.TransactionReceipt; +import org.fisco.bcos.sdk.utils.Hex; +import org.junit.Assert; +import org.junit.Test; + +public class EvenDemoTest { + private static final String CONFIG_FILE = + "src/integration-test/resources/" + ConstantConfig.CONFIG_FILE_NAME; + private final Client client; + + public EvenDemoTest() { + // init the sdk, and set the config options. + BcosSDK sdk = BcosSDK.build(CONFIG_FILE); + client = sdk.getClient(1); + } + + @Test + public void testEvent() throws Exception { + + EventSubDemo eventSubDemo = + EventSubDemo.deploy(client, client.getCryptoSuite().getCryptoKeyPair()); + Assert.assertEquals(eventSubDemo.getDeployReceipt().getStatus(), "0x0"); + Assert.assertTrue(StringUtils.isNotBlank(eventSubDemo.getContractAddress())); + + // transfer + { + TransactionReceipt transfer = + eventSubDemo.transfer("test1", "test2", BigInteger.valueOf(100)); + Assert.assertEquals(transfer.getStatus(), "0x0"); + Assert.assertEquals(transfer.getLogs().size(), 4); + List transferDataEvents = + eventSubDemo.getTransferDataEvents(transfer); + EventSubDemo.TransferDataEventResponse transferDataEventResponse = + transferDataEvents.get(0); + EventSubDemo.TransactionData transactionData = + transferDataEventResponse.transaction_data.getValue().get(0); + Assert.assertEquals(transactionData.from_account, "test1"); + Assert.assertEquals(transactionData.to_account, "test2"); + Assert.assertEquals(transactionData.amount, BigInteger.valueOf(100)); + } + + // echo + { + TransactionReceipt echo = + eventSubDemo.echo(BigInteger.valueOf(100), BigInteger.valueOf(-100), "test"); + Assert.assertEquals(echo.getStatus(), "0x0"); + Assert.assertEquals(echo.getLogs().size(), 4); + EventSubDemo.EchoUint256EventResponse echoUint256EventResponse = + eventSubDemo.getEchoUint256Events(echo).get(0); + Assert.assertEquals(echoUint256EventResponse.u, BigInteger.valueOf(100)); + EventSubDemo.EchoInt256EventResponse echoInt256EventResponse = + eventSubDemo.getEchoInt256Events(echo).get(0); + Assert.assertEquals(echoInt256EventResponse.i, BigInteger.valueOf(-100)); + EventSubDemo.EchoStringEventResponse echoStringEventResponse = + eventSubDemo.getEchoStringEvents(echo).get(0); + Assert.assertEquals( + Hex.toHexString(echoStringEventResponse.s), + client.getCryptoSuite().hash("test")); + + EventSubDemo.EchoUint256Int256StringEventResponse echoUint256Int256StringEventResponse = + eventSubDemo.getEchoUint256Int256StringEvents(echo).get(0); + Assert.assertEquals(echoUint256Int256StringEventResponse.u, BigInteger.valueOf(100)); + Assert.assertEquals(echoUint256Int256StringEventResponse.i, BigInteger.valueOf(-100)); + Assert.assertEquals( + Hex.toHexString(echoUint256Int256StringEventResponse.s), + client.getCryptoSuite().hash("test")); + } + } +} diff --git a/src/integration-test/java/org/fisco/bcos/sdk/transaction/decoder/TransactionDecoderServiceTest.java b/src/integration-test/java/org/fisco/bcos/sdk/transaction/decoder/TransactionDecoderServiceTest.java index 5d39fbdaf..07bde5112 100644 --- a/src/integration-test/java/org/fisco/bcos/sdk/transaction/decoder/TransactionDecoderServiceTest.java +++ b/src/integration-test/java/org/fisco/bcos/sdk/transaction/decoder/TransactionDecoderServiceTest.java @@ -16,7 +16,6 @@ import java.math.BigInteger; import java.util.*; - import org.fisco.bcos.sdk.BcosSDK; import org.fisco.bcos.sdk.client.Client; import org.fisco.bcos.sdk.model.ConstantConfig; diff --git a/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionProcessorTest.java b/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionProcessorTest.java index 38541e83d..859f882b9 100644 --- a/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionProcessorTest.java +++ b/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionProcessorTest.java @@ -14,7 +14,6 @@ */ package org.fisco.bcos.sdk.transaction.manager; - import java.math.BigInteger; import java.util.*; import java.util.concurrent.CompletableFuture; @@ -347,7 +346,8 @@ public void test7ComplexSetBytes() throws Exception { } String contractAddress = response.getContractAddress(); // setBytes - List paramsSetBytes = Collections.singletonList(new String("set bytes test".getBytes())); + List paramsSetBytes = + Collections.singletonList(new String("set bytes test".getBytes())); TransactionResponse transactionResponse3 = transactionProcessor.sendTransactionWithStringParamsAndGetResponse( contractAddress, abi, "setBytes", paramsSetBytes); diff --git a/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionWithRemoteSignProcessorTest.java b/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionWithRemoteSignProcessorTest.java index 57f3e24fc..5224b01a7 100644 --- a/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionWithRemoteSignProcessorTest.java +++ b/src/integration-test/java/org/fisco/bcos/sdk/transaction/manager/AssembleTransactionWithRemoteSignProcessorTest.java @@ -15,10 +15,9 @@ package org.fisco.bcos.sdk.transaction.manager; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.concurrent.CompletableFuture; -import java.util.Collections; - import org.apache.commons.lang3.StringUtils; import org.fisco.bcos.sdk.BcosSDK; import org.fisco.bcos.sdk.client.Client; @@ -48,8 +47,7 @@ public class AssembleTransactionWithRemoteSignProcessorTest { "src/integration-test/resources/" + ConstantConfig.CONFIG_FILE_NAME; private static final String abiFile = "src/integration-test/resources/abi/"; private static final String binFile = "src/integration-test/resources/bin/"; - private List params = new ArrayList<>(Collections.singletonList("test")); - ; + private List params = new ArrayList<>(Collections.singletonList("test"));; // prepare sdk, read from the config file private BcosSDK sdk = BcosSDK.build(configFile); // set the group number 1 From 59b13feb87910f2c2e29aee6f370ef45aa2e813b Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Tue, 24 Oct 2023 06:11:32 -0500 Subject: [PATCH 11/22] (project): update org.bouncycastle to bcprov-jdk18on commonsIOVersion to 2.7. (#815) --- .ci/ci_check.sh | 4 ++-- build.gradle | 19 ++++++++++++------- .../sdk/abi/wrapper/ABIDefinitionFactory.java | 8 +++++--- sdk-crypto/build.gradle | 2 +- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.ci/ci_check.sh b/.ci/ci_check.sh index cec76e017..75ab290a2 100755 --- a/.ci/ci_check.sh +++ b/.ci/ci_check.sh @@ -30,8 +30,8 @@ download_tassl() download_build_chain() { LOG_INFO "--- current tag: $tag" -# curl -LO "https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/${tag}/build_chain.sh" && chmod u+x build_chain.sh - curl -LO "https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/master-2.0/tools/build_chain.sh" && chmod u+x build_chain.sh + curl -LO "https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/${tag}/build_chain.sh" && chmod u+x build_chain.sh +# curl -LO "https://raw.githubusercontent.com/FISCO-BCOS/FISCO-BCOS/master-2.0/tools/build_chain.sh" && chmod u+x build_chain.sh } get_sed_cmd() diff --git a/build.gradle b/build.gradle index 1e25cf09a..8cae6a5fa 100644 --- a/build.gradle +++ b/build.gradle @@ -16,16 +16,16 @@ ext { } // jackson version jacksonVersion = "2.15.2" - commonsIOVersion = "2.4" + commonsIOVersion = '2.7' commonsLang3Version = "3.1" javapoetVersion = "1.7.0" picocliVersion = "3.6.0" nettySMSSLContextVersion = "1.5.2" toml4jVersion = "0.7.2" - bcprovJDK15onVersion = "1.60" + bcprovJDK18onVersion = "1.76" webankJavaCryptoVersion = "1.0.2" webankHsmCryptoVersion = "1.0.0-GMT0018" - + gsonVersion = '2.10.1' slf4jVersion = "1.7.36" junitVersion = '4.13.1' commonsCollections4Version = "4.4" @@ -35,7 +35,7 @@ ext { // integrationTest.mustRunAfter test allprojects { group = 'org.fisco-bcos.java-sdk' - version = '2.9.3' + version = '2.10.0-SNAPSHOT' apply plugin: 'maven' apply plugin: 'maven-publish' apply plugin: 'idea' @@ -188,15 +188,20 @@ task integrationTest(type: Test) { } dependencies { - compile ("org.bouncycastle:bcprov-jdk15on:${bcprovJDK15onVersion}") + compile ("org.bouncycastle:bcprov-jdk18on:${bcprovJDK18onVersion}") compile ("org.apache.commons:commons-lang3:${commonsLang3Version}") - compile ("org.fisco-bcos:netty-sm-ssl-context:${nettySMSSLContextVersion}") + compile ("org.fisco-bcos:netty-sm-ssl-context:${nettySMSSLContextVersion}"){ + exclude group: "org.bouncycastle" + } compile ("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}") compile ("commons-io:commons-io:${commonsIOVersion}") compile ("com.squareup:javapoet:${javapoetVersion}") compile ("info.picocli:picocli:${picocliVersion}") compile ("com.webank:webank-blockchain-java-crypto:${webankJavaCryptoVersion}") - compile ("com.moandjiezana.toml:toml4j:${toml4jVersion}") + compile ("com.google.code.gson:gson:${gsonVersion}") + compile ("com.moandjiezana.toml:toml4j:${toml4jVersion}"){ + exclude group: "com.google.code.gson" + } compile ("com.webank:webank-blockchain-hsm-crypto:${webankHsmCryptoVersion}") testCompile ("org.apache.commons:commons-collections4:${commonsCollections4Version}") } diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABIDefinitionFactory.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABIDefinitionFactory.java index 6a98b45f0..44338acd1 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABIDefinitionFactory.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABIDefinitionFactory.java @@ -60,15 +60,17 @@ public ContractABIDefinition loadABI(String abi) { break; } - if (logger.isInfoEnabled()) { - logger.info(" abiDefinition: {}", abiDefinition); + if (logger.isTraceEnabled()) { + logger.trace(" abiDefinition: {}", abiDefinition); } } if (contractABIDefinition.getConstructor() == null) { contractABIDefinition.setConstructor( ABIDefinition.createDefaultConstructorABIDefinition()); } - logger.info(" contractABIDefinition {} ", contractABIDefinition); + if (logger.isTraceEnabled()) { + logger.trace(" contractABIDefinition {} ", contractABIDefinition); + } return contractABIDefinition; diff --git a/sdk-crypto/build.gradle b/sdk-crypto/build.gradle index 574c22fd3..7ee1f1720 100644 --- a/sdk-crypto/build.gradle +++ b/sdk-crypto/build.gradle @@ -4,7 +4,7 @@ plugins { } dependencies { compile project(':sdk-core') - compile ("org.bouncycastle:bcprov-jdk15on:${bcprovJDK15onVersion}") + compile ("org.bouncycastle:bcprov-jdk18on:${bcprovJDK18onVersion}") compile ("com.webank:webank-blockchain-java-crypto:${webankJavaCryptoVersion}") compile ("com.webank:webank-blockchain-hsm-crypto:${webankHsmCryptoVersion}") } From 950f36b64e00cb4584f6038e4aad84c3e603027f Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Fri, 15 Dec 2023 10:18:18 +0800 Subject: [PATCH 12/22] (build): update netty to 4.1.100.Final (#851) --- build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle b/build.gradle index 8cae6a5fa..58d3deeb2 100644 --- a/build.gradle +++ b/build.gradle @@ -193,6 +193,7 @@ dependencies { compile ("org.fisco-bcos:netty-sm-ssl-context:${nettySMSSLContextVersion}"){ exclude group: "org.bouncycastle" } + implementation ('io.netty:netty-all:4.1.100.Final') compile ("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}") compile ("commons-io:commons-io:${commonsIOVersion}") compile ("com.squareup:javapoet:${javapoetVersion}") @@ -204,6 +205,8 @@ dependencies { } compile ("com.webank:webank-blockchain-hsm-crypto:${webankHsmCryptoVersion}") testCompile ("org.apache.commons:commons-collections4:${commonsCollections4Version}") + testImplementation('io.netty:netty-all:4.1.100.Final') + integrationTestImplementation('io.netty:netty-all:4.1.100.Final') } javadoc { From b0f11df23fd298776eac27339e2c58a779abe732 Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Wed, 24 Jan 2024 16:31:59 +0800 Subject: [PATCH 13/22] (precompiled): fix GasChargeManageService constructor compatibility issue. (#869) --- .../gaschargemgr/GasChargeManageService.java | 16 ++++++++++++++-- src/test/resources/config-example.toml | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/contract/precompiled/gaschargemgr/GasChargeManageService.java b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/contract/precompiled/gaschargemgr/GasChargeManageService.java index 2c2356fad..07c5d93e7 100644 --- a/sdk-transaction/src/main/java/org/fisco/bcos/sdk/contract/precompiled/gaschargemgr/GasChargeManageService.java +++ b/sdk-transaction/src/main/java/org/fisco/bcos/sdk/contract/precompiled/gaschargemgr/GasChargeManageService.java @@ -23,11 +23,11 @@ public class GasChargeManageService { private final GasChargeManagePrecompiled gasChargeManagePrecompiled; private final TransactionDecoderInterface transactionDecoder; + private final Client client; public GasChargeManageService(Client client, CryptoKeyPair cryptoKeyPair) throws ContractException { - PrecompiledVersionCheck.GAS_CHARGE_MANAGE_PRECOMPILED_VERSION.checkVersion( - client.getClientNodeVersion().getNodeVersion().getSupportedVersion()); + this.client = client; this.gasChargeManagePrecompiled = GasChargeManagePrecompiled.load( PrecompiledAddress.GAS_CHARGE_MANAGE_PRECOMPILED_ADDRESS, @@ -66,6 +66,8 @@ public TransactionResponse decodeReceipt( public TransactionResponse charge(String userAccount, BigInteger gasValue) throws ContractException { + PrecompiledVersionCheck.GAS_CHARGE_MANAGE_PRECOMPILED_VERSION.checkVersion( + client.getClientNodeVersion().getNodeVersion().getSupportedVersion()); return decodeReceipt( gasChargeManagePrecompiled.charge(userAccount, gasValue), gasChargeManagePrecompiled.FUNC_CHARGE, @@ -74,6 +76,8 @@ public TransactionResponse charge(String userAccount, BigInteger gasValue) public TransactionResponse deduct(String userAccount, BigInteger gasValue) throws ContractException { + PrecompiledVersionCheck.GAS_CHARGE_MANAGE_PRECOMPILED_VERSION.checkVersion( + client.getClientNodeVersion().getNodeVersion().getSupportedVersion()); return decodeReceipt( gasChargeManagePrecompiled.deduct(userAccount, gasValue), gasChargeManagePrecompiled.FUNC_DEDUCT, @@ -81,6 +85,8 @@ public TransactionResponse deduct(String userAccount, BigInteger gasValue) } public BigInteger queryRemainGas(String userAccount) throws ContractException { + PrecompiledVersionCheck.GAS_CHARGE_MANAGE_PRECOMPILED_VERSION.checkVersion( + client.getClientNodeVersion().getNodeVersion().getSupportedVersion()); Tuple2 result = this.gasChargeManagePrecompiled.queryRemainGas(userAccount); if (result.getValue1().intValue() != PrecompiledRetCode.CODE_SUCCESS.getCode()) { @@ -92,16 +98,22 @@ public BigInteger queryRemainGas(String userAccount) throws ContractException { } public RetCode grantCharger(String chargerAccount) throws ContractException { + PrecompiledVersionCheck.GAS_CHARGE_MANAGE_PRECOMPILED_VERSION.checkVersion( + client.getClientNodeVersion().getNodeVersion().getSupportedVersion()); return ReceiptParser.parseTransactionReceipt( gasChargeManagePrecompiled.grantCharger(chargerAccount)); } public RetCode revokeCharger(String chargerAccount) throws ContractException { + PrecompiledVersionCheck.GAS_CHARGE_MANAGE_PRECOMPILED_VERSION.checkVersion( + client.getClientNodeVersion().getNodeVersion().getSupportedVersion()); return ReceiptParser.parseTransactionReceipt( gasChargeManagePrecompiled.revokeCharger(chargerAccount)); } public List listChargers() throws ContractException { + PrecompiledVersionCheck.GAS_CHARGE_MANAGE_PRECOMPILED_VERSION.checkVersion( + client.getClientNodeVersion().getNodeVersion().getSupportedVersion()); try { List chargerList = new ArrayList<>(); chargerList = this.gasChargeManagePrecompiled.listChargers(); diff --git a/src/test/resources/config-example.toml b/src/test/resources/config-example.toml index 59f069b45..9fe9e1a93 100644 --- a/src/test/resources/config-example.toml +++ b/src/test/resources/config-example.toml @@ -18,7 +18,7 @@ certPath = "conf" # The certification path # default load the GM SSL encryption privateKey from ${certPath}/gm/gmensdk.key [network] -peers=["127.0.0.1:20200", "127.0.0.1:20201"] # The peer list to connect +peers=["127.0.0.1:20200"] # The peer list to connect # AMOP configuration From e3b49622f88494953d834bef1d6047e0002dd7a0 Mon Sep 17 00:00:00 2001 From: nonobabaya <30588090+nonobabaya@users.noreply.github.com> Date: Wed, 24 Jan 2024 16:42:55 +0800 Subject: [PATCH 14/22] (channel): fix block limit notify bug in old chain version. (#868) Co-authored-by: Kyon <32325790+kyonRay@users.noreply.github.com> --- .../fisco/bcos/sdk/service/model/BlockNumberMessageDecoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk-service/src/main/java/org/fisco/bcos/sdk/service/model/BlockNumberMessageDecoder.java b/sdk-service/src/main/java/org/fisco/bcos/sdk/service/model/BlockNumberMessageDecoder.java index 1161c2991..f08508d32 100644 --- a/sdk-service/src/main/java/org/fisco/bcos/sdk/service/model/BlockNumberMessageDecoder.java +++ b/sdk-service/src/main/java/org/fisco/bcos/sdk/service/model/BlockNumberMessageDecoder.java @@ -64,7 +64,7 @@ protected BlockNumberNotification decodeByDefault(Message message) { * @return the decoded block number information */ protected BlockNumberNotification decodeV1(Message message) { - String[] split = message.getData().toString().split(","); + String[] split = new String(message.getData()).split(","); if (split.length != 2) { return null; } From b7bebc47d5417180329b4578a9f11e7d2dfc35c5 Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Fri, 1 Mar 2024 18:45:08 +0800 Subject: [PATCH 15/22] (abi): fix struct type codec and two-dimensional array type bug. (#892) --- build.gradle | 10 +- .../bcos/sdk/abi/datatypes/StaticArray.java | 7 +- .../bcos/sdk/abi/wrapper/ABICodecObject.java | 126 +++++++++++++++--- 3 files changed, 121 insertions(+), 22 deletions(-) diff --git a/build.gradle b/build.gradle index 58d3deeb2..90571ade9 100644 --- a/build.gradle +++ b/build.gradle @@ -15,15 +15,15 @@ ext { ossrhPassword="xxx" } // jackson version - jacksonVersion = "2.15.2" + jacksonVersion = "2.15.4" commonsIOVersion = '2.7' - commonsLang3Version = "3.1" + commonsLang3Version = '3.14.0' javapoetVersion = "1.7.0" picocliVersion = "3.6.0" nettySMSSLContextVersion = "1.5.2" toml4jVersion = "0.7.2" - bcprovJDK18onVersion = "1.76" - webankJavaCryptoVersion = "1.0.2" + bcprovJDK18onVersion = '1.77' + webankJavaCryptoVersion = '1.0.3' webankHsmCryptoVersion = "1.0.0-GMT0018" gsonVersion = '2.10.1' slf4jVersion = "1.7.36" @@ -193,7 +193,7 @@ dependencies { compile ("org.fisco-bcos:netty-sm-ssl-context:${nettySMSSLContextVersion}"){ exclude group: "org.bouncycastle" } - implementation ('io.netty:netty-all:4.1.100.Final') + compile ('io.netty:netty-all:4.1.100.Final') compile ("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}") compile ("commons-io:commons-io:${commonsIOVersion}") compile ("com.squareup:javapoet:${javapoetVersion}") diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/StaticArray.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/StaticArray.java index f20787225..096c3823a 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/StaticArray.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/datatypes/StaticArray.java @@ -29,7 +29,12 @@ public StaticArray(int expectedSize, T... values) { super( StructType.class.isAssignableFrom(values[0].getClass()) ? (Class) values[0].getClass() - : (Class) AbiTypes.getType(values[0].getTypeAsString()), + : Array.class.isAssignableFrom(values[0].getClass()) + ? (Class) + (values[0].dynamicType() + ? DynamicArray.class + : StaticArray.class) + : (Class) AbiTypes.getType(values[0].getTypeAsString()), values); this.expectedSize = expectedSize; isValid(); diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecObject.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecObject.java index 2c0197ddb..8a9a6b100 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecObject.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABICodecObject.java @@ -4,6 +4,7 @@ import java.math.BigInteger; import java.security.InvalidParameterException; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -11,12 +12,30 @@ import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; import org.fisco.bcos.sdk.abi.datatypes.Address; +import org.fisco.bcos.sdk.abi.datatypes.Array; import org.fisco.bcos.sdk.abi.datatypes.Bool; import org.fisco.bcos.sdk.abi.datatypes.Bytes; +import org.fisco.bcos.sdk.abi.datatypes.DynamicArray; import org.fisco.bcos.sdk.abi.datatypes.DynamicBytes; +import org.fisco.bcos.sdk.abi.datatypes.DynamicStruct; +import org.fisco.bcos.sdk.abi.datatypes.Int; +import org.fisco.bcos.sdk.abi.datatypes.StaticArray; +import org.fisco.bcos.sdk.abi.datatypes.StaticStruct; +import org.fisco.bcos.sdk.abi.datatypes.StructType; +import org.fisco.bcos.sdk.abi.datatypes.Uint; import org.fisco.bcos.sdk.abi.datatypes.Utf8String; +import org.fisco.bcos.sdk.abi.datatypes.generated.Int128; +import org.fisco.bcos.sdk.abi.datatypes.generated.Int16; import org.fisco.bcos.sdk.abi.datatypes.generated.Int256; +import org.fisco.bcos.sdk.abi.datatypes.generated.Int32; +import org.fisco.bcos.sdk.abi.datatypes.generated.Int64; +import org.fisco.bcos.sdk.abi.datatypes.generated.Int8; +import org.fisco.bcos.sdk.abi.datatypes.generated.Uint128; +import org.fisco.bcos.sdk.abi.datatypes.generated.Uint16; import org.fisco.bcos.sdk.abi.datatypes.generated.Uint256; +import org.fisco.bcos.sdk.abi.datatypes.generated.Uint32; +import org.fisco.bcos.sdk.abi.datatypes.generated.Uint64; +import org.fisco.bcos.sdk.abi.datatypes.generated.Uint8; import org.fisco.bcos.sdk.abi.wrapper.ABIObject.ListType; import org.fisco.bcos.sdk.utils.Numeric; import org.slf4j.Logger; @@ -50,11 +69,13 @@ public ABIObject encodeList(ABIObject template, Object value) { List list = new ArrayList(); if (value instanceof List) { list = (List) value; + } else if (value instanceof DynamicArray) { + list = (List) ((DynamicArray) value).getValue(); + } else if (value instanceof StaticArray) { + list = (List) ((StaticArray) value).getValue(); } else { Object[] objs = (Object[]) value; - for (Object obj : objs) { - list.add(obj); - } + Collections.addAll(list, objs); } if ((abiObject.getListType() == ListType.FIXED) && (list.size() != abiObject.getListLength())) { @@ -64,22 +85,22 @@ public ABIObject encodeList(ABIObject template, Object value) { String.valueOf(list.size())); } - for (int i = 0; i < list.size(); i++) { + for (Object o : list) { ABIObject nodeObject = abiObject.getListValueType().newObject(); switch (nodeObject.getType()) { case VALUE: { - nodeObject = encodeValue(nodeObject, list.get(i)); + nodeObject = encodeValue(nodeObject, o); break; } case STRUCT: { - nodeObject = encodeStruct(nodeObject, list.get(i)); + nodeObject = encodeStruct(nodeObject, o); break; } case LIST: { - nodeObject = encodeList(nodeObject, list.get(i)); + nodeObject = encodeList(nodeObject, o); break; } default: @@ -133,6 +154,40 @@ public ABIObject encodeStruct(ABIObject template, Object value) { } abiObject.getStructFields().set(i, nodeObject); } + } else if (StructType.class.isAssignableFrom(value.getClass())) { + // raw struct + Array array; + if (template.isDynamic()) { + array = (DynamicStruct) value; + } else { + array = (StaticStruct) value; + } + for (int i = 0; i < abiObject.getStructFields().size(); ++i) { + ABIObject nodeObject = abiObject.getStructFields().get(i); + switch (nodeObject.getType()) { + case VALUE: + { + nodeObject = encodeValue(nodeObject, array.getValue().get(i)); + break; + } + case STRUCT: + { + nodeObject = encodeStruct(nodeObject, array.getValue().get(i)); + break; + } + case LIST: + { + nodeObject = encodeList(nodeObject, array.getValue().get(i)); + break; + } + default: + { + throw new UnsupportedOperationException( + " Unsupported objectType: " + nodeObject.getType()); + } + } + abiObject.getStructFields().set(i, nodeObject); + } } else { Field[] fields = value.getClass().getDeclaredFields(); Map v = new HashMap<>(); @@ -187,6 +242,8 @@ public ABIObject encodeValue(ABIObject template, Object value) { { if (value instanceof Boolean) { abiObject.setBoolValue(new Bool((Boolean) value)); + } else if (value instanceof Bool) { + abiObject.setBoolValue((Bool) value); } else { errorReport( " valueType mismatch", @@ -197,38 +254,70 @@ public ABIObject encodeValue(ABIObject template, Object value) { } case UINT: { + BigInteger num = null; if (value instanceof BigInteger) { - abiObject.setNumericValue(new Uint256((BigInteger) value)); - } else if (NumberUtils.isNumber(value.toString())) { - abiObject.setNumericValue( - new Uint256((new BigInteger(value.toString())))); + num = (BigInteger) value; + } else if (Uint.class.isAssignableFrom(value.getClass())) { + num = ((Uint) value).getValue(); + } else if (NumberUtils.isCreatable(value.toString())) { + num = new BigInteger(value.toString()); } else { errorReport( " valueType mismatch", abiObject.getValueType().getClass().getName(), value.getClass().getName()); } + if (abiObject.getBytesLength() == 8) { + abiObject.setNumericValue(new Uint8(num)); + } else if (abiObject.getBytesLength() == 16) { + abiObject.setNumericValue(new Uint16(num)); + } else if (abiObject.getBytesLength() == 32) { + abiObject.setNumericValue(new Uint32(num)); + } else if (abiObject.getBytesLength() == 64) { + abiObject.setNumericValue(new Uint64(num)); + } else if (abiObject.getBytesLength() == 128) { + abiObject.setNumericValue(new Uint128(num)); + } else { + abiObject.setNumericValue(new Uint256(num)); + } break; } case INT: { + BigInteger num = null; if (value instanceof BigInteger) { - abiObject.setNumericValue(new Int256((BigInteger) value)); - } else if (NumberUtils.isNumber(value.toString())) { - abiObject.setNumericValue( - new Int256((new BigInteger(value.toString())))); + num = (BigInteger) value; + } else if (Int.class.isAssignableFrom(value.getClass())) { + num = ((Int) value).getValue(); + } else if (NumberUtils.isCreatable(value.toString())) { + num = new BigInteger(value.toString()); } else { errorReport( " valueType mismatch", abiObject.getValueType().getClass().getName(), value.getClass().getName()); } + if (abiObject.getBytesLength() == 8) { + abiObject.setNumericValue(new Int8(num)); + } else if (abiObject.getBytesLength() == 16) { + abiObject.setNumericValue(new Int16(num)); + } else if (abiObject.getBytesLength() == 32) { + abiObject.setNumericValue(new Int32(num)); + } else if (abiObject.getBytesLength() == 64) { + abiObject.setNumericValue(new Int64(num)); + } else if (abiObject.getBytesLength() == 128) { + abiObject.setNumericValue(new Int128(num)); + } else { + abiObject.setNumericValue(new Int256(num)); + } break; } case ADDRESS: { if (value instanceof String) { abiObject.setAddressValue(new Address((String) value)); + } else if (value instanceof Address) { + abiObject.setAddressValue((Address) value); } else { errorReport( " valueType mismatch", @@ -242,7 +331,8 @@ public ABIObject encodeValue(ABIObject template, Object value) { if (value instanceof byte[]) { byte[] bytesValue = (byte[]) value; abiObject.setBytesValue(new Bytes(bytesValue.length, bytesValue)); - + } else if (value instanceof Bytes) { + abiObject.setBytesValue((Bytes) value); } else { errorReport( " valueType mismatch", @@ -256,6 +346,8 @@ public ABIObject encodeValue(ABIObject template, Object value) { if (value instanceof byte[]) { byte[] bytesValue = (byte[]) value; abiObject.setDynamicBytesValue(new DynamicBytes(bytesValue)); + } else if (value instanceof DynamicBytes) { + abiObject.setDynamicBytesValue((DynamicBytes) value); } else { errorReport( " valueType mismatch", @@ -269,6 +361,8 @@ public ABIObject encodeValue(ABIObject template, Object value) { { if (value instanceof String) { abiObject.setStringValue(new Utf8String((String) value)); + } else if (value instanceof Utf8String) { + abiObject.setStringValue((Utf8String) value); } else { errorReport( " valueType mismatch", From 78c9e63fabc2f66752b97b510cd4605f7dd8b9a7 Mon Sep 17 00:00:00 2001 From: kyonRay Date: Wed, 6 Mar 2024 15:03:29 +0800 Subject: [PATCH 16/22] (CI): to fix macos ci. --- .ci/ci_check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/ci_check.sh b/.ci/ci_check.sh index 35ae21fa9..fee9c6cc4 100755 --- a/.ci/ci_check.sh +++ b/.ci/ci_check.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -tag="v2.9.1" +tag="v2.10.1" LOG_INFO() { local content=${1} echo -e "\033[32m ${content}\033[0m" From 9967005807661e752e9635693185dfa8de538bba Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:16:15 +0800 Subject: [PATCH 17/22] (build): upgrade dependencies for security issues. (#893) --- sdk-core/build.gradle | 7 ++++++- .../java/org/fisco/bcos/sdk/utils/SystemInformation.java | 2 +- sdk-crypto/build.gradle | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sdk-core/build.gradle b/sdk-core/build.gradle index 705eaaf1a..71f757618 100644 --- a/sdk-core/build.gradle +++ b/sdk-core/build.gradle @@ -4,9 +4,14 @@ plugins { } dependencies { compile ("org.apache.commons:commons-lang3:${commonsLang3Version}") - compile ("org.fisco-bcos:netty-sm-ssl-context:${nettySMSSLContextVersion}") + compile ("org.fisco-bcos:netty-sm-ssl-context:${nettySMSSLContextVersion}"){ + exclude group: "org.bouncycastle" + } + compile ("org.bouncycastle:bcprov-jdk18on:${bcprovJDK18onVersion}") + compile ('io.netty:netty-all:4.1.100.Final') compile ("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}") compile ("com.moandjiezana.toml:toml4j:${toml4jVersion}") + compile ("com.google.code.gson:gson:${gsonVersion}") } task sourcesJar(type: Jar) { from sourceSets.main.allJava diff --git a/sdk-core/src/main/java/org/fisco/bcos/sdk/utils/SystemInformation.java b/sdk-core/src/main/java/org/fisco/bcos/sdk/utils/SystemInformation.java index ba98d3695..95370f016 100644 --- a/sdk-core/src/main/java/org/fisco/bcos/sdk/utils/SystemInformation.java +++ b/sdk-core/src/main/java/org/fisco/bcos/sdk/utils/SystemInformation.java @@ -20,7 +20,7 @@ public class SystemInformation { // Note: must update the version if publish new-version - private static final String sdkVersion = "2.9.1"; + private static final String sdkVersion = "2.10.0"; public static final String connectionFaqIssueUrl = "https://github.com/FISCO-BCOS/java-sdk/issues/536"; public static final String connectionFaqDocUrl = diff --git a/sdk-crypto/build.gradle b/sdk-crypto/build.gradle index 7ee1f1720..6d1e6a038 100644 --- a/sdk-crypto/build.gradle +++ b/sdk-crypto/build.gradle @@ -6,7 +6,9 @@ dependencies { compile project(':sdk-core') compile ("org.bouncycastle:bcprov-jdk18on:${bcprovJDK18onVersion}") compile ("com.webank:webank-blockchain-java-crypto:${webankJavaCryptoVersion}") - compile ("com.webank:webank-blockchain-hsm-crypto:${webankHsmCryptoVersion}") + compile ("com.webank:webank-blockchain-hsm-crypto:${webankHsmCryptoVersion}"){ + exclude group: "junit", module: "junit" + } } task sourcesJar(type: Jar) { From 23559033548e1844b33f73c0f8a15c8be7f090c3 Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Wed, 6 Mar 2024 20:25:40 +0800 Subject: [PATCH 18/22] (abi,build): fix log security issues. (#895) --- build.gradle | 4 +++- .../sdk/abi/wrapper/ABIObjectFactory.java | 2 -- .../abi/wrapper/ContractABIDefinition.java | 23 ++++++++++++------- .../fisco/bcos/sdk/codegen/CodeGenUtils.java | 4 ++++ .../bcos/sdk/crypto/keystore/KeyTool.java | 9 ++++---- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index 90571ade9..7f3fb0996 100644 --- a/build.gradle +++ b/build.gradle @@ -203,7 +203,9 @@ dependencies { compile ("com.moandjiezana.toml:toml4j:${toml4jVersion}"){ exclude group: "com.google.code.gson" } - compile ("com.webank:webank-blockchain-hsm-crypto:${webankHsmCryptoVersion}") + compile ("com.webank:webank-blockchain-hsm-crypto:${webankHsmCryptoVersion}") { + exclude group: "junit", module: "junit" + } testCompile ("org.apache.commons:commons-collections4:${commonsCollections4Version}") testImplementation('io.netty:netty-all:4.1.100.Final') integrationTestImplementation('io.netty:netty-all:4.1.100.Final') diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABIObjectFactory.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABIObjectFactory.java index cf5ca2363..d6dffe2fb 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABIObjectFactory.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ABIObjectFactory.java @@ -29,8 +29,6 @@ private static ABIObject createObject( abiObject.getStructFields().add(buildTypeObject(namedType)); } - logger.info(" name: {}", name); - return abiObject; } catch (Exception e) { diff --git a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ContractABIDefinition.java b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ContractABIDefinition.java index 697fca2cc..b8cd9d9ba 100644 --- a/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ContractABIDefinition.java +++ b/sdk-abi/src/main/java/org/fisco/bcos/sdk/abi/wrapper/ContractABIDefinition.java @@ -75,7 +75,10 @@ public void addFunction(String name, ABIDefinition abiDefinition) { functions.put(name, new ArrayList<>()); abiDefinitions = functions.get(name); } else { - logger.info(" overload method ??? name: {}, abiDefinition: {}", name, abiDefinition); + if (logger.isTraceEnabled()) { + logger.trace( + " overload method ??? name: {}, abiDefinition: {}", name, abiDefinition); + } } abiDefinitions.add(abiDefinition); @@ -83,19 +86,23 @@ public void addFunction(String name, ABIDefinition abiDefinition) { String methodId = abiDefinition.getMethodId(cryptoSuite); methodIDToFunctions.put(methodId, abiDefinition); - logger.info( - " name: {}, methodId: {}, methodSignature: {}, abi: {}", - name, - methodId, - abiDefinition.getMethodSignatureAsString(), - abiDefinition); + if (logger.isTraceEnabled()) { + logger.trace( + " name: {}, methodId: {}, methodSignature: {}, abi: {}", + name, + methodId, + abiDefinition.getMethodSignatureAsString(), + abiDefinition); + } } public void addEvent(String name, ABIDefinition abiDefinition) { events.putIfAbsent(name, new ArrayList<>()); List abiDefinitions = events.get(name); abiDefinitions.add(abiDefinition); - logger.info(" name: {}, abi: {}", name, abiDefinition); + if (logger.isTraceEnabled()) { + logger.trace(" name: {}, abi: {}", name, abiDefinition); + } // calculate event topic and add abiDefinition to eventTopicToEvents String eventTopic = abiDefinition.getEventTopic(cryptoSuite); diff --git a/sdk-codegen/src/main/java/org/fisco/bcos/sdk/codegen/CodeGenUtils.java b/sdk-codegen/src/main/java/org/fisco/bcos/sdk/codegen/CodeGenUtils.java index ad8c49a17..75b893fad 100644 --- a/sdk-codegen/src/main/java/org/fisco/bcos/sdk/codegen/CodeGenUtils.java +++ b/sdk-codegen/src/main/java/org/fisco/bcos/sdk/codegen/CodeGenUtils.java @@ -77,6 +77,10 @@ public static List loadContractAbiDefinition(String abi) throws I public static byte[] readBytes(File file) throws CodeGenException, IOException { byte[] bytes = new byte[(int) file.length()]; FileInputStream fileInputStream = null; + if (!file.canRead() || file.getPath().contains("..")) { + throw new CodeGenException( + "file " + file + " is not readable or contains invalid characters"); + } try { fileInputStream = new FileInputStream(file); fileInputStream.read(bytes); diff --git a/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/KeyTool.java b/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/KeyTool.java index 9c954d14f..374303291 100644 --- a/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/KeyTool.java +++ b/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/KeyTool.java @@ -272,10 +272,11 @@ public static void storePublicKeyWithPem(PrivateKey privateKey, String privateKe public static void storePublicKeyWithPem(PublicKey publicKey, String privateKeyFilePath) throws IOException { String publicKeyPath = privateKeyFilePath + ".pub"; - PemWriter writer = new PemWriter(new FileWriter(publicKeyPath)); - writer.writeObject(new PemObject("PUBLIC KEY", publicKey.getEncoded())); - writer.flush(); - writer.close(); + publicKeyPath = publicKeyPath.replace("..", ""); + try (PemWriter writer = new PemWriter(new FileWriter(publicKeyPath))) { + writer.writeObject(new PemObject("PUBLIC KEY", publicKey.getEncoded())); + writer.flush(); + } } /** From c6ae6d6bea9a507b475c1a1eb4678c3ed4f0ccd5 Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Fri, 8 Mar 2024 14:34:38 +0800 Subject: [PATCH 19/22] (project): update 2.10.0 changelog. (#896) * (crypto): add safe key store path. * (project): update 2.10.0 changelog. --- Changelog.md | 26 +++++++++++++++++++ build.gradle | 2 +- .../bcos/sdk/config/model/ConfigProperty.java | 1 + .../bcos/sdk/crypto/keystore/KeyTool.java | 3 ++- .../bcos/sdk/crypto/keystore/P12KeyStore.java | 1 + .../bcos/sdk/crypto/keystore/PEMKeyStore.java | 1 + 6 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 4f9697c31..bbb8a6e5c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,29 @@ +## v2.10.0 + +(2024-03-08) + +请参考文档: + +* [英文版用户手册](https://fisco-bcos-documentation.readthedocs.io/en/latest/docs/sdk/java_sdk/index.html) +* [中文版用户手册](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/sdk/java_sdk/index.html#) +* [中文版WIKI](https://github.com/FISCO-BCOS/java-sdk/wiki) + +修复: + +- 解决在使用Solidity复杂数据结构(如struct,二维数组等)、复杂事件场景(如重载event,有复杂数据结构参数)时,Java SDK在发交易/调用请求时出现的编解码错误; +- 修复了读取密钥时可能存在的安全问题; + +更新: + +- 废弃 `sdk-codegen` 模块,合约生成Java文件的功能建议开发者使用`org.fisco-bcos.code-generator:bcos-code-generator`中的方法。以解决在使用Solidity复杂数据结构、复杂事件场景时,生成的Java文件出现编译、运行错误的问题; +- 依赖变更: + - `org.apache.commons:commons-lang3` 更新到3.14.0版本 + - `org.bouncycastle:bcprov-jdk15on` 变更为使用`org.bouncycastle:bcprov-jdk18on:1.77`版本 + - `io.netty:netty-all` 更新到 4.1.100.Final版本 + - `com.google.code.gson:gson` 更新到 2.10.1版本 + - `com.webank:webank-blockchain-java-crypto` 更新到1.0.3版本 + - 删除不必要的`com.google.guava:guava` + ## v2.9.2 (2022-10-31) diff --git a/build.gradle b/build.gradle index 7f3fb0996..fc476b823 100644 --- a/build.gradle +++ b/build.gradle @@ -35,7 +35,7 @@ ext { // integrationTest.mustRunAfter test allprojects { group = 'org.fisco-bcos.java-sdk' - version = '2.10.0-SNAPSHOT' + version = '2.10.0' apply plugin: 'maven' apply plugin: 'maven-publish' apply plugin: 'idea' diff --git a/sdk-core/src/main/java/org/fisco/bcos/sdk/config/model/ConfigProperty.java b/sdk-core/src/main/java/org/fisco/bcos/sdk/config/model/ConfigProperty.java index 53f33f778..f8f440e1a 100644 --- a/sdk-core/src/main/java/org/fisco/bcos/sdk/config/model/ConfigProperty.java +++ b/sdk-core/src/main/java/org/fisco/bcos/sdk/config/model/ConfigProperty.java @@ -105,6 +105,7 @@ public static InputStream getConfigInputStream(String configFilePath) throws Con } InputStream inputStream = null; try { + configFilePath = configFilePath.replace("..", ""); inputStream = new FileInputStream(configFilePath); if (inputStream != null) { return inputStream; diff --git a/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/KeyTool.java b/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/KeyTool.java index 374303291..9ee5bd375 100644 --- a/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/KeyTool.java +++ b/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/KeyTool.java @@ -289,7 +289,8 @@ public static void storePublicKeyWithPem(PublicKey publicKey, String privateKeyF /** load information from the keyStoreFile */ protected void load() { try { - InputStream keyStoreFileInputStream = new FileInputStream(keyStoreFile); + String safeFile = keyStoreFile.replace("..", ""); + InputStream keyStoreFileInputStream = new FileInputStream(safeFile); this.load(keyStoreFileInputStream); } catch (FileNotFoundException | org.bouncycastle.util.encoders.DecoderException e) { String errorMessage = diff --git a/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/P12KeyStore.java b/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/P12KeyStore.java index 6b31978b5..5d5c12b72 100644 --- a/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/P12KeyStore.java +++ b/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/P12KeyStore.java @@ -150,6 +150,7 @@ public static void storeKeyPairWithP12Format( Certificate[] certChain = new Certificate[1]; certChain[0] = generateSelfSignedCertificate(keyPair, signatureAlgorithm); keyStore.setKeyEntry(NAME, privateKey, password.toCharArray(), certChain); + privateKeyFilePath = privateKeyFilePath.replace("..", ""); keyStore.store(new FileOutputStream(privateKeyFilePath), password.toCharArray()); // store the public key storePublicKeyWithPem(privateKey, privateKeyFilePath); diff --git a/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/PEMKeyStore.java b/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/PEMKeyStore.java index 89c6c99b8..e1ffb831c 100644 --- a/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/PEMKeyStore.java +++ b/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/PEMKeyStore.java @@ -69,6 +69,7 @@ public static void storeKeyPairWithPemFormat( try { KeyPair keyPair = convertHexedStringToKeyPair(hexedPrivateKey, curveName); // save the private key + privateKeyFilePath = privateKeyFilePath.replace("..", ""); PemWriter writer = new PemWriter(new FileWriter(privateKeyFilePath)); BCECPrivateKey bcecPrivateKey = (BCECPrivateKey) (keyPair.getPrivate()); writer.writeObject(new PemObject(PRIVATE_KEY, bcecPrivateKey.getEncoded())); From ce923a3a1a831a9573c2188320b6fd1848ce5e60 Mon Sep 17 00:00:00 2001 From: ywy2090 <912554887@qq.com> Date: Thu, 18 Apr 2024 16:22:28 +0800 Subject: [PATCH 20/22] load sm context builder from class loader (#914) * load sm context builder from class loader * fix load cert by relative path failed bug --- build.gradle | 2 +- .../bcos/sdk/config/model/ConfigProperty.java | 2 +- .../bcos/sdk/network/ConnectionManager.java | 91 +---------- .../sdk/network/SslContextInitializer.java | 142 ++++++++++++++++++ 4 files changed, 149 insertions(+), 88 deletions(-) create mode 100644 sdk-core/src/main/java/org/fisco/bcos/sdk/network/SslContextInitializer.java diff --git a/build.gradle b/build.gradle index fc476b823..5a558ab47 100644 --- a/build.gradle +++ b/build.gradle @@ -35,7 +35,7 @@ ext { // integrationTest.mustRunAfter test allprojects { group = 'org.fisco-bcos.java-sdk' - version = '2.10.0' + version = '2.10.1-SNAPSHOT' apply plugin: 'maven' apply plugin: 'maven-publish' apply plugin: 'idea' diff --git a/sdk-core/src/main/java/org/fisco/bcos/sdk/config/model/ConfigProperty.java b/sdk-core/src/main/java/org/fisco/bcos/sdk/config/model/ConfigProperty.java index f8f440e1a..206d4a8bc 100644 --- a/sdk-core/src/main/java/org/fisco/bcos/sdk/config/model/ConfigProperty.java +++ b/sdk-core/src/main/java/org/fisco/bcos/sdk/config/model/ConfigProperty.java @@ -105,7 +105,7 @@ public static InputStream getConfigInputStream(String configFilePath) throws Con } InputStream inputStream = null; try { - configFilePath = configFilePath.replace("..", ""); + // configFilePath = configFilePath.replace("..", ""); inputStream = new FileInputStream(configFilePath); if (inputStream != null) { return inputStream; diff --git a/sdk-core/src/main/java/org/fisco/bcos/sdk/network/ConnectionManager.java b/sdk-core/src/main/java/org/fisco/bcos/sdk/network/ConnectionManager.java index 69e5d84fb..14c8c2c22 100644 --- a/sdk-core/src/main/java/org/fisco/bcos/sdk/network/ConnectionManager.java +++ b/sdk-core/src/main/java/org/fisco/bcos/sdk/network/ConnectionManager.java @@ -28,16 +28,11 @@ import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.codec.LengthFieldBasedFrameDecoder; -import io.netty.handler.ssl.SMSslClientContextFactory; import io.netty.handler.ssl.SslContext; -import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.SslHandler; -import io.netty.handler.ssl.SslProvider; import io.netty.handler.timeout.IdleStateHandler; import io.netty.util.concurrent.Future; -import java.io.IOException; import java.nio.channels.ClosedChannelException; -import java.security.Security; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -70,6 +65,9 @@ public class ConnectionManager { private EventLoopGroup workerGroup; private Boolean running = false; private Bootstrap bootstrap = new Bootstrap(); + + private SslContextInitializer sslContextInitializer = new SslContextInitializer(); + private List connChannelFuture = new ArrayList(); private ScheduledExecutorService reconnSchedule = new ScheduledThreadPoolExecutor(1); private int cryptoType; @@ -228,85 +226,6 @@ public ChannelHandlerContext getConnectionCtx(String peer) { return availableConnections.get(peer); } - private SslContext initSslContext(ConfigOption configOption) throws NetworkException { - try { - Security.setProperty("jdk.disabled.namedCurves", ""); - System.setProperty("jdk.sunec.disableNative", "false"); - - // Get file, file existence is already checked when check config file. - // Init SslContext - logger.info(" build ECDSA ssl context with configured certificates "); - SslContext sslCtx = - SslContextBuilder.forClient() - .trustManager(configOption.getCryptoMaterialConfig().getCaInputStream()) - .keyManager( - configOption.getCryptoMaterialConfig().getSdkCertInputStream(), - configOption - .getCryptoMaterialConfig() - .getSdkPrivateKeyInputStream()) - .sslProvider(SslProvider.OPENSSL) - // .sslProvider(SslProvider.JDK) - .build(); - return sslCtx; - } catch (IOException e) { - logger.error( - "initSslContext failed, caCert: {}, sslCert: {}, sslKey: {}, error: {}, e: {}", - configOption.getCryptoMaterialConfig().getCaCertPath(), - configOption.getCryptoMaterialConfig().getSdkCertPath(), - configOption.getCryptoMaterialConfig().getSdkPrivateKeyPath(), - e.getMessage(), - e); - throw new NetworkException( - "SSL context init failed, please make sure your cert and key files are properly configured. error info: " - + e.getMessage(), - NetworkException.INIT_CONTEXT_FAILED); - } catch (IllegalArgumentException e) { - logger.error("initSslContext failed, error: {}, e: {}", e.getMessage(), e); - throw new NetworkException( - "SSL context init failed, error info: " + e.getMessage(), - NetworkException.INIT_CONTEXT_FAILED); - } - } - - private SslContext initSMSslContext(ConfigOption configOption) throws NetworkException { - try { - // Get file, file existence is already checked when check config file. - // Init SslContext - return SMSslClientContextFactory.build( - configOption.getCryptoMaterialConfig().getCaInputStream(), - configOption.getCryptoMaterialConfig().getEnSSLCertInputStream(), - configOption.getCryptoMaterialConfig().getEnSSLPrivateKeyInputStream(), - configOption.getCryptoMaterialConfig().getSdkCertInputStream(), - configOption.getCryptoMaterialConfig().getSdkPrivateKeyInputStream()); - } catch (Exception e) { - if (configOption.getCryptoMaterialConfig().getCryptoProvider().equalsIgnoreCase(HSM)) { - logger.error( - "initSMSslContext failed, caCert:{}, sslCert: {}, sslKeyIndex: {}, enCert: {}, enSslKeyIndex: {}, error: {}, e: {}", - configOption.getCryptoMaterialConfig().getCaCertPath(), - configOption.getCryptoMaterialConfig().getSdkCertPath(), - configOption.getCryptoMaterialConfig().getSslKeyIndex(), - configOption.getCryptoMaterialConfig().getEnSSLCertPath(), - configOption.getCryptoMaterialConfig().getEnSslKeyIndex(), - e.getMessage(), - e); - } else { - logger.error( - "initSMSslContext failed, caCert:{}, sslCert: {}, sslKey: {}, enCert: {}, enSslKey: {}, error: {}, e: {}", - configOption.getCryptoMaterialConfig().getCaCertPath(), - configOption.getCryptoMaterialConfig().getSdkCertPath(), - configOption.getCryptoMaterialConfig().getSdkPrivateKeyPath(), - configOption.getCryptoMaterialConfig().getEnSSLCertPath(), - configOption.getCryptoMaterialConfig().getEnSSLPrivateKeyPath(), - e.getMessage(), - e); - } - throw new NetworkException( - "SSL context init failed, please make sure your cert and key files are properly configured. error info: " - + e.getMessage(), - e); - } - } - private void initNetty(ConfigOption configOption) throws NetworkException { workerGroup = new NioEventLoopGroup(); bootstrap.group(workerGroup); @@ -324,8 +243,8 @@ private void initNetty(ConfigOption configOption) throws NetworkException { } sslContext = (sslCryptoType == CryptoType.ECDSA_TYPE - ? initSslContext(configOption) - : initSMSslContext(configOption)); + ? sslContextInitializer.initSslContext(configOption) + : sslContextInitializer.initSMSslContext(configOption)); SslContext finalSslContext = sslContext; ChannelInitializer initializer = new ChannelInitializer() { diff --git a/sdk-core/src/main/java/org/fisco/bcos/sdk/network/SslContextInitializer.java b/sdk-core/src/main/java/org/fisco/bcos/sdk/network/SslContextInitializer.java new file mode 100644 index 000000000..56e34a47a --- /dev/null +++ b/sdk-core/src/main/java/org/fisco/bcos/sdk/network/SslContextInitializer.java @@ -0,0 +1,142 @@ +package org.fisco.bcos.sdk.network; + +import static org.fisco.bcos.sdk.model.CryptoProviderType.HSM; + +import io.netty.handler.ssl.SslContext; +import io.netty.handler.ssl.SslContextBuilder; +import io.netty.handler.ssl.SslProvider; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Method; +import java.security.Security; +import org.fisco.bcos.sdk.config.ConfigOption; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class SslContextInitializer { + + private static Logger logger = LoggerFactory.getLogger(SslContextInitializer.class); + + private static boolean enableNettyOpenSSLProvider = false; + + static { + String property = System.getProperty("fisco.netty.enable.openssl.provider"); + if (property != null) { + enableNettyOpenSSLProvider = Boolean.valueOf(property); + logger.info("load `fisco.netty.enable.openssl.provider` value: {}", property); + } + } + + public SslContext initSslContext(ConfigOption configOption) throws NetworkException { + try { + Security.setProperty("jdk.disabled.namedCurves", ""); + System.setProperty("jdk.sunec.disableNative", "false"); + + // Get file, file existence is already checked when check config file. + // Init SslContext + logger.info(" build ECDSA ssl context with configured certificates "); + + SslProvider sslProvider = SslProvider.JDK; + if (enableNettyOpenSSLProvider) { + sslProvider = SslProvider.OPENSSL; + } + + logger.info("sslProvider: {}", sslProvider); + + SslContext sslCtx = + SslContextBuilder.forClient() + .trustManager(configOption.getCryptoMaterialConfig().getCaInputStream()) + .keyManager( + configOption.getCryptoMaterialConfig().getSdkCertInputStream(), + configOption + .getCryptoMaterialConfig() + .getSdkPrivateKeyInputStream()) + // .sslProvider(SslProvider.OPENSSL) + .sslProvider(sslProvider) + .build(); + return sslCtx; + } catch (IOException e) { + logger.error( + "initSslContext failed, caCert: {}, sslCert: {}, sslKey: {}, error: {}, e: {}", + configOption.getCryptoMaterialConfig().getCaCertPath(), + configOption.getCryptoMaterialConfig().getSdkCertPath(), + configOption.getCryptoMaterialConfig().getSdkPrivateKeyPath(), + e.getMessage(), + e); + throw new NetworkException( + "SSL context init failed, please make sure your cert and key files are properly configured. error info: " + + e.getMessage(), + NetworkException.INIT_CONTEXT_FAILED); + } catch (IllegalArgumentException e) { + logger.error("initSslContext failed, error: {}, e: {}", e.getMessage(), e); + throw new NetworkException( + "SSL context init failed, error info: " + e.getMessage(), + NetworkException.INIT_CONTEXT_FAILED); + } + } + + public SslContext initSMSslContext(ConfigOption configOption) throws NetworkException { + try { + // Get file, file existence is already checked when check config file. + InputStream caInputStream = configOption.getCryptoMaterialConfig().getCaInputStream(); + InputStream enSSLCertInputStream = + configOption.getCryptoMaterialConfig().getEnSSLCertInputStream(); + InputStream enSSLPrivateKeyInputStream = + configOption.getCryptoMaterialConfig().getEnSSLPrivateKeyInputStream(); + InputStream sdkCertInputStream = + configOption.getCryptoMaterialConfig().getSdkCertInputStream(); + InputStream sdkPrivateKeyInputStream = + configOption.getCryptoMaterialConfig().getSdkPrivateKeyInputStream(); + + String smContextFactoryClassName = "io.netty.handler.ssl.SMSslClientContextFactory"; + + Class smContextFactoryClass = Class.forName(smContextFactoryClassName); + logger.info("加载类`{}`成功", smContextFactoryClassName); + Method buildMethod = + smContextFactoryClass.getMethod( + "build", + InputStream.class, + InputStream.class, + InputStream.class, + InputStream.class, + InputStream.class); + SslContext sslContext = + (SslContext) + buildMethod.invoke( + null, + caInputStream, + enSSLCertInputStream, + enSSLPrivateKeyInputStream, + sdkCertInputStream, + sdkPrivateKeyInputStream); + + return sslContext; + } catch (Exception e) { + if (configOption.getCryptoMaterialConfig().getCryptoProvider().equalsIgnoreCase(HSM)) { + logger.error( + "initSMSslContext failed, caCert:{}, sslCert: {}, sslKeyIndex: {}, enCert: {}, enSslKeyIndex: {}, error: {}, e: {}", + configOption.getCryptoMaterialConfig().getCaCertPath(), + configOption.getCryptoMaterialConfig().getSdkCertPath(), + configOption.getCryptoMaterialConfig().getSslKeyIndex(), + configOption.getCryptoMaterialConfig().getEnSSLCertPath(), + configOption.getCryptoMaterialConfig().getEnSslKeyIndex(), + e.getMessage(), + e); + } else { + logger.error( + "initSMSslContext failed, caCert:{}, sslCert: {}, sslKey: {}, enCert: {}, enSslKey: {}, error: {}, e: {}", + configOption.getCryptoMaterialConfig().getCaCertPath(), + configOption.getCryptoMaterialConfig().getSdkCertPath(), + configOption.getCryptoMaterialConfig().getSdkPrivateKeyPath(), + configOption.getCryptoMaterialConfig().getEnSSLCertPath(), + configOption.getCryptoMaterialConfig().getEnSSLPrivateKeyPath(), + e.getMessage(), + e); + } + throw new NetworkException( + "SSL context init failed, please make sure your cert and key files are properly configured. error info: " + + e.getMessage(), + e); + } + } +} From bb06a4b6c2500ecde494c399fe4c821e9925fb35 Mon Sep 17 00:00:00 2001 From: Kyon <32325790+kyonRay@users.noreply.github.com> Date: Tue, 23 Apr 2024 09:55:31 +0800 Subject: [PATCH 21/22] (crypto,core): fix read relative path file bug. (#915) --- .../main/java/org/fisco/bcos/sdk/codegen/CodeGenUtils.java | 2 +- .../java/org/fisco/bcos/sdk/config/model/ConfigProperty.java | 1 - .../main/java/org/fisco/bcos/sdk/crypto/keystore/KeyTool.java | 4 +--- .../java/org/fisco/bcos/sdk/crypto/keystore/P12KeyStore.java | 1 - .../java/org/fisco/bcos/sdk/crypto/keystore/PEMKeyStore.java | 1 - 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/sdk-codegen/src/main/java/org/fisco/bcos/sdk/codegen/CodeGenUtils.java b/sdk-codegen/src/main/java/org/fisco/bcos/sdk/codegen/CodeGenUtils.java index 75b893fad..84e3dce20 100644 --- a/sdk-codegen/src/main/java/org/fisco/bcos/sdk/codegen/CodeGenUtils.java +++ b/sdk-codegen/src/main/java/org/fisco/bcos/sdk/codegen/CodeGenUtils.java @@ -77,7 +77,7 @@ public static List loadContractAbiDefinition(String abi) throws I public static byte[] readBytes(File file) throws CodeGenException, IOException { byte[] bytes = new byte[(int) file.length()]; FileInputStream fileInputStream = null; - if (!file.canRead() || file.getPath().contains("..")) { + if (!file.canRead()) { throw new CodeGenException( "file " + file + " is not readable or contains invalid characters"); } diff --git a/sdk-core/src/main/java/org/fisco/bcos/sdk/config/model/ConfigProperty.java b/sdk-core/src/main/java/org/fisco/bcos/sdk/config/model/ConfigProperty.java index 206d4a8bc..53f33f778 100644 --- a/sdk-core/src/main/java/org/fisco/bcos/sdk/config/model/ConfigProperty.java +++ b/sdk-core/src/main/java/org/fisco/bcos/sdk/config/model/ConfigProperty.java @@ -105,7 +105,6 @@ public static InputStream getConfigInputStream(String configFilePath) throws Con } InputStream inputStream = null; try { - // configFilePath = configFilePath.replace("..", ""); inputStream = new FileInputStream(configFilePath); if (inputStream != null) { return inputStream; diff --git a/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/KeyTool.java b/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/KeyTool.java index 9ee5bd375..1b22715d7 100644 --- a/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/KeyTool.java +++ b/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/KeyTool.java @@ -272,7 +272,6 @@ public static void storePublicKeyWithPem(PrivateKey privateKey, String privateKe public static void storePublicKeyWithPem(PublicKey publicKey, String privateKeyFilePath) throws IOException { String publicKeyPath = privateKeyFilePath + ".pub"; - publicKeyPath = publicKeyPath.replace("..", ""); try (PemWriter writer = new PemWriter(new FileWriter(publicKeyPath))) { writer.writeObject(new PemObject("PUBLIC KEY", publicKey.getEncoded())); writer.flush(); @@ -289,8 +288,7 @@ public static void storePublicKeyWithPem(PublicKey publicKey, String privateKeyF /** load information from the keyStoreFile */ protected void load() { try { - String safeFile = keyStoreFile.replace("..", ""); - InputStream keyStoreFileInputStream = new FileInputStream(safeFile); + InputStream keyStoreFileInputStream = new FileInputStream(keyStoreFile); this.load(keyStoreFileInputStream); } catch (FileNotFoundException | org.bouncycastle.util.encoders.DecoderException e) { String errorMessage = diff --git a/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/P12KeyStore.java b/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/P12KeyStore.java index 5d5c12b72..6b31978b5 100644 --- a/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/P12KeyStore.java +++ b/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/P12KeyStore.java @@ -150,7 +150,6 @@ public static void storeKeyPairWithP12Format( Certificate[] certChain = new Certificate[1]; certChain[0] = generateSelfSignedCertificate(keyPair, signatureAlgorithm); keyStore.setKeyEntry(NAME, privateKey, password.toCharArray(), certChain); - privateKeyFilePath = privateKeyFilePath.replace("..", ""); keyStore.store(new FileOutputStream(privateKeyFilePath), password.toCharArray()); // store the public key storePublicKeyWithPem(privateKey, privateKeyFilePath); diff --git a/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/PEMKeyStore.java b/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/PEMKeyStore.java index e1ffb831c..89c6c99b8 100644 --- a/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/PEMKeyStore.java +++ b/sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/keystore/PEMKeyStore.java @@ -69,7 +69,6 @@ public static void storeKeyPairWithPemFormat( try { KeyPair keyPair = convertHexedStringToKeyPair(hexedPrivateKey, curveName); // save the private key - privateKeyFilePath = privateKeyFilePath.replace("..", ""); PemWriter writer = new PemWriter(new FileWriter(privateKeyFilePath)); BCECPrivateKey bcecPrivateKey = (BCECPrivateKey) (keyPair.getPrivate()); writer.writeObject(new PemObject(PRIVATE_KEY, bcecPrivateKey.getEncoded())); From b2d7b2f7cdb0f6f80d8c9baf603717079be07159 Mon Sep 17 00:00:00 2001 From: kyonRay Date: Thu, 25 Apr 2024 14:22:38 +0800 Subject: [PATCH 22/22] (changelog): add change log of 2.10.1. --- Changelog.md | 23 +++++++++++++++++++ .../bcos/sdk/utils/SystemInformation.java | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index bbb8a6e5c..5f37ad1b9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,26 @@ +## v2.10.1 + +(2024-04-25) + +请参考文档: + +* [英文版用户手册](https://fisco-bcos-documentation.readthedocs.io/en/latest/docs/sdk/java_sdk/index.html) +* [中文版用户手册](https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/sdk/java_sdk/index.html#) +* [中文版WIKI](https://github.com/FISCO-BCOS/java-sdk/wiki) + +新增: + +- 新增启动配置fisco.netty.enable.openssl.provider,置为true时使用openssl provider,置为false时使用JDK provider。 + +更新: + +- Java SDK不再强依赖tcnative,解决在部分环境下无法加载tcnative的问题。 +- 非国密环境下默认采用JDK的provider模式建立ssl连接。需要能提供给更高性能的openssl provider时,可以通过开关切换。 + +修复: + +- 修复部分场景不能配置相对路径的问题。 + ## v2.10.0 (2024-03-08) diff --git a/sdk-core/src/main/java/org/fisco/bcos/sdk/utils/SystemInformation.java b/sdk-core/src/main/java/org/fisco/bcos/sdk/utils/SystemInformation.java index 95370f016..56146d944 100644 --- a/sdk-core/src/main/java/org/fisco/bcos/sdk/utils/SystemInformation.java +++ b/sdk-core/src/main/java/org/fisco/bcos/sdk/utils/SystemInformation.java @@ -20,7 +20,7 @@ public class SystemInformation { // Note: must update the version if publish new-version - private static final String sdkVersion = "2.10.0"; + private static final String sdkVersion = "2.10.1"; public static final String connectionFaqIssueUrl = "https://github.com/FISCO-BCOS/java-sdk/issues/536"; public static final String connectionFaqDocUrl =