Beispiel #1
0
    def test_44_get_storage(self):
        script_hash = ""
        key = self.m_getstorage_contract_key

        logger.open("restful/44_get_storage.log", "44_get_storage")
        (result, response) = RestfulApi().getstorage(script_hash, key)
        logger.close(not result)
Beispiel #2
0
    def test_48_get_storage(self):
        script_hash = self.m_getstorage_contract_addr
        key = self.m_getstorage_contract_key + "1111"

        logger.open("restful/48_get_storage.log", "48_get_storage")
        (result, response) = RestfulApi().getstorage(script_hash, key)
        logger.close(result)
Beispiel #3
0
    def test_54_get_contract_state(self):
        script_hash = self.m_contractaddr_wrong

        logger.open("restful/54_get_contract_state.log",
                    "54_get_contract_state")
        (result, response) = RestfulApi().getcontract(script_hash)
        logger.close(not result)
Beispiel #4
0
 def test_04_get_conn_count(self):
     stop_nodes([1, 2, 3, 4, 5, 6])
     logger.open("restful/04_get_conn_count.log", "04_get_conn_count")
     (result, response) = RestfulApi().getconnectioncount()
     logger.close(result and int(response["result"]) == 0)
     start_nodes([1, 2, 3, 4, 5, 6], Config.DEFAULT_NODE_ARGS, True, True)
     time.sleep(10)
Beispiel #5
0
    def test_17_consensus(self):
        result = False
        logger.open("17_consensus.log", "17_consensus")
        storage_key = ByteToHex(b'Test Key 17')
        storage_value = ByteToHex(b'Test Value 17')
        try:
            (result,
             response) = invoke_function(self.m_contract_addr,
                                         "put",
                                         "",
                                         "1",
                                         argvs=[{
                                             "type": "bytearray",
                                             "value": storage_key
                                         }, {
                                             "type": "bytearray",
                                             "value": storage_value
                                         }],
                                         node_index=self.m_current_node)
            if not result:
                raise Error("invoke_function put error...")

            result = check_node_state([0, 1, 2, 3, 4, 5, 6])
        except Exception as e:
            print(e.msg)
            result = False
        logger.close(result)
Beispiel #6
0
    def test_67_get_blk_hgt_by_txhash(self):
        hash = self.m_txhash_wrong

        logger.open("restful/67_get_blk_hgt_by_txhash.log",
                    "67_get_blk_hgt_by_txhash")
        (result, response) = RestfulApi().getblockheightbytxhash(hash)
        logger.close(not result)
    def test_gov_16(self):
        result = False
        logger.open("TestGover16.log", "TestGover16")
        try:
            (wallet_A_address, wallet_B_address, vote_price,
             node_B_puiblic_key, blocks_per_round,
             punish_ratio) = get_config()

            invoke_function_update("updateGlobalParam", "2000000000", "10000",
                                   "32", "10", "50", "50", "50", "50")

            # step 1 wallet A vote for node B
            (result,
             response) = vote_for_peer_index(Config.NODES[8]["address"],
                                             [node_B_puiblic_key], ["90000"],
                                             8)
            print(response)
            #if not result:
            #	raise Error("vote_for_peer error")

            # step 1 wallet A vote for node B
            (result, response) = vote_for_peer_index(wallet_A_address,
                                                     [node_B_puiblic_key],
                                                     ["10001"])
            print(response)
            #if not result:
            #	raise Error("vote_for_peer error")

        except Exception as e:
            print(e.msg)
        logger.close(result)
Beispiel #8
0
    def test_13_consensus(self):
        result = False
        logger.open("13_consensus.log", "13_consensus")
        storage_key = ByteToHex(b'Test Key 13')
        storage_value = ByteToHex(b'Test Value 13')
        try:
            for i in range(1, 4):
                self.init_bft_node(i)
                time.sleep(30)
                for j in range(10):
                    (result, response) = invoke_function(
                        self.m_contract_addr,
                        "put",
                        "",
                        "1",
                        argvs=[{
                            "type": "bytearray",
                            "value": storage_key
                        }, {
                            "type": "bytearray",
                            "value": storage_value
                        }],
                        node_index=self.m_current_node)
                    if not result:
                        raise Error("invoke_function put error...")
                    time.sleep(10)

        except Exception as e:
            print(e.msg)
            result = False
        logger.close(result)
Beispiel #9
0
    def test_10_consensus(self):
        result = False
        storage_key = ByteToHex(b'Test Key 10')
        storage_value = ByteToHex(b'Test Value 10')
        logger.open("10_consensus.log", "10_consensus")
        try:
            for i in range(1, 4):
                self.init_bft_node(i)
                time.sleep(30)
                (result,
                 response) = invoke_function(self.m_contract_addr,
                                             "put",
                                             "",
                                             "1",
                                             argvs=[{
                                                 "type": "bytearray",
                                                 "value": storage_key
                                             }, {
                                                 "type": "bytearray",
                                                 "value": storage_value
                                             }],
                                             node_index=self.m_current_node)
                if not result:
                    raise Error("invoke_function error...")

                (result, response) = RPCApi().getblockheightbytxhash(
                    response["txhash"])
                if not result:
                    raise Error("not a valid block...")

        except Exception as e:
            print(e.msg)
            result = False
        logger.close(result)
Beispiel #10
0
    def test_08_consensus(self):
        stopnodes = self.m_stop_2_nodes
        stop_nodes(stopnodes)
        result = False
        logger.open("08_consensus.log", "08_consensus")
        try:
            (result,
             response) = transfer(self.m_contract_addr,
                                  Config.NODES[self.m_current_node]["address"],
                                  Config.NODES[1]["address"], self.AMOUNT,
                                  self.m_current_node)
            if not result:
                raise Error("transfer error...")

            (result,
             response) = RPCApi().getblockheightbytxhash(response["txhash"])
            if not result:
                raise Error("not a valid block...")

        except Exception as e:
            print(e.msg)
            result = False
        logger.close(result)

        start_nodes(stopnodes, Config.DEFAULT_NODE_ARGS)
        time.sleep(3)
Beispiel #11
0
    def test_main(self):
        result = False
        logger.open("TestGover7.log", "TestGover7")
        try:
            if (not pause(
                    "ensure that node A and node B is in the nodes network and node A has more than 10000 ont."
            )):
                raise Error("pre-condition unsatisfied")

            (wallet_A_address, wallet_B_address, vote_price,
             node_B_puiblic_key, blocks_per_round,
             punish_ratio) = get_config()
            consensus_rounds = (int)(getblockcount() / blocks_per_round)

            # step 1 wallet A vote for node B
            (result, response) = vote_for_peer(wallet_A_address,
                                               [node_B_puiblic_key],
                                               [vote_price])
            print(response)
            #if not result:
            #	raise Error("vote error")

            # step 2 wallet A unvote in the second round
            while (True):
                if (getblockcount() / blocks_per_round -
                        consensus_rounds == 1):
                    (result,
                     response) = unvote_for_peer(wallet_A_address,
                                                 [node_B_puiblic_key],
                                                 [vote_price])
                    break
                else:
                    time.sleep(5)
                    continue
            #if not result:
            #	raise Error("unvote error")

            # step 3 wallet A withdraw ont in the third round
            while (True):
                if (getblockcount() / blocks_per_round -
                        consensus_rounds == 2):
                    (result, response) = withdraw_ont(wallet_A_address,
                                                      [node_B_puiblic_key],
                                                      [vote_price])
                    break
                else:
                    time.sleep(5)
                    continue
            #if not result:
            #	raise Error("withdraw_ont error")

            # this should be failed
            (result, response) = withdraw_ont(wallet_A_address,
                                              [node_B_puiblic_key], ["1"])
            #if not result:
            #	raise Error("withdraw_ont error")

        except Exception as e:
            print(e.msg)
        logger.close(result)
Beispiel #12
0
	def test_main(self):
		result = False
		logger.open("TestGover14.log", "TestGover14")
		try:
			if (not pause("ensure that node A and node B is in the nodes network and node A has more than 10000 ont.")):
				raise Error("pre-condition unsatisfied")

			(wallet_A_address, wallet_B_address, vote_price, node_B_puiblic_key, blocks_per_round, punish_ratio) = get_config()			
			'''
			# to ensure that the following operations are in the same round
			while(True):
				if getblockcount() % blocks_per_round <= 2:
					time.sleep(1)
					continue
				else:
					break
			'''

			# step 1 wallet A vote for node B
			(result, response) = vote_for_peer(wallet_A_address, ["03e05d01e5df2c85e6a9a5526c70d080b6c7dce0fa7c66f8489c18b8569dc269dc"], ["190000"])
			print (response)
			#if not result:
			#	raise Error("vote_for_peer error")

			# step 1 wallet A vote for node B
			(result, response) = vote_for_peer(wallet_A_address, ["03e05d01e5df2c85e6a9a5526c70d080b6c7dce0fa7c66f8489c18b8569dc269dc"], ["10000"])
			print (response)
			#if not result:
			#	raise Error("vote_for_peer error")
			
			
		
		except Exception as e:
			print(e.msg)
		logger.close(result)
Beispiel #13
0
    def test_12_consensus(self):
        result = False
        logger.open("12_consensus.log", "12_consensus")
        storage_key = ByteToHex(b'Test Key 12')
        storage_value = ByteToHex(b'Test Value 12')
        try:
            for i in range(1, 4):
                self.init_bft_node(i)
                time.sleep(30)

                #A节点是Admin节点
                (result, response) = init_admin(self.m_contract_addr,
                                                Config.ontID_A)
                if not result:
                    raise Error("init_admin error...")

                (result,
                 response) = bind_role_function(self.m_contract_addr,
                                                Config.ontID_A,
                                                Config.roleA_hex, ["auth_put"])
                if not result:
                    raise Error("bind_role_function error...")

                (result, response) = invoke_function(self.m_contract_addr,
                                                     "auth_put",
                                                     Config.ontID_B,
                                                     "1",
                                                     argvs=[{
                                                         "type":
                                                         "bytearray",
                                                         "value":
                                                         storage_key
                                                     }, {
                                                         "type":
                                                         "bytearray",
                                                         "value":
                                                         storage_value
                                                     }])
                if not result:
                    raise Error("invoke_function put error...")

                (result, response) = invoke_function(self.m_contract_addr,
                                                     "get",
                                                     Config.ontID_B,
                                                     "1",
                                                     argvs=[{
                                                         "type":
                                                         "bytearray",
                                                         "value":
                                                         storage_key
                                                     }])
                if response["result"]["Result"] != '':
                    result = False
                    raise Error("invoke_function get error...")

        except Exception as e:
            print(e.msg)
            result = False
        logger.close(result)
Beispiel #14
0
    def test_38_post_raw_tx(self):
        rawtxdata = self.m_signed_txhash_right
        action = "sendrawtransaction"
        version = ""

        logger.open("restful/38_post_raw_tx.log", "38_post_raw_tx")
        (result, response) = RestfulApi().postrawtx(rawtxdata, action, version)
        logger.close(result)
Beispiel #15
0
 def finish(self, task_name, log_path, result, msg):
     if result:
         logger.print("[ OK       ] ")
         logger.append_record(task_name, "pass", log_path)
     else:
         logger.print("[ Failed   ] " + msg)
         logger.append_record(task_name, "fail", log_path)
     logger.close()
Beispiel #16
0
    def test_41_post_raw_tx(self):
        rawtxdata = ""
        action = "sendrawtransaction"
        version = "1.0.0"

        logger.open("restful/41_post_raw_tx.log", "41_post_raw_tx")
        (result, response) = RestfulApi().postrawtx(rawtxdata, action, version)
        logger.close(not result)
Beispiel #17
0
    def test_40_post_raw_tx(self):
        rawtxdata = self.m_signed_txhash_wrong
        action = "sendrawtransaction"
        version = "1.0.0"

        logger.open("restful/40_post_raw_tx.log", "40_post_raw_tx")
        (result, response) = RestfulApi().postrawtx(rawtxdata, action, version)
        logger.close(not result)
Beispiel #18
0
    def test_main(self):
        result = False
        logger.open("TestGover2.log", "TestGover2")
        try:
            if (not pause(
                    "ensure that node A is not in the nodes network and node B is in the nodes network and node A has more than 10000 ont."
            )):
                raise Error("pre-condition unsatisfied")

            (wallet_A_address, wallet_B_address, vote_price,
             node_B_puiblic_key, blocks_per_round,
             punish_ratio) = get_config()
            block_count = getblockcount()
            # to ensure that the following operations are in the same round
            '''
			while(True):
				if getblockcount() % blocks_per_round <= 2:
					time.sleep(5)
					continue
				else:
					break
			
			# step 1 wallet A vote for node B
			(result, response) = vote_for_peer(wallet_A_address, [node_B_puiblic_key], [vote_price])
			print (response)
			#if not result:
			#	raise Error("vote error")
			
			# step 2 wallet A unvote in the same round
			(result, response) = unvote_for_peer(wallet_A_address, [node_B_puiblic_key], [vote_price])
			#if not result:
			#	raise Error("vote error")
			
			# wait until the next two blocks
			print (getblockcount(), block_count)
			while(True):
				if getblockcount() - block_count == 0:
					print (getblockcount(), block_count)
					time.sleep(5)
				else:
					break

			# step 3 wallet A withdraw ont
			(result, response) = withdraw_ont(wallet_A_address, [node_B_puiblic_key], [vote_price])
			#if not result:
			#	raise Error("vote error")
			'''
            # this should be failed
            (result, response) = unvote_for_peer(wallet_A_address,
                                                 [node_B_puiblic_key], ["10"])
            (result, response) = withdraw_ont(wallet_A_address,
                                              [node_B_puiblic_key], ["10"])
            #if not result:
            #	raise Error("vote error")

        except Exception as e:
            print(e.msg)
        logger.close(result)
Beispiel #19
0
    def test_53_get_contract_state(self):
        (contractaddr_right,
         txhash_right) = deploy_contract_full("tasks/A.neo", "name", "desc", 0)

        script_hash = contractaddr_right
        logger.open("restful/53_get_contract_state.log",
                    "53_get_contract_state")
        (result, response) = RestfulApi().getcontract(script_hash)
        logger.close(not result)
Beispiel #20
0
    def test_onto_1(self):
        result = False
        logger.open("test_onto_1.log", "test_onto_1")
        try:
            (result, response) = init_admin(self.CONTRACT_ADDRESS_CORRECT,
                                            self.ontID_A)

        except Exception as e:
            print(e.msg)
        logger.close(result)
Beispiel #21
0
    def test_gov_11(self):
        result = False
        logger.open("TestGover11.log", "TestGover11")
        try:
            (wallet_A_address, wallet_B_address, vote_price,
             node_B_puiblic_key, blocks_per_round,
             punish_ratio) = get_config()
            vote_price = "20000"
            # step 1 wallet A vote for node B
            (result, response) = vote_for_peer_index(wallet_A_address,
                                                     [node_B_puiblic_key],
                                                     [vote_price])
            print(response)
            #if not result:
            #	raise Error("vote_for_peer error")

            # step 2 wait until the second round
            invoke_function_consensus(Config.NODES[0]["pubkey"])
            time.sleep(5)
            (result, response) = quit_node_index(node_B_puiblic_key,
                                                 wallet_B_address, 7)

            # step 3 wallet A withdraw ont in the third round
            invoke_function_consensus(Config.NODES[0]["pubkey"])
            time.sleep(5)
            (result, response) = withdraw_ont_index(wallet_A_address,
                                                    [node_B_puiblic_key],
                                                    [vote_price])
            #if not result:
            #	raise Error("withdraw_ont error")

            (result, response) = unvote_for_peer_index(wallet_A_address,
                                                       [node_B_puiblic_key],
                                                       [vote_price])
            # step 3 wallet A withdraw ont in the fifth round
            invoke_function_consensus(Config.NODES[0]["pubkey"])
            time.sleep(5)
            invoke_function_consensus(Config.NODES[0]["pubkey"])
            time.sleep(5)

            (result, response) = withdraw_ont_index(wallet_A_address,
                                                    [node_B_puiblic_key],
                                                    [vote_price])
            #if not result:
            #	raise Error("withdraw_ont error")

            # this should be failed
            (result, response) = withdraw_ont(wallet_A_address,
                                              [node_B_puiblic_key], ["1"])
            #if not result:
            #	raise Error("withdraw_ont error")

        except Exception as e:
            print(e.msg)
        logger.close(result)
