Skip to content
Snippets Groups Projects
Commit accc3b61 authored by Radosław Masłowski's avatar Radosław Masłowski
Browse files

Refactor wax and node version verification in legacy mode

parent 88d3befb
No related branches found
No related tags found
1 merge request!237Pack of beekeeper wallet improvements
...@@ -77,12 +77,20 @@ class Wallet(UserHandleImplementation, ScopedObject): ...@@ -77,12 +77,20 @@ class Wallet(UserHandleImplementation, ScopedObject):
self._transaction_expiration_offset = timedelta(seconds=30) self._transaction_expiration_offset = timedelta(seconds=30)
self.__prepare_directory() self.__prepare_directory()
self.run(preconfigure=preconfigure) self.run(preconfigure=preconfigure)
if ( if self.connected_node is not None:
self.connected_node is not None node_version = self.connected_node.api.database.get_version().node_type
and self._transaction_serialization == "legacy" is_testnet_wax = wax_helpy.get_hive_protocol_config("hive.fund", self.__get_chain_id())["IS_TEST_NET"]
and self.connected_node.api.database.get_version().node_type == "testnet" if self._transaction_serialization == "legacy":
): if node_version == "testnet" and is_testnet_wax == "false":
warnings.warn("Wallet in legacy mode may not work correctly with the testnet hive instance.", stacklevel=1) warnings.warn(
"Wallet in legacy mode may not work correctly with the testnet hive instance and wax mainnet instance.",
stacklevel=1,
)
elif node_version == "mainnet" and is_testnet_wax == "true":
warnings.warn(
"Wallet in legacy mode may not work correctly with the mainnet hive instance and wax testnet instance.",
stacklevel=1,
)
@property @property
def _force_connected_node(self) -> AnyNode: def _force_connected_node(self) -> AnyNode:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment