Commit 2cbb63be authored by Moul's avatar Moul

[enh] BMA: Add blockchain/difficulties schema and method

parent 6192b9f7
Pipeline #4066 passed with stages
in 2 minutes and 52 seconds
......@@ -303,6 +303,38 @@ HARDSHIP_SCHEMA = {
"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:
"""
......@@ -391,6 +423,16 @@ async def hardship(client: Client, pubkey: str) -> dict:
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:
"""
GET the block numbers containing newcomers
......
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