transaction log reverted

This commit is contained in:
Achilles Rasquinha 2018-03-13 12:33:29 +05:30
parent 09402547fc
commit 48e3f7bec8
2 changed files with 2 additions and 37 deletions

View file

@ -29,19 +29,12 @@ class TransactionLog(Document):
def hash_line(self):
sha = hashlib.sha256()
sha.update('{}{}{}'.format(
frappe.safe_encode(str(self.row_index)),
frappe.safe_encode(str(self.timestamp)),
frappe.safe_encode(str(self.data))
))
sha.update(str(self.row_index) + str(self.timestamp) + str(self.data))
return sha.hexdigest()
def hash_chain(self):
sha = hashlib.sha256()
sha.update('{}{}{}'.format(
frappe.safe_encode(str(self.transaction_hash)),
frappe.safe_encode(str(self.previous_hash))
))
sha.update(str(self.transaction_hash) + str(self.previous_hash))
return sha.hexdigest()

View file

@ -1,39 +1,11 @@
// Frappe Chat
// Author - Achilles Rasquinha <achilles@frappe.io>
/**
* --------------------------------------------------------------------------------
* Developer Notes
* --------------------------------------------------------------------------------
*/
/* eslint semi: "never" */
// Fuck semicolons - https://mislav.net/2010/05/semicolons
// frappe extensions
// frappe.model extensions
frappe.provide('frappe.model')
/**
* @description Subscribe to a model for realtime updates.
*
* @example
* frappe.model.subscribe('User')
* // Subscribe to all User records
*
* frappe.model.subscribe('User', 'achilles@frappe.io')
* frappe.model.subscribe('User', ['achilles@frappe.io', 'rushabh@frappe.io'])
* // Subscribe to User of name(s)
*
* frappe.model.subscribe('User', 'achilles@frappe.io', 'username')
* frappe.model.subscribe('User', ['achilles@frappe.io', 'rushabh@frappe.io'], ['email', 'username'])
* // Subscribe to User of name for field(s)
*
* @todo Under Development
*/
frappe.model.subscribe = (doctype, name, field) =>
frappe.realtime.publish('frappe.model:subscribe', { doctype: doctype, name: name, field: field })
/**
* @description The base class for all Frappe Errors.
*