]> Git Repo - VerusCoin.git/blobdiff - qa/rpc-tests/rest.py
[REST] add /rest/chaininfos
[VerusCoin.git] / qa / rpc-tests / rest.py
index 704d889739faf56a42e96c2dcc49ea8f953ca8ed..a9d41cf367273d5ad126eda937fa864541f1eeee 100755 (executable)
@@ -78,7 +78,7 @@ class RESTTest (BitcoinTestFramework):
 
         # check hex format response
         hex_string = http_get_call(url.hostname, url.port, '/rest/tx/'+tx_hash+self.FORMAT_SEPARATOR+"hex", True)
-        assert_equal(response.status, 200)
+        assert_equal(hex_string.status, 200)
         assert_greater_than(int(response.getheader('content-length')), 10)
 
         # check block tx details
@@ -106,5 +106,12 @@ class RESTTest (BitcoinTestFramework):
         for tx in txs:
             assert_equal(tx in json_obj['tx'], True)
 
+        #test rest bestblock
+        bb_hash = self.nodes[0].getbestblockhash()
+        
+        json_string = http_get_call(url.hostname, url.port, '/rest/chaininfo.json')
+        json_obj = json.loads(json_string)
+        assert_equal(json_obj['bestblockhash'], bb_hash)
+
 if __name__ == '__main__':
     RESTTest ().main ()
This page took 0.02458 seconds and 4 git commands to generate.