added reject_batch function to tracker
-from plenum.server.batch_handlers.batch_request_handler import BatchRequestHandler
-from plenum.common.ledger import Ledger
from stp_core.common.log import Logger
logger = Logger()
@@ -10,7 +8,7 @@ class Tracker:
def __init__(self):
self.un_committed = []
- def track_uncommitted(self, state_root, ledger_size):
+ def track(self, state_root, ledger_size):
un_committed_state = ()
@@ -22,9 +20,14 @@ class Tracker:
if ledger_size > 0:
un_committed_state = un_committed_state + (state_root,)
else:
- raise logger.error("incorrect size of ledger given")
+ raise logger.error("Incorrect size of ledger given")
self.un_committed.append(un_committed_state)
def reject_batch(self):
+ # what is the output of a one variable array from this
+
+ if len(self.un_committed) != 0 :
self.un_committed = self.un_committed[:-1]
+ else:
+ raise logger.error("No items to revert in Tracker")
\ No newline at end of file
