def message_hash(self, msg): payload = _parse_args(msg.prev_hash, msg.payload_hash) return bit_encode(payload)
def message_hash(self, msg, new_payload_hash=None): payload_hash = new_payload_hash or msg.payload_hash payload = _parse_args(msg.prev_hash, payload_hash) return bit_encode(payload)
def payload_hash(self, msg): payload = _parse_args(msg.timestamp, msg.data, msg.sender, msg.receiver) return bit_encode(payload)
def block_hash(self, block): payload = _parse_args(block.prev_hash, block.timestamp, block.messages[-1].hash) return bit_encode(payload)