Commit cba74429 authored by confusion's avatar confusion

修改 aio_reuquets 请求

parent 72478106
...@@ -166,11 +166,11 @@ class BeaconChaService: ...@@ -166,11 +166,11 @@ class BeaconChaService:
async def get_income_history(self, index_or_pubkey: str): async def get_income_history(self, index_or_pubkey: str):
response = await aio_request(url=f"{self.base_url}/validator/{index_or_pubkey}", json_res=False) response = await aio_request(url=f"{self.base_url}/validator/{index_or_pubkey}", json_res=False)
return eval(re.findall(r'var incomeHistory = \[(.*?)\]', response)[0]) return eval(re.findall(r'var incomeHistory = \[(.*?)\]', response.decode("utf-8"))[0])
async def get_execute_income_history(self, index_or_pubkey: str): async def get_execute_income_history(self, index_or_pubkey: str):
response = await aio_request(f"{self.base_url}/validator/{index_or_pubkey}", json_res=False) response = await aio_request(f"{self.base_url}/validator/{index_or_pubkey}", json_res=False)
return eval(re.findall(r'var executionIncomeHistory = \[(.*?)\]', response)[0]) return eval(re.findall(r'var executionIncomeHistory = \[(.*?)\]', response.decode("utf-8"))[0])
async def get_rewards(self, index_or_pubkey: Union[int, str]) -> Rewards: async def get_rewards(self, index_or_pubkey: Union[int, str]) -> Rewards:
total_reward_element_path = "/html/body/main/div[1]/div[2]/div[2]/div/table/tbody/tr[1]/td/span" total_reward_element_path = "/html/body/main/div[1]/div[2]/div[2]/div/table/tbody/tr[1]/td/span"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment