def test_abnormal_073_getbalancebyaddr(self): try: (process, response) = API.ws().getbalancebyaddr( test_config.ACCOUNT_ADDRESS_INCORRECT_3) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_base_075_getcontract(self): try: (process, response) = API.ws().getcontract( test_config.CONTRACT_ADDRESS_CORRECT) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_065_sendrawtransaction(self): try: (process, response) = API.ws().sendrawtransaction( test_config.RAW_TRANSACTION_DATA_INCORRECT_1) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_base_070_getbalancebyaddr(self): try: (process, response) = API.ws().getbalancebyaddr( test_config.ACCOUNT_ADDRESS_CORRECT) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_base_087_getsmartcodeeventbyhash(self): try: (process, response) = API.ws().getsmartcodeeventbyhash( test_config.TX_HASH_CORRECT) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_base_061_sendrawtransaction(self): try: (process, response) = API.ws().sendrawtransaction( test_config.RAW_TRANSACTION_DATA_CORRECT) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_053_getblockhashbyheight(self): try: (process, response) = API.ws().getblockhashbyheight( test_config.HEIGHT_INCORRECT_2) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_normal_083_getsmartcodeeventbyheight(self): try: (process, response) = API.ws().getsmartcodeeventbyheight( test_config.HEIGHT_BORDER) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_base_049_getblockhashbyheight(self): try: (process, response) = API.ws().getblockhashbyheight( test_config.HEIGHT_CORRECT) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_normal_051_getblockhashbyheight(self): try: (process, response) = API.ws().getblockhashbyheight( test_config.HEIGHT_BORDER) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_045_getblockbyhash(self): try: (process, response) = API.ws().getblockbyhash( test_config.BLOCK_HASH_INCORRECT_3) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_base_041_getblockbyhash(self): try: (process, response) = API.ws().getblockbyhash( test_config.BLOCK_HASH_CORRECT) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_normal_025_getgenerateblocktime(self): try: (process, response) = API.ws().getgenerateblocktime({"height": "1"}) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_normal_023_subscribe(self): try: (process, response) = API.ws().subscribe( [test_config.CONTRACT_ADDRESS_CORRECT], sblocktxhashs=0) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_base_055_gettransaction(self): try: (process, response) = API.ws().gettransaction(test_config.TX_HASH_CORRECT) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_base_081_getsmartcodeeventbyheight(self): try: (process, response) = API.ws().getsmartcodeeventbyheight( test_config.HEIGHT_CORRECT) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_059_gettransaction(self): try: (process, response) = API.ws().gettransaction( test_config.TX_HASH_INCORRECT_3) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_086_getsmartcodeeventbyheight(self): try: (process, response) = API.ws().getsmartcodeeventbyheight( test_config.HEIGHT_INCORRECT_3) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_080_getcontract(self): try: (process, response) = API.ws().getcontract( test_config.CONTRACT_ADDRESS_INCORRECT_4) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_base_004_subscribe(self): try: (process, response) = API.ws().subscribe( [test_config.CONTRACT_ADDRESS_CORRECT]) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_base_099_getmerkleproof(self): try: (process, response) = API.ws().getmerkleproof(test_config.TX_HASH_CORRECT) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_104_getmerkleproof(self): try: (process, response) = API.ws().getmerkleproof( test_config.TX_HASH_INCORRECT_4) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_098_getblockheightbytxhash(self): try: (process, response) = API.ws().getblockheightbytxhash( test_config.TX_HASH_INCORRECT_4) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_base_093_getblockheightbytxhash(self): try: (process, response) = API.ws().getblockheightbytxhash( test_config.TX_HASH_CORRECT) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_092_getsmartcodeeventbyhash(self): try: (process, response) = API.ws().getsmartcodeeventbyhash( test_config.TX_HASH_INCORRECT_4) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_normal_048_getblockheight(self): try: API.node().stop_nodes([0, 1, 2, 3, 4, 5, 6]) API.node().start_nodes([0, 1, 2, 3, 4, 5, 6], Config.DEFAULT_NODE_ARGS) time.sleep(10) (process, response) = API.ws().getblockheight() self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_106_getsessioncount(self): try: API.node().stop_node(0) (process, response) = API.ws().getsessioncount() API.node().start_node(0, Config.DEFAULT_NODE_ARGS) time.sleep(5) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_normal_100_getmerkleproof(self): try: (process, response) = API.native().transfer_ont(Config.NODES[0]["address"], Config.NODES[1]["address"], "100000000", 0, twice=True, check_state=False) tx_hash_failed = response["txhash"] API.node().wait_tx_result(tx_hash_failed) (process, response) = API.ws().getmerkleproof(tx_hash_failed) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_normal_088_getsmartcodeeventbyhash(self): try: (process, response) = API.native().transfer_ont(Config.NODES[0]["address"], Config.NODES[1]["address"], "100000000", 0, twice=True, check_state=True) tx_hash_failed = response["txhash"] (process, response) = API.ws().getsmartcodeeventbyhash(tx_hash_failed) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_base_105_getsessioncount(self): try: (process, response) = API.ws().getsessioncount() self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])