Exemplo n.º 1
0
 def getRelatedListByDelAddr(self, del_addr, from_address=None):
     """
     Query the NodeID and pledge ID of the node entrusted by the current account address
     :param del_addr: Client's account address
     :param from_address: Used to call the rpc call method
     :return:
     todo fill
     """
     del_addr = bech32_address_bytes(del_addr)
     data = rlp.encode([rlp.encode(int(1103)), rlp.encode(del_addr)])
     raw_data = call_obj(self, from_address, self.web3.stakingAddress, data)
     return parse_str(raw_data)
Exemplo n.º 2
0
 def getValidatorList(self, from_address=None):
     """
     Query the list of certified for the current consensus cycle
     :param from_address: Used to call the rpc call method
     :return:
     todo fill
     """
     data = rlp.encode([rlp.encode(int(1101))])
     raw_data = call_obj(self, from_address, self.web3.stakingAddress, data)
     parse = parse_str(raw_data)
     try:
         raw_data = parse["Ret"]
         for i in raw_data:
             i["Shares"] = int(i["Shares"], 16)
     except:...
     return parse
Exemplo n.º 3
0
 def getVerifierList(self, from_address=None):
     """
     Query the certified queue for the current billing cycle
     :param from_address: Used to call the rpc call method
     :return:
     todo fill
     """
     data = rlp.encode([rlp.encode(int(1100))])
     raw_data = call_obj(self, from_address, self.stakingAddress, data)
     parse = parse_str(raw_data)
     try:
         raw_data = parse["Ret"]
         for i in raw_data:
             i["Shares"] = int(i["Shares"], 16)
     except:
         ...
     return parse
Exemplo n.º 4
0
 def getCandidateList(self, from_address=None):
     """
     Query all real-time candidate lists
     :param from_address: Used to call the rpc call method
     :return:
     todo fill
     """
     data = rlp.encode([rlp.encode(int(1102))])
     raw_data = call_obj(self, from_address, self.web3.stakingAddress, data)
     parse = parse_str(raw_data)
     try:
         raw_data = parse["Ret"]
         for i in raw_data:
             i["Shares"] = int(i["Shares"], 16)
             i["Released"] = int(i["Released"], 16)
             i["ReleasedHes"] = int(i["ReleasedHes"], 16)
             i["RestrictingPlan"] = int(i["RestrictingPlan"], 16)
             i["RestrictingPlanHes"] = int(i["RestrictingPlanHes"], 16)
     except:...
     return parse