udpate ffs

This commit is contained in:
Brandon Goodell 2017-12-12 15:33:05 -07:00
parent 463d8f35e2
commit cdaeb98d1d

View file

@ -7,14 +7,14 @@
between blocks. between blocks.
Another handler will extract a coherent/robust list of non-conflict- Another handler will extract a coherent/robust list of non-conflict-
ing transactions from a reduced/robust RoBlocks object. ing transactions from a reduced/robust BlockHandler object.
''' '''
from Block import * from Block import *
class RoBlocks(object): class BlockHandler(object):
def __init__(self): def __init__(self):
print("Initializing") print("Initializing")
# Initialize a RoBlocks object. # Initialize a BlockHandler object.
self.data = None self.data = None
self.blocks = {} # Set of blocks (which track parents) self.blocks = {} # Set of blocks (which track parents)
self.family = {} # Doubly linked list tracks parent-and-child links self.family = {} # Doubly linked list tracks parent-and-child links
@ -214,7 +214,7 @@ class RoBlocks(object):
def pruneLeaves(self): def pruneLeaves(self):
print("Pruning leaves") print("Pruning leaves")
out = RoBlocks() out = BlockHandler()
q = deque() q = deque()
for rootIdent in self.roots: for rootIdent in self.roots:
q.append(rootIdent) q.append(rootIdent)
@ -227,8 +227,8 @@ class RoBlocks(object):
return out return out
class Test_RoBlock(unittest.TestCase): class Test_RoBlock(unittest.TestCase):
def test_RoBlocks(self): def test_BlockHandler(self):
R = RoBlocks() R = BlockHandler()
b = Block() b = Block()
b.data = "zirconium encrusted tweezers" b.data = "zirconium encrusted tweezers"
b._recomputeIdent() b._recomputeIdent()