|
|
@ -20,7 +20,7 @@ defmodule BlockScoutWeb.ExchangeRateChannelTest do |
|
|
|
|
|
|
|
|
|
|
|
ExchangeRates.init([]) |
|
|
|
ExchangeRates.init([]) |
|
|
|
|
|
|
|
|
|
|
|
token = %{ |
|
|
|
token = %Token{ |
|
|
|
available_supply: Decimal.new("1000000.0"), |
|
|
|
available_supply: Decimal.new("1000000.0"), |
|
|
|
total_supply: Decimal.new("1000000.0"), |
|
|
|
total_supply: Decimal.new("1000000.0"), |
|
|
|
btc_value: Decimal.new("1.000"), |
|
|
|
btc_value: Decimal.new("1.000"), |
|
|
@ -89,7 +89,7 @@ defmodule BlockScoutWeb.ExchangeRateChannelTest do |
|
|
|
|
|
|
|
|
|
|
|
receive do |
|
|
|
receive do |
|
|
|
%Phoenix.Socket.Broadcast{topic: ^topic, event: "new_rate", payload: payload} -> |
|
|
|
%Phoenix.Socket.Broadcast{topic: ^topic, event: "new_rate", payload: payload} -> |
|
|
|
assert payload.exchange_rate == token |
|
|
|
assert payload.exchange_rate == Map.from_struct(token) |
|
|
|
assert payload.market_history_data == records |
|
|
|
assert payload.market_history_data == records |
|
|
|
after |
|
|
|
after |
|
|
|
:timer.seconds(5) -> |
|
|
|
:timer.seconds(5) -> |
|
|
|