Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DuniterPy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
DuniterPy
Merge requests
!48
BMA: Add blockchain/difficulties schema and method
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
BMA: Add blockchain/difficulties schema and method
blockchain/difficulties
into
master
Overview
0
Commits
1
Pipelines
1
Changes
1
Merged
Moul
requested to merge
blockchain/difficulties
into
master
6 years ago
Overview
0
Commits
1
Pipelines
1
Changes
1
I didn’t wrote any tests as we plan to drop BMA.
Edited
6 years ago
by
Moul
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
2cbb63be
1 commit,
6 years ago
1 file
+
42
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
duniterpy/api/bma/blockchain.py
+
42
−
0
View file @ 2cbb63be
Edit in single-file editor
Open in Web IDE
Show full file
@@ -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
Loading