Skip to content

Commit

Permalink
chore: resolve linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
yaboiishere committed Jan 31, 2025
1 parent 1bae05a commit e231334
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ae_mdw/collection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ defmodule AeMdw.Collection do
def integer_256bit(), do: :integer_256bit
@spec binary() :: :binary
def binary(), do: :binary
@spec gen_range(first :: integer(), last :: integer()) :: {:gen_range, integer(), integer()}
@spec gen_range(first :: term(), last :: term()) :: {:gen_range, term(), term()}
def gen_range(first, last), do: {:gen_range, first, last}

defp get_min_key(:pos_integer), do: 0
Expand Down
5 changes: 3 additions & 2 deletions lib/ae_mdw/db/sync/stats.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ defmodule AeMdw.Db.Sync.Stats do
@typep txi() :: Txs.txi()
@typep interval_by() :: Stats.interval_by()
@typep intervals() :: [{interval_by(), time()}]
@typep tx_tag() :: :transactions | :cumulative_transactions

@start_unix 1_970
@seconds_per_day 3_600 * 24
Expand Down Expand Up @@ -158,8 +159,8 @@ defmodule AeMdw.Db.Sync.Stats do
end
end

@spec generate_tx_statistics(Stats.statistic_tag(), intervals(), type_counts(), pos_integer()) ::
[Stats.statistic()]
@spec generate_tx_statistics(tx_tag(), intervals(), type_counts(), pos_integer()) ::
list({{Stats.statistic_tag(), Stats.interval_by(), time()}, pos_integer()})
def generate_tx_statistics(tag, intervals, type_counts, total_count) do
Enum.flat_map(intervals, fn {interval, interval_start} ->
tx_type_statistics =
Expand Down
1 change: 1 addition & 0 deletions lib/ae_mdw/stats.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ defmodule AeMdw.Stats do
@type blocks_tag() :: {:blocks, :key | :micro | :all}
@type statistic_tag() ::
{:transactions, Node.tx_type() | :all}
| {:cumulative_transactions, Node.tx_type() | :all}
| :names_activated
| :aex9_transfers
| blocks_tag()
Expand Down
3 changes: 3 additions & 0 deletions priv/migrations/20250127121345_populate_cumulative_stats.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
defmodule AeMdw.Migrations.PopulateCumulativeStats do
@moduledoc """
This migration populates the cumulative statistics table from the transaction statistics table. It can be run multiple times without any side effects.
"""
alias AeMdw.Db.DeleteKeysMutation
alias AeMdw.Collection
alias AeMdw.Db.CumulativeStatisticsMutation
Expand Down

0 comments on commit e231334

Please sign in to comment.