Merge pull request #5239 from achillesrasquinha/py3-test
Fixed transaction_log test case
This commit is contained in:
commit
5ca949cc2b
1 changed files with 9 additions and 2 deletions
|
|
@ -29,12 +29,19 @@ class TransactionLog(Document):
|
|||
|
||||
def hash_line(self):
|
||||
sha = hashlib.sha256()
|
||||
sha.update(str(self.row_index) + str(self.timestamp) + str(self.data))
|
||||
sha.update(
|
||||
frappe.safe_encode(str(self.row_index)) + \
|
||||
frappe.safe_encode(str(self.timestamp)) + \
|
||||
frappe.safe_encode(str(self.data))
|
||||
)
|
||||
return sha.hexdigest()
|
||||
|
||||
def hash_chain(self):
|
||||
sha = hashlib.sha256()
|
||||
sha.update(str(self.transaction_hash) + str(self.previous_hash))
|
||||
sha.update(
|
||||
frappe.safe_encode(str(self.transaction_hash)) + \
|
||||
frappe.safe_encode(str(self.previous_hash))
|
||||
)
|
||||
return sha.hexdigest()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue