From ca81868a208f4a55eda40b8695cfaf880159f030 Mon Sep 17 00:00:00 2001 From: kyonRay Date: Wed, 30 Nov 2022 10:48:21 +0800 Subject: [PATCH] (console): fix save gm bin bug. --- .github/workflows/workflow.yml | 2 +- src/main/java/console/Console.java | 4 ++++ src/main/java/console/contract/utils/ContractCompiler.java | 7 ++++++- src/main/java/console/precompiled/PrecompiledImpl.java | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 1f1ef2d1..3d490db1 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019, macos-12] + os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019, macos-latest] steps: - uses: actions/checkout@v2 with: diff --git a/src/main/java/console/Console.java b/src/main/java/console/Console.java index 2cdaaecc..b1467095 100644 --- a/src/main/java/console/Console.java +++ b/src/main/java/console/Console.java @@ -176,9 +176,11 @@ public static void main(String[] args) { System.out.println( "Current ledger crypto type is ECDSA, please make sure the account is a ecdsa account!"); } + logger.error("SignatureException, e: ", e); } catch (ClassNotFoundException e) { System.out.println(e.getMessage() + " does not exist."); System.out.println(); + logger.error("ClassNotFoundException, e:", e); } catch (IOException e) { if (e.getMessage().startsWith("activeConnections")) { System.out.println( @@ -192,10 +194,12 @@ public static void main(String[] args) { logger.error("IOException, e:", e); } System.out.println(); + logger.error("IOException, e:", e); } catch (InvocationTargetException e) { Throwable targetException = e.getTargetException(); System.out.println(targetException.getMessage()); System.out.println(); + logger.error("InvocationTargetException, e:", e); } catch (UserInterruptException e) { consoleInitializer.stop(); break; diff --git a/src/main/java/console/contract/utils/ContractCompiler.java b/src/main/java/console/contract/utils/ContractCompiler.java index adac77ce..d998e1f9 100644 --- a/src/main/java/console/contract/utils/ContractCompiler.java +++ b/src/main/java/console/contract/utils/ContractCompiler.java @@ -310,7 +310,12 @@ public static void saveAbiAndBin( File binPath = new File(saveDir.getAbsolutePath() + File.separator + contractName + BIN_SUFFIX); File smBinPath = - new File(saveDir.getAbsolutePath() + contractName + SM_SUFFIX + BIN_SUFFIX); + new File( + saveDir.getAbsolutePath() + + File.separator + + contractName + + SM_SUFFIX + + BIN_SUFFIX); if (Objects.nonNull(abiAndBin.getAbi()) && !abiAndBin.getAbi().isEmpty()) { FileUtils.writeStringToFile(abiPath, abiAndBin.getAbi()); diff --git a/src/main/java/console/precompiled/PrecompiledImpl.java b/src/main/java/console/precompiled/PrecompiledImpl.java index 53e4106c..3909aa9b 100644 --- a/src/main/java/console/precompiled/PrecompiledImpl.java +++ b/src/main/java/console/precompiled/PrecompiledImpl.java @@ -413,7 +413,7 @@ public void makeDir(String[] params) throws Exception { String[] fixedBfsParams = ConsoleUtils.fixedBfsParams(params, pwd); String path = fixedBfsParams[1]; RetCode mkdir = bfsService.mkdir(path); - logger.info("mkdir: make new dir {}", path); + logger.info("mkdir: make new dir {}, retCode {}", path, mkdir); if (mkdir.getCode() == PrecompiledRetCode.CODE_FILE_INVALID_PATH.getCode()) { if (!path.startsWith("/apps/") && !path.startsWith("/tables/")) { System.out.println("Only permitted to mkdir in '/apps/' and '/tables/'");