Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PyFund
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈涛
PyFund
Commits
cba74429
Commit
cba74429
authored
Jun 26, 2023
by
confusion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 aio_reuquets 请求
parent
72478106
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
beacon.py
service/beacon.py
+2
-2
No files found.
service/beacon.py
View file @
cba74429
...
@@ -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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment