Пример #1
0
 def test_create_genesis(self):
     key = ECCrypto().generate_key(u"curve25519")
     db = self.MockDatabase()
     block = MultiChainBlock.create(db, key.pub().key_to_bin(), link=None)
     self.assertEqual(block.previous_hash, GENESIS_HASH)
     self.assertEqual(block.sequence_number, GENESIS_SEQ)
     self.assertEqual(block.public_key, key.pub().key_to_bin())
     self.assertEqual(block.signature, EMPTY_SIG)
Пример #2
0
 def test_create_link_genesis(self):
     key = ECCrypto().generate_key(u"curve25519")
     db = self.MockDatabase()
     link = TestBlock()
     db.add_block(link)
     block = MultiChainBlock.create(db, key.pub().key_to_bin(), link=link)
     self.assertEqual(block.previous_hash, GENESIS_HASH)
     self.assertEqual(block.sequence_number, GENESIS_SEQ)
     self.assertEqual(block.public_key, key.pub().key_to_bin())
     self.assertEqual(block.link_public_key, link.public_key)
     self.assertEqual(block.link_sequence_number, link.sequence_number)