From 9de47432ea11f69f34c3752a03aad889d8c8cd1a Mon Sep 17 00:00:00 2001 From: Hugo Trentesaux <hugo@trentesaux.fr> Date: Fri, 9 Oct 2020 12:38:49 +0200 Subject: [PATCH] [fix] fix example code --- examples/load_local_blockchain.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/load_local_blockchain.py b/examples/load_local_blockchain.py index 0dc9e9ff..b5d727c4 100644 --- a/examples/load_local_blockchain.py +++ b/examples/load_local_blockchain.py @@ -23,7 +23,8 @@ from duniterpy.helpers.blockchain import load bc = load() # gets blockchain iterator 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 -next(bc).number # should return 1 -next(bc).number # should return 2 (and so on) +print(f"second block number is: {next(bc).number}") # should return 1 +print(f"third block number is: {next(bc).number}") # should return 2 +# (and so on) -- GitLab