Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/release-3.9.0' into addTermWeight
Browse files Browse the repository at this point in the history
  • Loading branch information
morebtcg committed Oct 9, 2024
2 parents 5002969 + fc2a37b commit beae000
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 33 deletions.
32 changes: 9 additions & 23 deletions .ci/ci_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,40 +177,26 @@ 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---------"
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
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ 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.9.0-SNAPSHOT') {
exclude group: "org.slf4j"
Expand All @@ -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"
}
Expand Down
23 changes: 19 additions & 4 deletions src/main/java/console/contract/utils/ContractCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -350,19 +350,34 @@ public static String mergeSource(String currentDir, String sourceFile, Set<Strin
return sourceBuffer.toString();
}

public static String mergeAbi(CompilationResult result) throws JsonProcessingException {
public static String mergeAbi(String mainContract, CompilationResult result)
throws JsonProcessingException {

List<String> contractNames = result.getContractKeys();
if (contractNames.isEmpty()) {
return null;
}
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();
Expand Down
4 changes: 2 additions & 2 deletions tools/download_console.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ check_params()
download_console(){
check_params
git_download_link=https://github.com/FISCO-BCOS/console/releases/download/v${download_version}/${package_name}
download_link=https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/FISCO-BCOS/console/releases/v${download_version}/${package_name}
download_link=https://github.com/FISCO-BCOS/console/releases/v${download_version}/${package_name}

if [ $(curl -IL -o /dev/null -s -w %{http_code} "${download_link}") == 200 ];then
LOG_INFO "Downloading console ${download_version} from ${download_link}"
Expand All @@ -107,7 +107,7 @@ download_console(){
download_solcJ(){
check_params
git_download_link=https://github.com/FISCO-BCOS/console/releases/download/v${solc_download_version}/${solcj_name}
download_link=https://osp-1257653870.cos.ap-guangzhou.myqcloud.com/FISCO-BCOS/console/releases/v${solc_download_version}/${solcj_name}
download_link=https://github.com/FISCO-BCOS/console/releases/v${solc_download_version}/${solcj_name}

if [ $(curl -IL -o /dev/null -s -w %{http_code} "${download_link}") == 200 ];then
LOG_INFO "Downloading solcJ ${solcj_name} from ${download_link}"
Expand Down
2 changes: 1 addition & 1 deletion tools/get_gm_account.sh

Large diffs are not rendered by default.

0 comments on commit beae000

Please sign in to comment.