Beispiel #1
0
    def test_invalid_sign(self):
        key = default_eccrypto.generate_key(u"curve25519")

        blk = FakeBlock()
        blk.sign(key)

        assert not blk.block_invariants_valid()
Beispiel #2
0
 def test_invariant_invalid_key(self):
     """
     Test if illegal key blocks are not valid.
     """
     block = FakeBlock()
     block.public_key = b"definitelynotakey"
     assert not block.block_invariants_valid()
Beispiel #3
0
 def test_invariant_invalid_com_seq_num(self):
     """
     Test if illegal key blocks are not valid.
     """
     block = FakeBlock()
     block.com_seq_num = -1
     assert not block.block_invariants_valid()
Beispiel #4
0
 def test_invariant_negative_timestamp(self):
     """
     Test if negative sequence number blocks are not valid.
     """
     block = FakeBlock()
     block.timestamp = -1.0
     assert not block.block_invariants_valid()
Beispiel #5
0
 def test_block_valid(self):
     blk = FakeBlock()
     assert blk.block_invariants_valid()