forked from tari-project/dan-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess_type.py
45 lines (25 loc) · 906 Bytes
/
process_type.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from typing import Optional
def is_base_node(what: str) -> bool:
return what.startswith("BaseNode")
def is_base_wallet(what: str) -> bool:
return what.startswith("BaseWallet")
def is_asset_wallet(what: str) -> bool:
return what.startswith("AssetWallet")
def is_validator_node(what: str) -> bool:
return what.startswith("ValidatorNode")
def is_miner(what: str) -> bool:
return what.startswith("Miner")
def is_indexer(what: str) -> bool:
return what.startswith("Indexer")
def is_signaling_server(what: str) -> bool:
return what.startswith("SignalingServer")
def is_connector(what: str) -> bool:
return what.startswith("TariConnector")
def is_template_web(what: str) -> bool:
return what.startswith("TemplateWeb")
def get_index(what: str) -> Optional[int]:
try:
_, id = what.split("_")
return int(id)
except:
return None