def test_add_minor_block_request_list(self):
    id1 = Identity.create_random_identity()
    acc1 = Address.create_from_identity(id1, full_shard_key=0)
    with ClusterContext(2, acc1) as clusters:
        shard_state = clusters[0].get_shard_state(2)
        b1 = _tip_gen(shard_state)
        add_result = call_async(clusters[0].master.add_raw_minor_block(b1.header.branch, b1.serialize()))
        self.assertTrue(add_result)
        self.assertFalse(clusters[0].get_shard_state(3).contain_remote_minor_block_hash(b1.header.get_hash()))
        self.assertTrue(clusters[0].master.root_state.db.contain_minor_block_by_hash(b1.header.get_hash()))
        assert_true_with_timeout((lambda : clusters[0].get_shard_state(2).contain_block_by_hash(b1.header.get_hash())))
        assert_true_with_timeout((lambda : clusters[1].master.root_state.db.contain_minor_block_by_hash(b1.header.get_hash())))
def test_add_minor_block_request_list(self):
    id1 = Identity.create_random_identity()
    acc1 = Address.create_from_identity(id1, full_shard_key=0)
    with ClusterContext(2, acc1) as clusters:
        shard_state = clusters[0].get_shard_state(2)
        b1 = _tip_gen(shard_state)
        add_result = call_async(clusters[0].master.add_raw_minor_block(b1.header.branch, b1.serialize()))
        self.assertTrue(add_result)
        self.assertFalse(clusters[0].get_shard_state(3).contain_remote_minor_block_hash(b1.header.get_hash()))
        self.assertTrue(clusters[0].master.root_state.db.contain_minor_block_by_hash(b1.header.get_hash()))
        assert_true_with_timeout((lambda : clusters[0].get_shard_state(2).contain_block_by_hash(b1.header.get_hash())))
        assert_true_with_timeout((lambda : clusters[1].master.root_state.db.contain_minor_block_by_hash(b1.header.get_hash())))