Created
August 1, 2018 09:50
-
-
Save emre/77406f40f4dfa96c29f67bc179ed6c34 to your computer and use it in GitHub Desktop.
last_head_test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def test_last_head(): | |
appbase_node = "https://api.steemit.com" | |
global_properties = requests.post( | |
appbase_node, | |
json={ | |
"jsonrpc": "2.0", | |
"method": "condenser_api.get_dynamic_global_properties", | |
"params": [], "id": 1 | |
} | |
).json() | |
head_block_number = global_properties["result"]["head_block_number"] | |
print("Last head block number", head_block_number) | |
ops_in_block = requests.post( | |
appbase_node, | |
json={ | |
"jsonrpc": "2.0", | |
"method": "condenser_api.get_ops_in_block", | |
"params": [head_block_number, False], "id": 1 | |
} | |
).json() | |
print(ops_in_block) | |
test_last_head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment