anchor.diff:          {ok, ChainState1} ->
               UnitReturn = {ok, <<0:256>>},
               GasSpent   = 0,         %% Already costs lots of gas
  -            {ok, UnitReturn, GasSpent,
  -             aevm_eeevm_state:set_chain_state(ChainState1, State)};
  +            {ok, UnitReturn, GasSpent, ChainState1};
           {ok, Retval, ChainState1} ->
               GasSpent   = 0,         %% Already costs lots of gas
               Return     = {ok, aeso_data:to_binary(Retval, 0)},
  -            {ok, Return, GasSpent,
  -             aevm_eeevm_state:set_chain_state(ChainState1, State)};
  +            {ok, Return, GasSpent, ChainState1};
           {error, _} = Err -> Err
       end.
   
  
positive.code:       StateOut :: State,
        State :: aevm_eeevm_state:state(),
        ReturnValue :: {ok, binary()} | {error, any()}.
  call(Value, Data, State) ->
      case call_(Value, Data, State) of
          {ok, _, _, _} = Ok ->
              Ok;
          {error, _} = Err ->
              ?TEST_LOG("Primop call error ~p~n~p:~p(~p, ~p, State)",
                        [Err, ?MODULE, ?FUNCTION_NAME, Value, Data]),
  
negative.code:     {error, out_of_gas}.
  
  call_chain1(Callback, State) ->
      Callback(State#chain.api, State#chain.state).
  
  query_chain(Callback, State) ->
      case call_chain1(Callback, State) of
          {ok, Res} ->
              Return = {ok, aeso_data:to_binary(Res, 0)},
              {ok, Return, 0, State#chain.state};
          {error, _} = Err -> Err
      end.
  
  