Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clients
python
DuniterPy
Commits
7d822aee
Commit
7d822aee
authored
Dec 16, 2018
by
Vincent Texier
Browse files
Add blockchain/with/revoked and blockchain/branches in bma api
parent
4d8a26d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
duniterpy/api/bma/blockchain.py
View file @
7d822aee
...
...
@@ -342,6 +342,14 @@ DIFFICULTIES_SCHEMA = {
]
}
BRANCHES_SCHEMA
=
{
"type"
:
"object"
,
"properties"
:
{
"blocks"
:
BLOCKS_SCHEMA
}
}
async
def
parameters
(
client
:
Client
)
->
dict
:
"""
GET the blockchain parameters used by this node
...
...
@@ -439,6 +447,16 @@ async def difficulties(client: Client) -> dict:
return
await
client
.
get
(
MODULE
+
'/difficulties'
,
schema
=
DIFFICULTIES_SCHEMA
)
async
def
branches
(
client
:
Client
)
->
list
:
"""
GET current branches of the node (top block of each branch)
:param client: Client to connect to the api
:return:
"""
return
await
client
.
get
(
MODULE
+
'/branches'
,
schema
=
BRANCHES_SCHEMA
)
async
def
newcomers
(
client
:
Client
)
->
dict
:
"""
GET the block numbers containing newcomers
...
...
@@ -489,6 +507,16 @@ async def leavers(client: Client) -> dict:
return
await
client
.
get
(
MODULE
+
'/with/leavers'
,
schema
=
BLOCK_NUMBERS_SCHEMA
)
async
def
revoked
(
client
:
Client
)
->
dict
:
"""
GET the block numbers containing revoked members.
:param client: Client to connect to the api
:return:
"""
return
await
client
.
get
(
MODULE
+
'/with/excluded'
,
schema
=
BLOCK_NUMBERS_SCHEMA
)
async
def
excluded
(
client
:
Client
)
->
dict
:
"""
GET the block numbers containing excluded
...
...
Moul
@moul
mentioned in issue
#114 (closed)
·
Jan 19, 2020
mentioned in issue
#114 (closed)
mentioned in issue #114
Toggle commit list
Write
Preview
Supports
Markdown
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