Beispiel #22
0
    def test_gov_14(self):
        result = False
        logger.open("TestGover14.log", "TestGover14")
        try:
            (wallet_A_address, wallet_B_address, vote_price,
             node_B_puiblic_key, blocks_per_round,
             punish_ratio) = get_config()
            invoke_function_update("updateGlobalParam", "2000000000", "10000",
                                   "32", "1", "50", "50", "50", "50")
            # step 1 wallet A vote for node B
            (result, response) = vote_for_peer_index(wallet_A_address,
                                                     [node_B_puiblic_key],
                                                     [vote_price])
            print(response)
            #if not result:
            #	raise Error("vote_for_peer error")

            # step 2 wait until the second round
            invoke_function_consensus(Config.NODES[0]["pubkey"])
            time.sleep(5)
            (result, response) = black_node([node_B_puiblic_key])

            # step 3 wallet A withdraw ont in the third round
            # should failed
            (result, response) = withdraw_ont_index(wallet_A_address,
                                                    [node_B_puiblic_key],
                                                    [vote_price])
            #if not result:
            #	raise Error("withdraw_ont error")

            (result, response) = unvote_for_peer_index(wallet_A_address,
                                                       [node_B_puiblic_key],
                                                       [vote_price])

            # step 4 wallet A withdraw ont in the forth round
            invoke_function_consensus(Config.NODES[0]["pubkey"])
            time.sleep(5)
            (result,
             response) = withdraw_ont_index(wallet_A_address,
                                            [node_B_puiblic_key],
                                            [str(int(punish_ratio * 3000))])
            #if not result:
            #	raise Error("withdraw_ont error")

            # this should be failed
            (result, response) = withdraw_ont_index(wallet_A_address,
                                                    [node_B_puiblic_key],
                                                    ["1"])
            #if not result:
            #	raise Error("withdraw_ont error")

        except Exception as e:
            print(e.msg)
        logger.close(result)
Beispiel #23
0
    def test_main(self):
        result = False
        logger.open("TestGover1.log", "TestGover1")
        try:
            if (not pause(
                    "ensure that node A is not in the nodes network and node B is in the nodes network and node A has more than 10000 ont."
            )):
                raise Error("pre-condition unsatisfied")

            (wallet_A_address, wallet_B_address, vote_price,
             node_B_puiblic_key, blocks_per_round,
             punish_ratio) = get_config()

            block_count = getblockcount()

            # step 1 before vote get balance of wallet A B
            balance_of_wallet_A_1 = getbalance_ont(wallet_A_address)
            balance_of_wallet_B_1 = getbalance_ont(wallet_B_address)
            print("A:", balance_of_wallet_A_1)
            print("B:", balance_of_wallet_B_1)

            # step 2 wallet A vote for node B
            (result, response) = vote_for_peer(wallet_A_address,
                                               [node_B_puiblic_key],
                                               [vote_price])
            #if not result:
            #	raise Error("vote error")

            # wait until the next two blocks
            while (True):
                if getblockcount() - block_count <= 1:
                    print(getblockcount(), block_count)
                    time.sleep(5)
                else:
                    break

            # step 3 after vote get balance of wallet A B
            balance_of_wallet_A_2 = getbalance_ont(wallet_A_address)
            balance_of_wallet_B_2 = getbalance_ont(wallet_B_address)
            print("2A:", balance_of_wallet_A_2)
            print("2B:", balance_of_wallet_B_2)

            # step 4 compare
            if balance_of_wallet_B_1 != balance_of_wallet_B_2:
                raise Error("balance of wallte B changed.")

            if balance_of_wallet_A_1 - balance_of_wallet_A_2 != int(
                    vote_price):
                raise Error("the decrease of balance of wallet A is not %s." %
                            vote_price)

        except Exception as e:
            print(e.msg)
        logger.close(result)
Beispiel #24
0
    def test_01_get_gen_blk_time(self):
        stop_all_nodes()
        start_nodes([0, 1, 2, 3, 4, 5, 6],
                    Config.DEFAULT_NODE_ARGS,
                    True,
                    True,
                    config="config-dbft-1.json")
        time.sleep(10)

        logger.open("restful/01_get_gen_blk_time.log", "01_get_gen_blk_time")
        (result, response) = RestfulApi().getgenerateblocktime()
        logger.close(result)
Beispiel #25
0
    def test_main(self):
        result = False
        logger.open("TestGover12.log", "TestGover12")
        try:
            if (not pause(
                    "ensure that node A and node B is in the nodes network and node A has more than 10000 ont."
            )):
                raise Error("pre-condition unsatisfied")

            (wallet_A_address, wallet_B_address, vote_price,
             node_B_puiblic_key, blocks_per_round,
             punish_ratio) = get_config()
            '''
			# to ensure that the following operations are in the same round			
			while(True):
				if getblockcount() % blocks_per_round <= 2:
					time.sleep(1)
					continue
				else:
					break
			'''
            # step 1 wallet A vote for node B
            (result, response) = vote_for_peer(wallet_A_address,
                                               [node_B_puiblic_key],
                                               [vote_price])
            print(response)
            #if not result:
            #	raise Error("vote error")

            # step 2 black node b
            if (not pause("black node over?")):
                pass
            #if not result:
            #	raise Error("black_node error")

            # step 3 withdraw ont
            (result, response) = withdraw_ont(wallet_A_address,
                                              [node_B_puiblic_key],
                                              [vote_price])
            #if not result:
            #	raise Error("withdraw_ont error")

            # this should be failed
            (result, response) = withdraw_ont(wallet_A_address,
                                              [node_B_puiblic_key], ["1"])
            #if not result:
            #	raise Error("withdraw_ont error")

        except Exception as e:
            print(e.msg)
        logger.close(result)
Beispiel #26
0
 def test_75_no_url(self):
     request = {
         "TYPE": "restful",
         "REQUEST": {
             "api": ""
         },
         "RESPONSE": {
             "Error": 0,
         }
     }
     task = Task(name="75_no_url", ijson=request)
     logger.open("restful/75_no_url.log", "75_no_url")
     (result, response) = run_single_task(task)
     logger.close(not result)
Beispiel #27
0
 def test_74_get_conn_count1(self):
     request = {
         "TYPE": "restful",
         "REQUEST": {
             "api": "/api/v1/get_conn_count1"
         },
         "RESPONSE": {
             "Error": 0,
         }
     }
     task = Task(name="74_get_conn_count1", ijson=request)
     logger.open("restful/74_get_conn_count1.log", "74_get_conn_count1")
     (result, response) = run_single_task(task)
     logger.close(not result)
Beispiel #28
0
    def test_main(self):
        logger.open("TestConsensus2.log", "TestConsensus2")
        try:
            #step 1
            task1 = Task("tasks/invoke_put.json")
            (result, response) = call_contract(task1)
            if not result:
                raise Error("error")

            #step 2
            if response['result']['Result String'] != "keytest":
                raise Error("key value can not get")

        except Exception as e:
            print(e.msg)
        logger.close(result)
Beispiel #29
0
    def test_09_consensus(self):
        stopnodes = self.m_stop_2_nodes

        logger.open("09_consensus.log", "09_consensus")
        stop_nodes(stopnodes)
        result = False
        logger.open("09_consensus.log", "09_consensus")
        try:
            for i in range(10):
                storage_key = ByteToHex(
                    bytes("Test Key 09-" + str(i), encoding="utf8"))
                storage_value = ByteToHex(
                    bytes("Test Value 09-" + str(i), encoding="utf8"))

                logger.print("times: " + str(i))
                (result,
                 response) = invoke_function(self.m_contract_addr,
                                             "put",
                                             "",
                                             "1",
                                             argvs=[{
                                                 "type": "bytearray",
                                                 "value": storage_key
                                             }, {
                                                 "type": "bytearray",
                                                 "value": storage_value
                                             }],
                                             node_index=self.m_current_node)
                if not result:
                    raise Error("invoke_function put error...")

                time.sleep(30)
                (result, response) = RPCApi().getblockheightbytxhash(
                    response["txhash"])
                if not result:
                    raise Error("not a valid block...in " + str(i) + " times")
                time.sleep(10)

        except Exception as e:
            print(e.msg)
            result = False
        logger.close(result)

        start_nodes(stopnodes, Config.DEFAULT_NODE_ARGS)
        time.sleep(3)
Beispiel #30
0
 def test_main(self):
     logger.open("TestConsensus1.log", "TestConsensus1")
     try:
         #step 1
         txHash = ""
         task1 = Task("../utils/api/requests/rpc/getblock.json")
         (result, response) = run_single_task(task1)
         print(response["result"]["Hash"])
         #step 2
         txHash = response["result"]["Hash"]
         task2 = Task("../utils/api/requests/rpc/getblock.json")
         task2.data()["REQUEST"]["params"][0] = txHash
         (result, response) = run_single_task(task2)
         if not result:
             raise Error("send transaction error")
     except Exception as e:
         print(e.msg)
     logger.close(result)