From 400f029be2d3eae050a4e8061b6803f67de21faa Mon Sep 17 00:00:00 2001 From: Denis Angell Date: Tue, 26 Nov 2024 14:21:52 +0100 Subject: [PATCH] fix xrpl features --- tests/integration/test_standalone.py | 1 + xrpld_netgen/libs/rippled.py | 1 + xrpld_netgen/main.py | 20 ++++++++++++-------- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/integration/test_standalone.py b/tests/integration/test_standalone.py index b9224b0..bf880fe 100644 --- a/tests/integration/test_standalone.py +++ b/tests/integration/test_standalone.py @@ -40,6 +40,7 @@ def test_standalone_image(cls): cls.assertTrue(folder_exists) for file in files_exist: cls.assertTrue(file) + print(ee) def _test_standalone_binary(cls): create_standalone_binary( diff --git a/xrpld_netgen/libs/rippled.py b/xrpld_netgen/libs/rippled.py index 5167434..02c3473 100644 --- a/xrpld_netgen/libs/rippled.py +++ b/xrpld_netgen/libs/rippled.py @@ -38,6 +38,7 @@ def parse_rippled_amendments(lines: Any): amendment_name: str = "" if re.match(r"XRPL_FIX", line): amendment_name = re.search("XRPL_FIX\)?.*?\((.*?),", line).group(1) or 0 + amendment_name = f"fix{amendment_name}" if re.match(r"XRPL_FEATURE", line): amendment_name = re.search("XRPL_FEATURE\((.*?),", line).group(1) or 0 supported = re.findall(r"Supported::(.*),", line) diff --git a/xrpld_netgen/main.py b/xrpld_netgen/main.py index 6aa9708..02be42a 100644 --- a/xrpld_netgen/main.py +++ b/xrpld_netgen/main.py @@ -85,7 +85,7 @@ def update_stop_sh( return stop_sh_content -def create_standalone_folder( +def create_xrpl_standalone_folder( binary: bool, name: str, image: str, @@ -127,10 +127,11 @@ def create_standalone_folder( nodedb_type, get_node_db_path(nodedb_type, "standalone"), get_relational_db(nodedb_type), - "/var/lib/rippled/db", - "/var/log/rippled/debug.log", + "/opt/ripple/lib/db", + "/opt/ripple/log/debug.log", log_level, None, + [], vl_config["validator_list_sites"], vl_config["validator_list_keys"], vl_config["import_vl_keys"] if protocol == "xahau" else [], @@ -143,6 +144,7 @@ def create_standalone_folder( lines: List[str] = get_feature_lines_from_content(feature_content) features_json: Dict[str, Any] = parse_rippled_amendments(lines) + print(json.dumps(features_json, indent=4)) genesis_json: Any = update_amendments(features_json, protocol) write_file( f"{basedir}/{protocol}-{name}/genesis.json", @@ -216,7 +218,7 @@ def create_standalone_image( owner, repo, build_name, "include/xrpl/protocol/detail/features.macro" ) image: str = f"{build_system}/rippled:{build_name}" - create_standalone_folder( + create_xrpl_standalone_folder( False, name, image, @@ -278,7 +280,7 @@ def create_standalone_image( os.chmod(f"{basedir}/{protocol}-{name}/stop.sh", 0o755) -def create_binary_folder( +def create_xahau_standalone_folder( binary: bool, name: str, image: str, @@ -320,10 +322,11 @@ def create_binary_folder( nodedb_type, get_node_db_path(nodedb_type, "standalone"), get_relational_db(nodedb_type), - "/var/lib/rippled/db", - "/var/log/rippled/debug.log", + "/opt/ripple/lib/db", + "/opt/ripple/log/debug.log", log_level, None, + [], vl_config["validator_list_sites"], vl_config["validator_list_keys"], vl_config["import_vl_keys"] if protocol == "xahau" else [], @@ -415,7 +418,7 @@ def create_standalone_binary( url: str = f"{build_server}/{build_version}" download_binary(url, f"{basedir}/{protocol}-{name}/rippled.{name}") image: str = "ubuntu:jammy" - create_binary_folder( + create_xahau_standalone_folder( True, name, image, @@ -520,6 +523,7 @@ def create_local_folder( "debug.log", log_level, None, + [], vl_config["validator_list_sites"], vl_config["validator_list_keys"], vl_config["import_vl_keys"] if protocol == "xahau" else [],