예제 #1
0
    def test_get_highest_block_tips_same_height_override_private(self):
        self.second_block_chain_a.transfer_allowed = True

        tip = chainutil.get_highest_block(
            [self.second_block_chain_a, self.second_block_chain_b],
            BlockOrigin.public, BlockOrigin.private)

        self.assertEqual(tip, self.second_block_chain_a)
예제 #2
0
    def test_get_highest_block_lead_public_override_public(self):
        self.second_block_chain_a.transfer_allowed = True

        tip = chainutil.get_highest_block(
            [self.third_a_block_chain_a, self.third_a_block_chain_b],
            BlockOrigin.public, BlockOrigin.public)

        self.assertEqual(tip, self.third_a_block_chain_b)
예제 #3
0
    def test_get_highest_block_public_tip_same_height_then_transferable_public_block(
            self):
        self.first_block_chain_a.transfer_allowed = True

        tip = chainutil.get_highest_block(
            [self.second_block_chain_a, self.first_block_chain_b],
            BlockOrigin.public)

        self.assertEqual(tip, self.first_block_chain_b)
예제 #4
0
    def test_get_highest_block_different_origin_transfer_allowed(self):
        self.first_block_chain_a.transfer_allowed = True
        tip = chainutil.get_highest_block([self.first_block_chain_a],
                                          BlockOrigin.public)

        self.assertEqual(tip, self.first_block_chain_a)
예제 #5
0
    def test_get_highest_block_different_origin(self):
        tip = chainutil.get_highest_block([self.first_block_chain_a],
                                          BlockOrigin.public)

        self.assertEqual(tip, test_util.genesis_block)
예제 #6
0
    def test_get_highest_block_same_origin(self):
        tip = chainutil.get_highest_block([self.first_block_chain_a],
                                          BlockOrigin.private)

        self.assertEqual(tip, self.first_block_chain_a)
예제 #7
0
    def test_get_highest_block_genesis_block(self):
        tip = chainutil.get_highest_block([test_util.genesis_block],
                                          BlockOrigin.private)

        self.assertEqual(tip, test_util.genesis_block)