Skip to content

Instantly share code, notes, and snippets.

@gauthamzz
Created January 31, 2019 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gauthamzz/30651effc5293b76929200a162e5b160 to your computer and use it in GitHub Desktop.
Save gauthamzz/30651effc5293b76929200a162e5b160 to your computer and use it in GitHub Desktop.
def commit(self):
byte_length = max(ceil(self.state.size.bit_length() / 8), 1)
app_hash = self.state.size.to_bytes(byte_length, byteorder='big')
self.state.app_hash = app_hash
self.state.height += 1
self.state.save()
return ResponseCommit(data=app_hash)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment