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
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
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