示例#1
0
 def from_blockchain(cls, jobid):
     data = deepcopy(TX_QUERY_DATA)
     data["params"]["ctorMsg"]["function"] = "queryJobInfo"
     data["params"]["ctorMsg"]["args"] = [jobid]
     ret = BlockChain.query(JOBINFO_URL, data)
     print ret
     return cls.load_from_dict(ret) if ret is not None else None
示例#2
0
 def bc_evaluate(self, userid, score):
     data = deepcopy(TX_INVOKE_DATA)
     data["params"]["ctorMsg"]["function"] = "evaluate"
     data["params"]["ctorMsg"]["args"] = self.blockchain_evaluate_params(
         userid, score)
     ret = BlockChain.invoke(TX_URL, data)
     print "+++++++++"
     print ret
示例#3
0
 def bc_artificial_check(self, result):
     data = deepcopy(TX_INVOKE_DATA)
     data["params"]["ctorMsg"]["function"] = "artificialCheck"
     data["params"]["ctorMsg"]["args"] = self.blockchain_check_params(
         result)
     ret = BlockChain.invoke(TX_URL, data)
     print "+++++++++"
     print ret
示例#4
0
 def from_blockchain(cls, txid):
     data = deepcopy(TX_QUERY_DATA)
     data["params"]["ctorMsg"]["function"] = "queryTxInfo"
     data["params"]["ctorMsg"]["args"] = [txid]
     ret = BlockChain.query(TX_URL, data)
     print "qurey:"
     print json.dumps(ret)
     return cls.load_from_dict(ret) if ret is not None else None
示例#5
0
    def bc_create(self):
        data = deepcopy(TX_INVOKE_DATA)
        data["params"]["ctorMsg"]["function"] = "create"
        data["params"]["ctorMsg"]["args"] = self.blockchain_create_params()

        ret = BlockChain.invoke(TX_URL, data)
        print("+++++++++")
        print(ret)
    def bc_create(self):
        data = deepcopy(JOBINFO_INVOKE_DATA)
        data["params"]["ctorMsg"]["function"] = "add"
        data["params"]["ctorMsg"]["args"] = self.blockchain_create_params()

        r = BlockChain.invoke(JOBINFO_URL, data)
        print(json.dumps(data))
        print(r)
示例#7
0
 def from_blockchain(cls, userid):
     data = deepcopy(USERINFO_QUERY_DATA)
     data["params"]["ctorMsg"]["function"] = "queryUserInfo"
     data["params"]["ctorMsg"]["args"] = [userid]
     ret = BlockChain.query(USERINFO_URL, data)
     print '+++++++++'
     print ret
     print '+++++++++'
     return cls.load_from_dict(ret) if ret is not None else None
示例#8
0
 def bc_create(self):
     data = deepcopy(TX_INVOKE_DATA)
     data["params"]["ctorMsg"]["function"] = "create"
     data["params"]["ctorMsg"]["args"] = self.blockchain_create_params()
     # print "++++++++++++"
     # print json.dumps(data)
     # print "+++++++++"
     ret = BlockChain.invoke(TX_URL, data)
     print "+++++++++"
     print ret
示例#9
0
 def bc_add_total_hired(self):
     data = deepcopy(JOBINFO_INVOKE_DATA)
     data["params"]["ctorMsg"]["function"] = "addTotalHired"
     data["params"]["ctorMsg"]["args"] = self.blockchain_jobrelated_params()
     BlockChain.invoke(JOBINFO_URL, data)
示例#10
0
 def bc_add_tx(self, txid):
     data = deepcopy(JOBINFO_INVOKE_DATA)
     data["params"]["ctorMsg"]["function"] = "addTX"
     data["params"]["ctorMsg"]["args"] = self.blockchain_addtx_params(txid)
     BlockChain.invoke(JOBINFO_URL, data)
示例#11
0
 def bc_delete(self):
     data = deepcopy(JOBINFO_INVOKE_DATA)
     data["params"]["ctorMsg"]["function"] = "delete"
     data["params"]["ctorMsg"]["args"] = self.blockchain_delete_params()
     BlockChain.invoke(JOBINFO_URL, data)
示例#12
0
 def bc_update(self):
     data = deepcopy(USERINFO_INVOKE_DATA)
     data["params"]["ctorMsg"]["function"] = "edit"
     data["params"]["ctorMsg"]["args"] = self.blockchain_update_params()
     BlockChain.invoke(USERINFO_URL, data)