|
19 | 19 |
|
20 | 20 | from _decimal import Decimal |
21 | 21 | from random import randint |
| 22 | +from typing import Optional |
22 | 23 |
|
23 | 24 | # See CMainParams in src/chainparams.cpp |
24 | 25 | DEFAULT_PORT_MAINNET_CORE_P2P = 9999 |
@@ -153,8 +154,12 @@ def set_test_params(self): |
153 | 154 | def skip_test_if_missing_module(self): |
154 | 155 | self.skip_if_no_wallet() |
155 | 156 |
|
156 | | - def check_netinfo_fields(self, val, core_p2p_port: int): |
| 157 | + def check_netinfo_fields(self, val, core_p2p_port: int, plat_https_port: Optional[int], plat_p2p_port: Optional[int]): |
157 | 158 | assert_equal(val['core_p2p'][0], f"127.0.0.1:{core_p2p_port}") |
| 159 | + if plat_https_port: |
| 160 | + assert_equal(val['platform_https'][0], f"127.0.0.1:{plat_https_port}") |
| 161 | + if plat_p2p_port: |
| 162 | + assert_equal(val['platform_p2p'][0], f"127.0.0.1:{plat_p2p_port}") |
158 | 163 |
|
159 | 164 | def run_test(self): |
160 | 165 | self.node_evo: Node = Node(self.nodes[0], True) |
@@ -259,11 +264,13 @@ def test_deprecation(self): |
259 | 264 | assert "addresses" in protx_listdiff_rpc['updatedMNs'][0][proregtx_hash].keys() |
260 | 265 |
|
261 | 266 | self.log.info("Test 'addresses' report correctly") |
262 | | - self.check_netinfo_fields(proregtx_rpc['proRegTx']['addresses'], self.node_evo.mn.nodePort) |
263 | | - self.check_netinfo_fields(masternode_status['dmnState']['addresses'], self.node_evo.mn.nodePort) |
264 | | - self.check_netinfo_fields(proupservtx_rpc['proUpServTx']['addresses'], self.node_evo.mn.nodePort) |
265 | | - self.check_netinfo_fields(protx_diff_rpc['mnList'][0]['addresses'], self.node_evo.mn.nodePort) |
266 | | - self.check_netinfo_fields(protx_listdiff_rpc['updatedMNs'][0][proregtx_hash]['addresses'], self.node_evo.mn.nodePort) |
| 267 | + self.check_netinfo_fields(proregtx_rpc['proRegTx']['addresses'], self.node_evo.mn.nodePort, DEFAULT_PORT_PLATFORM_HTTP, DEFAULT_PORT_PLATFORM_P2P) |
| 268 | + self.check_netinfo_fields(masternode_status['dmnState']['addresses'], self.node_evo.mn.nodePort, DEFAULT_PORT_PLATFORM_HTTP, DEFAULT_PORT_PLATFORM_P2P) |
| 269 | + self.check_netinfo_fields(proupservtx_rpc['proUpServTx']['addresses'], self.node_evo.mn.nodePort, DEFAULT_PORT_PLATFORM_HTTP, DEFAULT_PORT_PLATFORM_P2P) |
| 270 | + # CSimplifiedMNListEntry doesn't store platform P2P network information before extended addresses |
| 271 | + self.check_netinfo_fields(protx_diff_rpc['mnList'][0]['addresses'], self.node_evo.mn.nodePort, DEFAULT_PORT_PLATFORM_HTTP, None) |
| 272 | + # TODO: Fix reporting for CDeterministicMNStateDiff |
| 273 | + self.check_netinfo_fields(protx_listdiff_rpc['updatedMNs'][0][proregtx_hash]['addresses'], self.node_evo.mn.nodePort, None, None) |
267 | 274 |
|
268 | 275 | self.log.info("Test RPCs by default no longer return a 'service' field") |
269 | 276 | assert "service" not in proregtx_rpc['proRegTx'].keys() |
|
0 commit comments