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

Merge branch 'blockchain/difficulties' into 'master'

BMA: Add blockchain/difficulties schema and method

See merge request !48
parents 6192b9f7 2cbb63be
No related branches found
No related tags found
1 merge request!48BMA: Add blockchain/difficulties schema and method
Pipeline #4067 passed
...@@ -303,6 +303,38 @@ HARDSHIP_SCHEMA = { ...@@ -303,6 +303,38 @@ HARDSHIP_SCHEMA = {
"required": ["block", "level"] "required": ["block", "level"]
} }
DIFFICULTIES_SCHEMA = {
"type": "object",
"properties": {
"block": {
"type": "number"
},
"levels": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"uid": {
"type": "string"
},
"level": {
"type": "number"
}
},
"required": [
"uid",
"level"
]
}
]
}
},
"required": [
"block",
"levels"
]
}
async def parameters(client: Client) -> dict: async def parameters(client: Client) -> dict:
""" """
...@@ -391,6 +423,16 @@ async def hardship(client: Client, pubkey: str) -> dict: ...@@ -391,6 +423,16 @@ async def hardship(client: Client, pubkey: str) -> dict:
return await client.get(MODULE + '/hardship/%s' % pubkey, schema=HARDSHIP_SCHEMA) return await client.get(MODULE + '/hardship/%s' % pubkey, schema=HARDSHIP_SCHEMA)
async def difficulties(client: Client) -> dict:
"""
GET difficulties levels for members into current window for writing next block
:param client: Client to connect to the api
:return:
"""
return await client.get(MODULE + '/difficulties', schema=DIFFICULTIES_SCHEMA)
async def newcomers(client: Client) -> dict: async def newcomers(client: Client) -> dict:
""" """
GET the block numbers containing newcomers GET the block numbers containing newcomers
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment