Created
January 31, 2019 22:03
-
-
Save gauthamzz/c71cd51fd460481e468f4c2172cd7fa6 to your computer and use it in GitHub Desktop.
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
def deliver_tx(self, tx): | |
"""Validate the transaction before mutating the state. | |
Args: | |
raw_tx: a raw string (in bytes) transaction. | |
""" | |
parts = tx.split(b'=') | |
if len(parts) == 2: | |
key, value = parts[0], parts[1] | |
else: | |
key, value = tx | |
self.state.db.set(prefix_key(key), value) | |
self.state.size += 1 | |
return ResponseDeliverTx(code=CodeTypeOk) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment