Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Hardcode numbers until we can set them through a diff (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrchatruc authored Sep 27, 2023
1 parent 797eeca commit ebedfd9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
15 changes: 6 additions & 9 deletions lib/starknet_explorer/counts.ex
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
defmodule StarknetExplorer.Counts do
use Ecto.Schema
import Ecto.Query
# alias StarknetExplorer.Events
# alias StarknetExplorer.Message
# alias StarknetExplorer.Transaction
alias StarknetExplorer.Events
alias StarknetExplorer.Message
alias StarknetExplorer.Transaction
alias StarknetExplorer.{Counts, BlockUtils}
alias StarknetExplorer.Repo

Expand All @@ -27,12 +27,9 @@ defmodule StarknetExplorer.Counts do

def insert_or_update(network) do
{:ok, blocks} = BlockUtils.block_height(network)
# transactions = Transaction.get_total_count(network)
transactions = 0
# messages = Message.get_total_count(network)
messages = 0
# events = Events.get_total_count(network)
events = 0
transactions = Transaction.get_total_count(network)
messages = Message.get_total_count(network)
events = Events.get_total_count(network)

case Repo.get_by(Counts, network: Atom.to_string(network)) do
# Count exists, let's use it
Expand Down
6 changes: 3 additions & 3 deletions lib/starknet_explorer/data.ex
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ defmodule StarknetExplorer.Data do

if counts do
Map.new()
|> Map.put(:message_count, counts.messages)
|> Map.put(:events_count, counts.events)
|> Map.put(:transaction_count, counts.transactions)
|> Map.put(:message_count, 37458)
|> Map.put(:events_count, 11_450_689)
|> Map.put(:transaction_count, 2_134_955)
|> Map.put(:block_count, counts.blocks)
else
Map.new()
Expand Down

0 comments on commit ebedfd9

Please sign in to comment.