Skip to content

Commit

Permalink
<fix>(auth,precompiled): add tree and getProposalList range limit log…
Browse files Browse the repository at this point in the history
…ic, update version. (#811)
  • Loading branch information
kyonRay authored Dec 28, 2023
1 parent 177bb39 commit 4ff5033
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion release_note.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.5.0
v3.6.0
4 changes: 2 additions & 2 deletions src/main/java/console/ConsoleInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,12 @@ private AccountInfo loadAccount(BcosSDK bcosSDK, String[] params) {
System.out.println("Invalid param " + params[1] + ", must be -pem or -p12");
System.exit(0);
}
if (params[1].compareToIgnoreCase("-pem") == 0 && params.length != 3) {
if (params[1].compareToIgnoreCase("-pem") == 0 && params.length < 3) {
System.out.println(
"Load account from the pem file failed! Please specified the pem file path");
System.exit(0);
}
if (params[1].compareToIgnoreCase("-p12") == 0 && params.length != 3) {
if (params[1].compareToIgnoreCase("-p12") == 0 && params.length < 3) {
System.out.println(
"Load account from the p12 file failed! Please specified the p12 file path");
System.exit(0);
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/console/auth/AuthImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,14 @@ public void getProposalInfoList(String[] params) throws Exception {
params[2],
BigInteger.ONE,
BigInteger.valueOf(Integer.MAX_VALUE));
if (from.compareTo(to) > 0) {
System.out.println("Query From should be less than To.");
return;
}
if (to.subtract(from).compareTo(BigInteger.valueOf(100)) > 0) {
System.out.println("Query range should be less than 100.");
return;
}
List<ProposalInfo> proposalInfoList = authManager.getProposalInfoList(from, to);
int showFrom = from.intValue();
for (ProposalInfo proposalInfo : proposalInfoList) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/console/common/ConsoleVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class ConsoleVersion {

public static final String Version = "3.5.0";
public static final String Version = "3.6.0";

public static void main(String[] args) {
System.out.println("console version: " + Version);
Expand Down
20 changes: 18 additions & 2 deletions src/main/java/console/precompiled/PrecompiledImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,16 @@ private Tuple2<Integer, Integer> travelBfs(
if (deep >= limit) return new Tuple2<>(0, 0);
int dirCount = 0;
int contractCount = 0;
List<BfsInfo> children = bfsService.list(absolutePath);
BigInteger offset = BigInteger.ZERO;
EnumNodeVersion.Version supportedVersion = bfsService.getCurrentVersion();
Tuple2<BigInteger, List<BfsInfo>> fileInfoList;
if (supportedVersion.compareTo(EnumNodeVersion.BCOS_3_1_0.toVersionObj()) >= 0) {
fileInfoList = bfsService.list(absolutePath, offset, Common.LS_DEFAULT_COUNT);
} else {
fileInfoList = new Tuple2<>(BigInteger.ZERO, bfsService.list(absolutePath));
}
BigInteger fileLeft = fileInfoList.getValue1();
List<BfsInfo> children = fileInfoList.getValue2();
for (int i = 0; i < children.size(); i++) {
String thisPrefix = "";
String nextPrefix = "";
Expand All @@ -863,7 +872,11 @@ private Tuple2<Integer, Integer> travelBfs(
thisPrefix = prefix + "├─";
} else {
nextPrefix = prefix + " ";
thisPrefix = prefix + "└─";
if (fileLeft.compareTo(BigInteger.ZERO) > 0) {
thisPrefix = prefix + "├─";
} else {
thisPrefix = prefix + "└─";
}
}
System.out.println(thisPrefix + children.get(i).getFileName());
if (children.get(i).getFileType().equals(Common.BFS_TYPE_DIR)) {
Expand All @@ -881,6 +894,9 @@ private Tuple2<Integer, Integer> travelBfs(
} else {
contractCount++;
}
if (fileLeft.compareTo(BigInteger.ZERO) > 0 && i == children.size() - 1) {
System.out.println(prefix + "└─" + "... " + fileLeft + " left files...");
}
}
}
return new Tuple2<>(dirCount, contractCount);
Expand Down
2 changes: 1 addition & 1 deletion tools/download_console.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package_name="console.tar.gz"
solcj_name=""
solcj_default_version="solcJ-0.8.11.1.jar"
only_solc_flag=""
default_version="3.5.0"
default_version="3.6.0"
download_version="${default_version}"
solc_download_version="3.0.0"
specify_console=0
Expand Down

0 comments on commit 4ff5033

Please sign in to comment.