From 8143c9f5e430d286503a08c318ded4f735497af7 Mon Sep 17 00:00:00 2001 From: Volodymyr Kravets Date: Fri, 22 Sep 2023 19:03:01 +0300 Subject: [PATCH 1/3] Changed modifier to RC for v5.3.0 --- rskj-core/src/main/resources/version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rskj-core/src/main/resources/version.properties b/rskj-core/src/main/resources/version.properties index 2953026cc08..1f556d3c5f9 100644 --- a/rskj-core/src/main/resources/version.properties +++ b/rskj-core/src/main/resources/version.properties @@ -1,2 +1,2 @@ versionNumber='5.3.0' -modifier="SNAPSHOT" +modifier="RC" From 5b93fa57a1f3ab47a6e5dd4095572a6462c61eec Mon Sep 17 00:00:00 2001 From: Volodymyr Kravets Date: Wed, 27 Sep 2023 15:41:18 +0300 Subject: [PATCH 2/3] Fixed parsing of --import cli flag --- .../src/main/java/co/rsk/cli/RskCli.java | 9 ++--- .../src/test/java/co/rsk/cli/RskCliTest.java | 36 +++++++++++++++++-- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/rskj-core/src/main/java/co/rsk/cli/RskCli.java b/rskj-core/src/main/java/co/rsk/cli/RskCli.java index 5caa1e9677b..0322444f7f1 100644 --- a/rskj-core/src/main/java/co/rsk/cli/RskCli.java +++ b/rskj-core/src/main/java/co/rsk/cli/RskCli.java @@ -53,8 +53,8 @@ static class NetworkFlags { @CommandLine.Option(names = {"-r", "--reset"}, description = "Reset the database") private boolean dbReset; - @CommandLine.Option(names = {"--import"}, description = "Import database") - private String dbImport; + @CommandLine.Option(names = {"-i", "--import"}, description = "Import database") + private boolean dbImport; // config flags @CommandLine.Option(names = {"--verify-config"}, description = "Verify configuration") @@ -110,9 +110,8 @@ private void loadCliArgs() { activatedFlags.add(NodeCliFlags.DB_RESET); } - if (dbImport != null) { + if (dbImport) { activatedFlags.add(NodeCliFlags.DB_IMPORT); - paramValueMap.put("import", dbImport); } if (verifyConfig) { @@ -129,12 +128,10 @@ private void loadCliArgs() { if (rpcCors != null) { activatedOptions.put(NodeCliOptions.RPC_CORS, rpcCors); - paramValueMap.put("rpc-cors", rpcCors); } if (basePath != null) { activatedOptions.put(NodeCliOptions.BASE_PATH, basePath); - paramValueMap.put("base-path", basePath); } if (xArguments != null) { diff --git a/rskj-core/src/test/java/co/rsk/cli/RskCliTest.java b/rskj-core/src/test/java/co/rsk/cli/RskCliTest.java index c16d63228f6..399f6c84760 100644 --- a/rskj-core/src/test/java/co/rsk/cli/RskCliTest.java +++ b/rskj-core/src/test/java/co/rsk/cli/RskCliTest.java @@ -25,13 +25,43 @@ void shouldReturnTrueIfVersionRequested() { rskCli.load(args); assertTrue(rskCli.getCliArgs().getFlags().contains(NodeCliFlags.VERSION)); } + @Test void argsAreParsedCorrectly() { RskCli rskCli = new RskCli(); - String[] args = {"--main", "--skip-java-check", "--print-system-info", "--verify-config", "--reset"}; - rskCli.load(args); + String[] mainnetArgs = {"--main", "--skip-java-check", "--print-system-info", "--verify-config", "--reset", "--import", "-rpccors=*", "-base-path=./test-db", "-Xdatabase.dir="}; + rskCli.load(mainnetArgs); CliArgs parsedArgs = rskCli.getCliArgs(); - assertEquals(5, parsedArgs.getFlags().size()); + assertEquals(6, parsedArgs.getFlags().size()); + assertEquals(2, parsedArgs.getOptions().size()); + assertEquals(1, parsedArgs.getParamValueMap().size()); + + assertEquals("*", parsedArgs.getOptions().get(NodeCliOptions.RPC_CORS)); + assertEquals("./test-db", parsedArgs.getOptions().get(NodeCliOptions.BASE_PATH)); + + rskCli = new RskCli(); + String[] shortArgs = {"-r", "-i"}; + rskCli.load(shortArgs); + parsedArgs = rskCli.getCliArgs(); + assertEquals(2, parsedArgs.getFlags().size()); + assertTrue(parsedArgs.getFlags().contains(NodeCliFlags.DB_RESET)); + assertTrue(parsedArgs.getFlags().contains(NodeCliFlags.DB_IMPORT)); + + rskCli = new RskCli(); + String[] testnetArgs = {"--testnet", "--skip-java-check", "--print-system-info", "--verify-config", "--reset", "--import", "-rpccors=*", "-base-path=./test-db", "-Xdatabase.dir="}; + rskCli.load(testnetArgs); + parsedArgs = rskCli.getCliArgs(); + assertEquals(6, parsedArgs.getFlags().size()); + assertEquals(2, parsedArgs.getOptions().size()); + assertEquals(1, parsedArgs.getParamValueMap().size()); + + rskCli = new RskCli(); + String[] regtestArgs = {"--regtest", "--skip-java-check", "--print-system-info", "--verify-config", "--reset", "--import", "-rpccors=*", "-base-path=./test-db", "-Xdatabase.dir="}; + rskCli.load(regtestArgs); + parsedArgs = rskCli.getCliArgs(); + assertEquals(6, parsedArgs.getFlags().size()); + assertEquals(2, parsedArgs.getOptions().size()); + assertEquals(1, parsedArgs.getParamValueMap().size()); } } From ac35e23ef432ac3b280ffa486c1d32794c976c86 Mon Sep 17 00:00:00 2001 From: Volodymyr Kravets Date: Mon, 2 Oct 2023 13:45:30 +0300 Subject: [PATCH 3/3] Changed modifier to FINGERROOT for v5.3.0 --- rskj-core/src/main/resources/version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rskj-core/src/main/resources/version.properties b/rskj-core/src/main/resources/version.properties index 1f556d3c5f9..8311b27327a 100644 --- a/rskj-core/src/main/resources/version.properties +++ b/rskj-core/src/main/resources/version.properties @@ -1,2 +1,2 @@ versionNumber='5.3.0' -modifier="RC" +modifier="FINGERROOT"