def test_get_work_from_slave(self):
    genesis = Address.create_empty_account(full_shard_key=0)
    with ClusterContext(1, genesis, remote_mining=True) as clusters:
        slaves = clusters[0].slave_list
        state = clusters[0].get_shard_state((2 | 0))
        branch = state.create_block_to_mine().header.branch
        work = call_async(slaves[0].get_work(branch))
        self.assertEqual(work.difficulty, 10)
        state.shard_config.POSW_CONFIG.ENABLED = True
        state.shard_config.POSW_CONFIG.TOTAL_STAKE_PER_BLOCK = 500000
        work = call_async(slaves[0].get_work(branch))
        self.assertEqual(work.difficulty, 0)
def test_get_work_from_slave(self):
    genesis = Address.create_empty_account(full_shard_key=0)
    with ClusterContext(1, genesis, remote_mining=True) as clusters:
        slaves = clusters[0].slave_list
        state = clusters[0].get_shard_state((2 | 0))
        branch = state.create_block_to_mine().header.branch
        work = call_async(slaves[0].get_work(branch))
        self.assertEqual(work.difficulty, 10)
        state.shard_config.POSW_CONFIG.ENABLED = True
        state.shard_config.POSW_CONFIG.TOTAL_STAKE_PER_BLOCK = 500000
        work = call_async(slaves[0].get_work(branch))
        self.assertEqual(work.difficulty, 0)