Skip to content

Commit

Permalink
feat: filter udt and tokencollection by block_timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbitz committed Dec 19, 2024
1 parent 8def4fd commit 3cd2dcd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/workers/generate_rgbpp_assets_statistic_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ def perform(datetime = nil)
private

def ft_count_attributes
xudts_count = Udt.published_xudt.where(created_at: ..ended_at).count
timestamp = CkbUtils.time_in_milliseconds(ended_at) - 1
xudts_count = Udt.published_xudt.where(block_timestamp: ..timestamp).count
{ indicator: "ft_count", value: xudts_count, network: "global" }
end

def dob_count_attributes
timestamp = CkbUtils.time_in_milliseconds(ended_at) - 1
token_collections_count = TokenCollection.where("tags && ARRAY[?]::varchar[]", ["rgb++"]).
where(created_at: ..ended_at).count
where(block_timestamp: ..timestamp).count
{ indicator: "dob_count", value: token_collections_count, network: "global" }
end

Expand Down

0 comments on commit 3cd2dcd

Please sign in to comment.