Skip to content
Snippets Groups Projects
Commit 9de47432 authored by Hugo Trentesaux's avatar Hugo Trentesaux Committed by Vincent Texier
Browse files

[fix] fix example code

parent 3aa8848a
No related branches found
No related tags found
2 merge requests!128Release 0.62.0,!124#130: Support reading Duniter's local json blockchain
...@@ -23,7 +23,8 @@ from duniterpy.helpers.blockchain import load ...@@ -23,7 +23,8 @@ from duniterpy.helpers.blockchain import load
bc = load() # gets blockchain iterator bc = load() # gets blockchain iterator
b = next(bc) # gets block b = next(bc) # gets block
b.number # should return 0 print(f"first block number is: {b.number}") # should return 0
# you can access all properties of this block through it's duniterpy objects attributes # you can access all properties of this block through it's duniterpy objects attributes
next(bc).number # should return 1 print(f"second block number is: {next(bc).number}") # should return 1
next(bc).number # should return 2 (and so on) print(f"third block number is: {next(bc).number}") # should return 2
# (and so on)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment