def testGrowBlock(self): base = BU.generateBlock("me", 15) self.assertEqual(base.height, 15) top = BU.growBlock(base, "he", 23) self.assertEqual(top.height, 15 + 23) self.assertEqual(BU.isValidBlock(top), True) self.assertEqual(BU.growBlock(base, "he", 0).uid, base.uid)
def testGenerateBlock(self): self.assertEqual(BU.generateBlock("me", 6).height, 6) self.assertEqual(BU.generateBlock("me", 0), None) self.assertEqual(BU.generateBlock("me", 1), BU.genisisBlock()) self.assertEqual(BU.isValidBlock(BU.generateBlock("me", 50)), True)