anchor.diff:               meck:expect(
                  aec_headers, difficulty,
                  fun(#header{target = T}) when is_integer(T) -> float(T) end),
  -             {ok, Pid} = aec_chain:start_link(
  -                           fake_genesis_block_with_difficulty()),
  -             aec_state:start_link(),
  -             Pid
  -     end,
  -     fun(_ChainPid) ->
  +             {ok, _} = aec_chain:start_link(
  +                         fake_genesis_block_with_difficulty()),
  +             {ok, _} = aec_state:start_link(),
  +             ok
  +     end,
  +     fun(_) ->
                ok = aec_state:stop(),
  +             ok = aec_chain:stop(),
                ?assert(meck:validate(aec_headers)),
  -             meck:unload(aec_headers),
  -             ok = aec_chain:stop()
  +             meck:unload(aec_headers)
        end,
        [{"Get work in chain of only genesis",
          fun() ->
  
positive.code: 
  top_test_() ->
      {foreach,
       fun() -> {ok, Pid} = aec_chain:start_link(genesis_block()),
                aec_state:start_link(), Pid end,
       fun(_ChainPid) -> ok = aec_chain:stop(), ok = aec_state:stop() end,
       [{"Initialize chain with genesis block, then check top block with related state trees",
         fun() ->
                 GB = genesis_block(),
  
negative.code: %% Cover unhappy paths not covered in any other tests.
  unhappy_paths_test_() ->
      {foreach,
       fun() ->
               {ok, _} = aec_chain:start_link(genesis_block()),
               {ok, _} = aec_state:start_link(),
               ok
       end,
       fun(_) ->
               ok = aec_state:stop(),
               ok = aec_chain:stop()
       end,
       [{"Get header by hash - case not found",
         fun() ->
                 %% Check chain is at genesis.
  