4
0
Fork 0

Removed the seconds delay parameter

new-events
hswick 6 years ago
parent 77d98d4506
commit 6529f49420
  1. 10
      lib/exw3.ex
  2. 2
      test/exw3_test.exs

@ -471,12 +471,12 @@ defmodule ExW3 do
)
end
@spec get_filter_changes(binary(), integer()) :: {:ok, []}
@spec get_filter_changes(binary()) :: {:ok, []}
@doc "Using saved information related to the filter id, event logs are formatted properly"
def get_filter_changes(filter_id, seconds \\ 0) do
def get_filter_changes(filter_id) do
GenServer.call(
ContractManager,
{:get_filter_changes, {filter_id, seconds}}
{:get_filter_changes, filter_id}
)
end
@ -807,9 +807,7 @@ defmodule ExW3 do
{:reply, {:ok, filter_id}, Map.put(state, :filters, Map.put(state[:filters], filter_id, %{contract_name: contract_name, event_name: event_name}))}
end
def handle_call({:get_filter_changes, {filter_id, seconds}}, _from, state) do
:timer.sleep(1000 * seconds)
def handle_call({:get_filter_changes, filter_id}, _from, state) do
filter_info = Map.get(state[:filters], filter_id)
event_attributes = get_event_attributes(state, filter_info[:contract_name], filter_info[:event_name])

@ -302,7 +302,7 @@ defmodule EXW3Test do
)
# Demonstrating the delay capability
{:ok, change_logs} = ExW3.Contract.get_filter_changes(indexed_filter_id, 1)
{:ok, change_logs} = ExW3.Contract.get_filter_changes(indexed_filter_id)
event_log = Enum.at(change_logs, 0)
assert event_log |> is_map

Loading…
Cancel
Save