Skip to content

Commit fa56126

Browse files
committed
refactor: add type annotations for MasternodeInfo members
1 parent dfca0ee commit fa56126

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

test/functional/test_framework/test_framework.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,24 @@ def is_bdb_compiled(self):
11361136
EVONODE_COLLATERAL = 4000
11371137

11381138
class MasternodeInfo:
1139-
def __init__(self, proTxHash, fundsAddr, ownerAddr, votingAddr, rewards_address, operator_reward, pubKeyOperator, keyOperator, collateral_address, collateral_txid, collateral_vout, nodePort, evo=False):
1139+
proTxHash: str = ""
1140+
fundsAddr: str = ""
1141+
ownerAddr: str = ""
1142+
votingAddr: str = ""
1143+
rewards_address: str = ""
1144+
operator_reward: int = 0
1145+
pubKeyOperator: str = ""
1146+
keyOperator: str = ""
1147+
collateral_address: str = ""
1148+
collateral_txid: str = ""
1149+
collateral_vout: int = 0
1150+
nodePort: int = 0
1151+
evo: bool = False
1152+
nodeIdx: Optional[int] = None
1153+
friendlyName: Optional[str] = None
1154+
1155+
def __init__(self, proTxHash: str, fundsAddr: str, ownerAddr: str, votingAddr: str, rewards_address: str, operator_reward: int, pubKeyOperator: str,
1156+
keyOperator: str, collateral_address: str, collateral_txid: str, collateral_vout: int, nodePort: int, evo: bool = False):
11401157
self.proTxHash = proTxHash
11411158
self.fundsAddr = fundsAddr
11421159
self.ownerAddr = ownerAddr
@@ -1150,10 +1167,8 @@ def __init__(self, proTxHash, fundsAddr, ownerAddr, votingAddr, rewards_address,
11501167
self.collateral_vout = collateral_vout
11511168
self.nodePort = nodePort
11521169
self.evo = evo
1153-
self.nodeIdx = None
1154-
self.friendlyName=None
11551170

1156-
def set_node(self, nodeIdx, friendlyName=None):
1171+
def set_node(self, nodeIdx: int, friendlyName: Optional[str] = None):
11571172
self.nodeIdx = nodeIdx
11581173
self.friendlyName = friendlyName or f"mn-{'evo' if self.evo else 'reg'}-{self.nodeIdx}"
11591174

0 commit comments

Comments
 (0)