anchor.diff:        end
        ]}.
   
  +wait_for_idle() ->
  +    aec_test_utils:wait_for_it(
  +      fun() ->
  +              {State, _} = sys:get_state(?TEST_MODULE),
  +              State
  +      end, idle).
  +
   wait_for_running() ->
       aec_test_utils:wait_for_it(
         fun() ->
  
positive.code:                        ?show_miner_state(),
                         ?assertEqual(ok, ?TEST_MODULE:suspend()),
                         ?show_miner_state(),
                         aec_test_utils:wait_for_it(
                           fun() ->
                                   {State, _} = sys:get_state(?TEST_MODULE),
                                   (State =:= idle)
                           end, true),
                         ?assertEqual(ok, ?TEST_MODULE:resume()),
                         ?show_miner_state(),
                         ?TEST_MODULE:resume(),
  
negative.code:                {"Run miner for a while",
                  fun() ->
                          ?assertEqual(ok, ?TEST_MODULE:suspend()),
                          wait_for_idle(),
                          meck:new(aec_chain, [passthrough]),
                          TestPid = self(),
                          meck:expect(
  