diff --git a/.ci/ci_check.sh b/.ci/ci_check.sh index 42efcdb8..24a0c824 100755 --- a/.ci/ci_check.sh +++ b/.ci/ci_check.sh @@ -177,9 +177,9 @@ java -version #cp src/integration-test/resources/config-example.toml src/integration-test/resources/config.toml download_tassl -LOG_INFO "------ download_binary: v3.4.0---------" -download_binary "v3.4.0" -download_build_chain "v3.4.0" +LOG_INFO "------ download_binary: v3.11.0---------" +download_binary "v3.11.0" +download_build_chain "v3.11.0" LOG_INFO "------ check_standard_node---------" check_standard_node false LOG_INFO "------ check_sm_node---------" @@ -187,30 +187,16 @@ check_sm_node true LOG_INFO "------ check_basic---------" check_basic -LOG_INFO "------ download_binary: v3.3.0---------" -download_binary "v3.3.0" -download_build_chain "v3.3.0" +LOG_INFO "------ download_binary: v3.7.3---------" +download_binary "v3.7.3" +download_build_chain "v3.7.3" LOG_INFO "------ check_standard_node---------" check_standard_node rm -rf ./bin -LOG_INFO "------ download_binary: v3.2.0---------" -download_binary "v3.2.0" -download_build_chain "v3.2.0" -LOG_INFO "------ check_standard_node---------" -check_standard_node -s -rm -rf ./bin - -LOG_INFO "------ download_binary: v3.1.0---------" -download_binary "v3.1.0" -download_build_chain "v3.1.0" -LOG_INFO "------ check_standard_node---------" -check_standard_node -s -rm -rf ./bin - -LOG_INFO "------ download_binary: v3.0.0---------" -download_binary "v3.0.0" -download_build_chain "v3.0.0" +LOG_INFO "------ download_binary: v3.2.6---------" +download_binary "v3.2.6" +download_build_chain "v3.2.6" LOG_INFO "------ check_standard_node---------" check_standard_node -s rm -rf ./bin \ No newline at end of file diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 8ac222c3..0b15ca70 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04, windows-2019, macos-latest] + os: [ubuntu-20.04, ubuntu-22.04, windows-2019, macos-12] steps: - uses: actions/checkout@v2 with: diff --git a/build.gradle b/build.gradle index 4e0d5d92..5b6931c7 100644 --- a/build.gradle +++ b/build.gradle @@ -40,9 +40,9 @@ dependencies { //implementation 'org.fisco-bcos:solcJ:0.4.25.1' //implementation 'org.fisco-bcos:solcJ:0.6.10.1' //implementation 'org.fisco-bcos:solcJ:0.5.2.1' - implementation 'org.fisco-bcos:solcJ:1.0.0-SNAPSHOT' + implementation 'org.fisco-bcos:solcJ:1.0.0' - implementation ('org.fisco-bcos.java-sdk:fisco-bcos-java-sdk:3.8.0-SNAPSHOT') { + implementation ('org.fisco-bcos.java-sdk:fisco-bcos-java-sdk:3.8.0') { exclude group: "org.slf4j" } @@ -53,7 +53,7 @@ dependencies { implementation('org.jline:jline:3.21.0') implementation('io.bretty:console-table-builder:1.2') implementation('com.github.jsqlparser:jsqlparser:2.0') - implementation('org.fisco-bcos.code-generator:bcos-code-generator:1.6.0-SNAPSHOT') { + implementation('org.fisco-bcos.code-generator:bcos-code-generator:1.6.0') { exclude group: "org.fisco-bcos.java-sdk" exclude group: "org.slf4j" } diff --git a/src/main/java/console/contract/utils/ContractCompiler.java b/src/main/java/console/contract/utils/ContractCompiler.java index b11f4aa9..72424a43 100644 --- a/src/main/java/console/contract/utils/ContractCompiler.java +++ b/src/main/java/console/contract/utils/ContractCompiler.java @@ -246,7 +246,7 @@ public static AbiAndBin compileSolToBinAndAbi( String bin = sm ? "" : meta.bin; String smBin = sm ? meta.bin : ""; - String abi = mergeAbi(result); + String abi = mergeAbi(contractName, result); AbiAndBin abiAndBin = new AbiAndBin(abi, bin, smBin, meta.devdoc); // evm static analysis @@ -350,7 +350,8 @@ public static String mergeSource(String currentDir, String sourceFile, Set contractNames = result.getContractKeys(); if (contractNames.isEmpty()) { @@ -358,11 +359,25 @@ public static String mergeAbi(CompilationResult result) throws JsonProcessingExc } ObjectReader objectReader = ObjectMapperFactory.getObjectReader(); ArrayNode mainNode = (ArrayNode) objectReader.createArrayNode(); + CompilationResult.ContractMetadata main = result.getContract(mainContract); + mainNode.addAll((ArrayNode) objectReader.readTree(main.abi)); + for (String contractName : contractNames) { String key = contractName.substring(contractName.lastIndexOf(':') + 1); - JsonNode jsonNode = objectReader.readTree(result.getContract(key).abi); + if (key.equals(mainContract)) { + continue; + } + + CompilationResult.ContractMetadata contract = result.getContract(key); + JsonNode jsonNode = objectReader.readTree(contract.abi); if (jsonNode.isArray() && !jsonNode.isEmpty()) { - mainNode.addAll((ArrayNode) jsonNode); + ArrayNode arrayNode = (ArrayNode) jsonNode; + for (JsonNode node : arrayNode) { + if (node.has("type") && node.get("type").asText().equals("constructor")) { + } else { + mainNode.add(node); + } + } } } return mainNode.toString();