Skip to content

Instantly share code, notes, and snippets.

@arnabghose997
Last active November 7, 2022 04:54
Show Gist options
  • Save arnabghose997/658954e2e1d1214f7b465d91f47480f6 to your computer and use it in GitHub Desktop.
Save arnabghose997/658954e2e1d1214f7b465d91f47480f6 to your computer and use it in GitHub Desktop.
Check the time until upgrade height is reached in Tedermint
import datetime
BLOCK_TIME = 5 # Estimated
def figure_out_expected_time(current_height, upgrade_height):
difference_in_seconds = (upgrade_height - current_height) * BLOCK_TIME
return str(datetime.timedelta(seconds=difference_in_seconds))
if __name__=='__main__':
current_block_height = 537744 # Look at Explorer
expected_block_height = 629716
print("Expected time left: ", figure_out_expected_time(537744, 629716))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment