Skip to content
Snippets Groups Projects
Commit 7d822aee authored by Vincent Texier's avatar Vincent Texier
Browse files

Add blockchain/with/revoked and blockchain/branches in bma api

parent 4d8a26d8
Branches
Tags
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment