Skip to content

Commit

Permalink
Fix n value in wallets ima current node section
Browse files Browse the repository at this point in the history
  • Loading branch information
badrogger committed Mar 7, 2024
1 parent 10c5446 commit af372b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/schains/config/node_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
)

Expand Down
1 change: 1 addition & 0 deletions core/schains/config/skale_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions tests/schains/config/node_info_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit af372b0

Please sign in to comment.