From 8705f136834f480ae62ce4af68523c19386906a2 Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Tue, 7 May 2024 20:41:09 +0800 Subject: [PATCH] feat: ignore nrc 721 verified attribute (#1834) * feat: ignore nrc 721 verified attribute Signed-off-by: Miles Zhang * test: fix test Signed-off-by: Miles Zhang --------- Signed-off-by: Miles Zhang --- app/models/concerns/cell_outputs/extra_info.rb | 5 ++--- test/services/charts/daily_statistic_generator_test.rb | 7 +------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/models/concerns/cell_outputs/extra_info.rb b/app/models/concerns/cell_outputs/extra_info.rb index fc8c792e9..4a3761d78 100644 --- a/app/models/concerns/cell_outputs/extra_info.rb +++ b/app/models/concerns/cell_outputs/extra_info.rb @@ -63,20 +63,19 @@ def nrc_721_nft_info code_hash: factory_cell_type_script.code_hash, hash_type: factory_cell_type_script.hash_type, args: factory_cell_type_script.args, - verified: true, ) value = { symbol: factory_cell&.symbol, amount: udt_amount, decimal: "", type_hash:, - published: factory_cell&.verified, + published: true, display_name: factory_cell&.name, uan: "", } when "nrc_721_token" udt = Udt.find_by(type_hash:) - factory_cell = NrcFactoryCell.where(id: udt.nrc_factory_cell_id, verified: true).first + factory_cell = NrcFactoryCell.where(id: udt.nrc_factory_cell_id).first udt_account = UdtAccount.where(udt_id: udt.id).first value = { symbol: factory_cell&.symbol, diff --git a/test/services/charts/daily_statistic_generator_test.rb b/test/services/charts/daily_statistic_generator_test.rb index 35eb9dede..ce833e7be 100644 --- a/test/services/charts/daily_statistic_generator_test.rb +++ b/test/services/charts/daily_statistic_generator_test.rb @@ -17,17 +17,12 @@ class DailyStatisticGeneratorTest < ActiveSupport::TestCase @daily_dao_withdraw = DaoEvent.processed.withdraw_from_dao.created_after(@started_at).created_before(@ended_at).sum(:value) @current_tip_block = Block.created_after(@started_at).created_before(@ended_at).recent.first || Block.recent.first - aggron_first_day = - begin - genesis_block_timestamp = Block.find_by(number: 0).timestamp - ENV["CKB_NET_MODE"] == "testnet" && to_be_counted_date.beginning_of_day.to_i == Time.at(genesis_block_timestamp / 1000).in_time_zone.beginning_of_day.to_i - end @yesterday_daily_statistic ||= begin yesterday_statistic = ::DailyStatistic.where( "created_at_unixtimestamp < ?", to_be_counted_date.beginning_of_day.to_i ).recent.first - if to_be_counted_date.beginning_of_day.to_i == Time.at(GENESIS_TIMESTAMP / 1000).in_time_zone.beginning_of_day.to_i || aggron_first_day.present? || yesterday_statistic.blank? + if to_be_counted_date.beginning_of_day.to_i == Time.at(GENESIS_TIMESTAMP / 1000).in_time_zone.beginning_of_day.to_i || yesterday_statistic.blank? OpenStruct.new(addresses_count: 0, total_dao_deposit: 0, dao_depositors_count: 0, unclaimed_compensation: 0, claimed_compensation: 0, average_deposit_time: 0, mining_reward: 0, deposit_compensation: 0, treasury_amount: 0, total_depositors_count: 0, live_cells_count: 0, dead_cells_count: 0, occupied_capacity: 0) else