anchor.diff:  end_per_suite(_Config) ->
       ok.
   
  +init_per_group(continuous_sc_ws, Config) ->
  +    sc_ws_open_(Config);
   init_per_group(all, Config) ->
       Config;
   init_per_group(Group, Config) when
  
positive.code:          responder,
           initiator,
           responder]),
      {save_config, ConfigList}.
  
  sc_ws_update_fails_and_close(Config) ->
      {sc_ws_open, ConfigList} = ?config(saved_config, Config),
      Participants = proplists:get_value(participants, Config),
      #{initiator := IConnPid, responder :=RConnPid} = Conns =
          proplists:get_value(channel_clients, ConfigList),
      lists:foreach(
          fun(Sender) ->
              LogPid = maps:get(Sender, Conns),
              ?WS:log(LogPid, info, "Failing update, insufficient balance"),
              {ok, #{<<"reason">> := <<"insufficient_balance">>,
                    <<"request">> := _Request0}} = channel_update_fail(
                                                     Conns, Sender,
                                                     Participants, 10000000, Config),
              ?WS:log(LogPid, info, "Failing update, negative amount"),
              {ok, #{<<"reason">> := <<"negative_amount">>,
                    <<"request">> := _Request1}} = channel_update_fail(
                                                     Conns, Sender,
                                                     Participants, -1, Config),
              ?WS:log(LogPid, info, "Failing update, invalid pubkeys"),
              {ok, #{<<"reason">> := <<"invalid_pubkeys">>,
                    <<"request">> := _Request2}} =
                  channel_update_fail(Conns, Sender,
                                      #{initiator => #{pub_key => <<42:32/unit:8>>},
                                        responder => #{pub_key => <<43:32/unit:8>>}},
                                      1, Config),
              ok
          end,
          [initiator, responder]),
      ok = ?WS:stop(IConnPid),
      ok = ?WS:stop(RConnPid),
      ok.
  
  sc_ws_send_messages_and_close(Config) ->
      {sc_ws_open, ConfigList} = ?config(saved_config, Config),
      #{initiator := #{pub_key := IPubkey},
        responder := #{pub_key := RPubkey}} = proplists:get_value(participants, Config),
      #{initiator := IConnPid, responder :=RConnPid} =
          proplists:get_value(channel_clients, ConfigList),
  
      lists:foreach(
          fun({Sender, Msg}) ->
              {SenderPubkey, ReceiverPubkey, SenderPid, ReceiverPid} =
                  case Sender of
                      initiator ->
                          {IPubkey, RPubkey, IConnPid, RConnPid};
                      responder ->
                          {RPubkey, IPubkey, RConnPid, IConnPid}
                  end,
                  SenderEncodedK = aehttp_api_encoder:encode(account_pubkey, SenderPubkey),
                  ReceiverEncodedK = aehttp_api_encoder:encode(account_pubkey, ReceiverPubkey),
                  ok = ?WS:register_test_for_channel_event(ReceiverPid, message),
  
                  ws_send(SenderPid, <<"message">>,
                          #{<<"to">> => ReceiverEncodedK,
                            <<"info">> => Msg}, Config),
  
                  {ok, #{<<"message">> := #{<<"from">> := SenderEncodedK,
                                            <<"to">> := ReceiverEncodedK,
                                            <<"info">> := Msg}}}
                      = wait_for_channel_event(ReceiverPid, message, Config),
                  ok = ?WS:unregister_test_for_channel_event(ReceiverPid, message)
          end,
        [ {initiator, <<"hejsan">>}                   %% initiator can send
        , {responder, <<"svejsan">>}                  %% responder can send
        , {initiator, <<"first message in a row">>}   %% initiator can send two messages in a row
        , {initiator, <<"second message in a row">>}
        , {responder, <<"some message">>}             %% responder can send two messages in a row
        , {responder, <<"other message">>}
        ]),
  
      ok = ?WS:stop(IConnPid),
      ok = ?WS:stop(RConnPid),
      ok.
  
  sc_ws_conflict_and_close(Config) ->
      {sc_ws_open, ConfigList} = ?config(saved_config, Config),
      Participants = proplists:get_value(participants, Config),
      #{initiator := IConnPid, responder :=RConnPid} = Conns =
          proplists:get_value(channel_clients, ConfigList),
  
      lists:foreach(
          fun(FirstSender) ->
                  channel_conflict(Conns, FirstSender, Participants, 1, 2, Config)
          end,
          [initiator,
           responder]),
  
      ok = ?WS:stop(IConnPid),
      ok = ?WS:stop(RConnPid),
      ok.
  
  channel_conflict(#{initiator := IConnPid, responder :=RConnPid},
  
negative.code:       priv_key:= AckPrivkey} = maps:get(AckRole, Participants),
      SenderConnPid = maps:get(SenderRole, Clients),
      AckConnPid = maps:get(AckRole, Clients),
      ok = ?WS:register_test_for_channel_events(SenderConnPid, [sign, info, get, error]),
      ok = ?WS:register_test_for_channel_events(AckConnPid, [sign, info, get, error]),
      SenderConnPid = maps:get(SenderRole, Clients),
      AckConnPid = maps:get(AckRole, Clients),
      %% helper lambda for update
  