Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Update websocket_client lib to match blockscout upstream. #931

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/helm_deploy_dispatch.yml
Original file line number Diff line number Diff line change
@@ -26,10 +26,10 @@ on:
- diff
- apply
use-branch-commit:
description: 'Select to use the commit of the branch as the container image tag'
description: 'Deploy branch HEAD? (instead of values.yaml sha)'
required: true
type: boolean
default: false
default: true
change-cause:
description: 'The change cause to use for the deployment'
required: false
2 changes: 1 addition & 1 deletion apps/block_scout_web/mix.exs
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@ defmodule BlockScoutWeb.Mixfile do
{:timex, "~> 3.7.1"},
{:wallaby, "~> 0.30", only: :test, runtime: false},
# `:cowboy` `~> 2.0` and Phoenix 1.4 compatibility
{:websocket_client, "~> 1.3"},
{:websocket_client, git: "https://github.com/blockscout/websocket_client.git", branch: "master", override: true},
{:wobserver, "~> 0.2.0", github: "poanetwork/wobserver", branch: "support-https"},
{:ex_json_schema, "~> 0.9.1"},
{:ueberauth, "~> 0.7"},
Original file line number Diff line number Diff line change
@@ -104,20 +104,20 @@ defmodule EthereumJSONRPC.WebSocket.WebSocketClient do
@impl WebSocket
@spec json_rpc(WebSocket.web_socket(), Transport.request()) :: {:ok, Transport.result()} | {:error, reason :: term()}
def json_rpc(web_socket, request) do
GenServer.call(web_socket, {:json_rpc, request})
GenServer.call(web_socket, {:gen_call, {:json_rpc, request}})
end

@impl WebSocket
@spec subscribe(WebSocket.web_socket(), Subscription.event(), Subscription.params()) ::
{:ok, Subscription.t()} | {:error, reason :: term()}
def subscribe(web_socket, event, params) when is_binary(event) and is_list(params) do
GenServer.call(web_socket, {:subscribe, event, params})
GenServer.call(web_socket, {:gen_call, {:subscribe, event, params}})
end

@impl WebSocket
@spec unsubscribe(WebSocket.web_socket(), Subscription.t()) :: :ok | {:error, :not_found}
def unsubscribe(web_socket, %Subscription{} = subscription) do
GenServer.call(web_socket, {:unsubscribe, subscription})
GenServer.call(web_socket, {:gen_call, {:unsubscribe, subscription}})
end

@impl :websocket_client
@@ -158,7 +158,7 @@ defmodule EthereumJSONRPC.WebSocket.WebSocketClient do
end

@impl :websocket_client
def websocket_info({:"$gen_call", from, request}, _, %__MODULE__{} = state) do
def websocket_info({{:gen_call, request}, from}, _, %__MODULE__{} = state) do
case handle_call(request, from, state) do
{:reply, _, %__MODULE__{}} = reply -> reply
{:noreply, %__MODULE__{} = new_state} -> {:ok, new_state}
2 changes: 1 addition & 1 deletion apps/ethereum_jsonrpc/mix.exs
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ defmodule EthereumJsonrpc.MixProject do
# `:verify_fun` for `Socket.Web.connect`
{:ssl_verify_fun, "~> 1.1"},
# `EthereumJSONRPC.WebSocket`
{:websocket_client, "~> 1.3"},
{:websocket_client, git: "https://github.com/blockscout/websocket_client.git", branch: "master", override: true},
{:decimal, "~> 2.0"},
{:decorator, "~> 1.4"},
{:hackney, "~> 1.18"},
Original file line number Diff line number Diff line change
@@ -55,6 +55,8 @@ defmodule Indexer.Fetcher.CeloEpochDataTest do
}
end

# skip flaky test
@tag :skip
describe "async_fetch for voter rewards" do
setup [:save_voter_contract_events_and_start_fetcher, :setup_votes_mox]

@@ -81,6 +83,8 @@ defmodule Indexer.Fetcher.CeloEpochDataTest do
end
end

# skip flaky test
@tag :skip
describe "async_fetch for epoch rewards" do
setup [:save_voter_contract_events_and_start_fetcher, :setup_votes_mox, :setup_epoch_mox]

2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
@@ -168,7 +168,7 @@
"uuid": {:hex, :uuid, "1.1.8", "e22fc04499de0de3ed1116b770c7737779f226ceefa0badb3592e64d5cfb4eb9", [:mix], [], "hexpm", "c790593b4c3b601f5dc2378baae7efaf5b3d73c4c6456ba85759905be792f2ac"},
"wallaby": {:hex, :wallaby, "0.30.1", "81342a34080867ab359aca23de4d1d8c6bbdeb35d8ce2a8c42e42b758d539963", [:mix], [{:ecto_sql, ">= 3.0.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}, {:httpoison, "~> 0.12 or ~> 1.0", [hex: :httpoison, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix_ecto, ">= 3.0.0", [hex: :phoenix_ecto, repo: "hexpm", optional: true]}, {:web_driver_client, "~> 0.2.0", [hex: :web_driver_client, repo: "hexpm", optional: false]}], "hexpm", "457251df6a94ff80816524136edbce6400cb1ee979586c90224ff634e9543d78"},
"web_driver_client": {:hex, :web_driver_client, "0.2.0", "63b76cd9eb3b0716ec5467a0f8bead73d3d9612e63f7560d21357f03ad86e31a", [:mix], [{:hackney, "~> 1.6", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:tesla, "~> 1.3", [hex: :tesla, repo: "hexpm", optional: false]}], "hexpm", "83cc6092bc3e74926d1c8455f0ce927d5d1d36707b74d9a65e38c084aab0350f"},
"websocket_client": {:hex, :websocket_client, "1.5.0", "e825f23c51a867681a222148ed5200cc4a12e4fb5ff0b0b35963e916e2b5766b", [:rebar3], [], "hexpm", "2b9b201cc5c82b9d4e6966ad8e605832eab8f4ddb39f57ac62f34cb208b68de9"},
"websocket_client": {:git, "https://github.com/blockscout/websocket_client.git", "0b4ecc5b1fb8a0bd1c8352728da787c20add53aa", [branch: "master"]},
"wobserver": {:git, "https://github.com/poanetwork/wobserver.git", "13bcda30a87f4f0be1878920a79433ad831eefbe", [branch: "support-https"]},
"yamerl": {:hex, :yamerl, "0.4.0", "ae215b1242810a9bc07716b88062f1bfe06f6bc7cf68372091f630baa536df79", [:rebar3], [], "hexpm", "dc366040a046736578f5e89f069fba4c545ad672e463a83e74e1d9d5a599fd4c"},
"yaml_elixir": {:hex, :yaml_elixir, "1.0.0", "a0b703148aa8926a08fc14619c83e9cdf7555ff7e8bb9e74c08aa716eaf8c609", [:mix], [], "hexpm", "8d318d459561678bbe42bdcc7282ebe9dd7538f34045812054edf226634bf4a7"},