@@ -31,11 +31,11 @@ def run_test(self):
3131 # Verify the Cold Staking is active
3232 assert (self .nodes [0 ].getblockchaininfo ()["bip9_softforks" ]["coldstaking" ]["status" ] == "active" )
3333
34- # Success cases
35-
34+ # Success cases
35+
3636 # Two valid inputs
3737
38- address_one = "n1xHh1rPngXNCr2ZbyP9wveFPh4e14YfX2"
38+ address_one = "n1xHh1rPngXNCr2ZbyP9wveFPh4e14YfX2"
3939 address_two = "midAY8TW8TpRY4i8ZEyagSeon3LZFjjMyN"
4040
4141 expected_cold_staking_address = "2afhomfZnhs82Qy1r1MHc4yUnP9jSCvFUdN8vyKR96dbWNEPZ9xyK5bFhSaxe7"
@@ -45,31 +45,31 @@ def run_test(self):
4545 coldstaking_address_one = self .nodes [0 ].getcoldstakingaddress (address_one , address_two )
4646
4747 assert (self .nodes [0 ].validateaddress (coldstaking_address_one )["isvalid" ] == True )
48-
48+
4949 assert (coldstaking_address_one == expected_cold_staking_address )
5050
5151 # Things that should fail
5252
53- ## Two of the same address
53+ ## Two of the same address
5454
5555 make_addr_fail = True
56-
56+
5757 try :
5858 self .nodes [0 ].getcoldstakingaddress (address_one , address_one )
5959 make_addr_fail = False
6060 except JSONRPCException as e :
6161 assert ("The staking address should be different to the spending address" in e .error ['message' ])
6262
6363 assert (make_addr_fail )
64-
65- ## Using coldstaking addresses
66-
64+
65+ ## Using coldstaking addresses
66+
6767 try :
6868 self .nodes [0 ].getcoldstakingaddress (coldstaking_address_one , address_one )
6969 make_addr_fail = False
7070 except JSONRPCException as e :
7171 assert ("Staking address is not a valid NavCoin address" in e .error ['message' ])
72-
72+
7373 try :
7474 self .nodes [0 ].getcoldstakingaddress (address_one , coldstaking_address_one )
7575 make_addr_fail = False
@@ -108,23 +108,26 @@ def run_test(self):
108108 self .nodes [0 ].getcoldstakingaddress (address_one )
109109 make_addr_fail = False
110110 except JSONRPCException as e :
111- assert (("getcoldstakingaddress \" stakingaddress\" \" spendingaddress\" \n "
112- "Returns a coldstaking address based on two address inputs\n "
113- "Arguments:\n "
114- "1. \" stakingaddress\" (string, required) The navcoin staking address.\n "
115- "2. \" spendingaddress\" (string, required) The navcoin spending address.\n \n "
116- "Result:\n "
117- "coldstakingaddress (string) The coldstaking address\n \n "
118- "Examples:\n \n "
119- "> navcoin-cli getcoldstakingaddress \" mqyGZvLYfEH27Zk3z6JkwJgB1zpjaEHfiW\" \" mrfjgazyerYxDQHJAPDdUcC3jpmi8WZ2uv\" \n "
120- "As a json rpc call:\n " ) in e .error ['message' ]) # Check if we print out the help docs
111+ # Check if we print out the help docs
112+ assert (("getcoldstakingaddress \" stakingaddress\" \" spendingaddres"
113+ "s\" \n Returns a coldstaking address based on two address input"
114+ "s\n Arguments:\n 1. \" stakingaddress\" (string, required) The "
115+ "navcoin staking address.\n 2. \" spendingaddress\" (string, req"
116+ "uired) The navcoin spending address.\n \n \n Examples:\n > navcoi"
117+ "n-cli getcoldstakingaddress \" mqyGZvLYfEH27Zk3z6JkwJgB1zpjaEH"
118+ "fiW\" \" mrfjgazyerYxDQHJAPDdUcC3jpmi8WZ2uv\" \n \n As a json rpc"
119+ " call\n > curl --user myusername --data-binary '{\" jsonrpc\" : "
120+ "\" 1.0\" , \" id\" :\" curltest\" , \" method\" : \" getcoldstakingadd"
121+ "ress\" , \" params\" : [\" mqyGZvLYfEH27Zk3z6JkwJgB1zpjaEHfiW\" , "
122+ "\" mrfjgazyerYxDQHJAPDdUcC3jpmi8WZ2uv\" ] }' -H 'content-type: "
123+ "text/plain;' http://127.0.0.1:5555/\n " ) in e .error ['message' ])
121124
122125 assert (make_addr_fail )
123126
124- ## Using invalid addresses
127+ ## Using invalid addresses
128+
129+ ### Numbers
125130
126- ### Numbers
127-
128131 try :
129132 self .nodes [0 ].getcoldstakingaddress (123 , address_one )
130133 make_addr_fail = False
@@ -151,7 +154,7 @@ def run_test(self):
151154
152155 assert (make_addr_fail )
153156
154- ### Other strings
157+ ### Other strings
155158
156159 try :
157160 self .nodes [0 ].getcoldstakingaddress ("\" test\" " , address_one )
@@ -168,7 +171,7 @@ def run_test(self):
168171 assert (make_addr_fail )
169172
170173 ### bitcoin address
171-
174+
172175 bitcoin_address_one = "13EBrRgbPSXwd64MUPaZuWz9aCYq78vpAR"
173176 bitcoin_address_two = "1DdGA8L9sMAz5sXJqcydivxvYicY75VsKa"
174177
@@ -177,7 +180,7 @@ def run_test(self):
177180 make_addr_fail = False
178181 except JSONRPCException as e :
179182 assert ("Staking address is not a valid NavCoin address" in e .error ['message' ])
180-
183+
181184 try :
182185 self .nodes [0 ].getcoldstakingaddress (address_one , bitcoin_address_two )
183186 make_addr_fail = False
0 commit comments