diff --git a/core/schains/config/node_info.py b/core/schains/config/node_info.py index b9ba6ce2..7af52aaa 100644 --- a/core/schains/config/node_info.py +++ b/core/schains/config/node_info.py @@ -75,7 +75,9 @@ def to_dict(self): def generate_current_node_info( node: dict, node_id: int, ecdsa_key_name: str, static_node_info: dict, - schain: dict, schains_on_node: list, rotation_id: int, skale_manager_opts: SkaleManagerOpts, + schain: dict, schains_on_node: list, rotation_id: int, + nodes_in_schain: int, + skale_manager_opts: SkaleManagerOpts, sync_node: bool = False, archive: bool = False, catchup: bool = False ) -> CurrentNodeInfo: schain_base_port_on_node = get_schain_base_port_on_node( @@ -87,7 +89,7 @@ def generate_current_node_info( wallets = generate_wallets_config( schain['name'], rotation_id, - schain_nodes_number=len(schains_on_node), + schain_nodes_number=nodes_in_schain, sync_node=sync_node ) diff --git a/core/schains/config/skale_section.py b/core/schains/config/skale_section.py index badbe403..b6fad256 100644 --- a/core/schains/config/skale_section.py +++ b/core/schains/config/skale_section.py @@ -69,6 +69,7 @@ def generate_skale_section( schain=schain, schains_on_node=schains_on_node, rotation_id=rotation_id, + nodes_in_schain=len(schain_nodes_with_schains), skale_manager_opts=skale_manager_opts, sync_node=sync_node, archive=archive, diff --git a/tests/schains/config/node_info_test.py b/tests/schains/config/node_info_test.py index 5e9bb4d6..0e6e67ea 100644 --- a/tests/schains/config/node_info_test.py +++ b/tests/schains/config/node_info_test.py @@ -52,9 +52,11 @@ def test_generate_current_node_info( schain={'name': _schain_name, 'partOfNode': 0}, schains_on_node=[{'name': _schain_name, 'port': 10000}], rotation_id=0, + nodes_in_schain=5, skale_manager_opts=skale_manager_opts ) current_node_info_dict = current_node_info.to_dict() + assert current_node_info_dict['wallets']['ima']['n'] == 5 assert current_node_info_dict['nodeID'] == 1 assert current_node_info_dict['nodeName'] == 'test' assert current_node_info_dict['basePort'] == 10000 @@ -76,6 +78,7 @@ def test_generate_current_node_info( schain={'name': _schain_name, 'partOfNode': 0}, schains_on_node=[{'name': _schain_name, 'port': 10000}], rotation_id=0, + nodes_in_schain=4, skale_manager_opts=skale_manager_opts ) current_node_info_dict = current_node_info.to_dict() @@ -102,6 +105,7 @@ def test_skale_manager_opts( schain={'name': _schain_name, 'partOfNode': 0}, schains_on_node=[{'name': _schain_name, 'port': 10000}], rotation_id=0, + nodes_in_schain=4, skale_manager_opts=skale_manager_opts ) current_node_info_dict = current_node_info.to_dict()