anchor.diff:      end.
   
   get_top(NodeName) ->
  -    {ok, 200, Top} = request(NodeName, 'GetTopBlock', #{}),
  +    Top = verify(200, request(NodeName, 'GetTopBlock', #{})),
       case Top of
           #{key_block := KeyBlock} -> KeyBlock;
           #{micro_block := MicroBlock} -> MicroBlock
       end.
   
   get_mempool(NodeName) ->
  -    {ok, 200, Txs} = request(NodeName, 'GetPendingTransactions', #{}),
  +    Txs = verify(200, request(NodeName, 'GetPendingTransactions', #{})),
       case {maps:get(<<"transactions">>, Txs, undefined),
             maps:get(transactions, Txs, undefined)} of
           {undefined, Mempool} -> Mempool; %% future proof
  
positive.code:     {ok, Tx} = aec_spend_tx:new(Params),
      SignedTx = aec_test_utils:sign_tx(Tx, SendSecKey),
      SerSignTx = aetx_sign:serialize_to_binary(SignedTx),
      {ok, 200, Response} =
          request(Node, 'PostTransaction', #{ tx => aec_base58c:encode(transaction, SerSignTx) }),
      Response.
  
  post_create_state_channel_tx(Node, Initiator, Responder, #{nonce := Nonce} = Map) ->
      #{ pubkey := InPubKey, privkey := InSecKey } = Initiator,
  
negative.code: 
              end
      end.
  
  verify(Code, {ok, Code, Result}) ->
      Result;
  verify(_Code, {ok, Other, Result}) ->
      erlang:error({unexpected_response, Other, Result});
  verify(_Code, Other) ->
      erlang:error({request_error, Other}).
  