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)
    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)
    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)
    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)
    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)
    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)
    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)