anchor.diff:  %% Cover unhappy paths not covered in any other tests.
   unhappy_paths_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,
  +     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.
  
positive.code: 
  block_chain_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,
       [{"Build chain with genesis block plus 2 headers, then store block corresponding to top header",
         fun() ->
                 %% Check chain is at genesis.
  
negative.code:              meck:expect(
                 aec_blocks, difficulty,
                 fun(#block{target = T}) when is_integer(T) -> float(T) end),
               {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_blocks)),
               ?assert(meck:validate(aec_headers)),
               meck:unload(aec_blocks),
  