Skip to content

Commit

Permalink
feat: remove deprecated code
Browse files Browse the repository at this point in the history
Signed-off-by: Miles Zhang <[email protected]>
  • Loading branch information
zmcNotafraid committed Dec 5, 2024
1 parent 82dd84f commit 2f4a476
Show file tree
Hide file tree
Showing 27 changed files with 20 additions and 1,721 deletions.
17 changes: 0 additions & 17 deletions app/jobs/import_block_job.rb

This file was deleted.

335 changes: 0 additions & 335 deletions app/jobs/import_transaction_job.rb

This file was deleted.

6 changes: 0 additions & 6 deletions app/jobs/revert_block_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def perform(local_tip_block = nil)
benchmark :recalculate_udt_accounts, udt_type_hashes, local_tip_block
benchmark :update_address_balance_and_ckb_transactions_count, local_tip_block
benchmark :revert_block_rewards, local_tip_block
benchmark :revert_referring_cells, local_tip_block
ForkedEvent.create!(block_number: local_tip_block.number, epoch_number: local_tip_block.epoch,
block_timestamp: local_tip_block.timestamp)
ApplicationRecord.benchmark "BlockStatisticGenerator" do
Expand Down Expand Up @@ -208,9 +207,4 @@ def decrease_records_count(local_tip_block)
normal_transactions = local_tip_block.ckb_transactions.normal
ckb_transaction_counter.decrement!(:count, normal_transactions.count) if normal_transactions.present?
end

def revert_referring_cells(local_tip_block)
tx_ids = local_tip_block.ckb_transaction_ids
ReferringCell.where(ckb_transaction_id: tx_ids).delete_all
end
end
2 changes: 0 additions & 2 deletions app/models/cell_output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class CellOutput < ApplicationRecord
# but one cell may be included by many pending transactions,
# the cell_inputs won't always be the same as `consumed_by`.`cell_inputs`
has_many :cell_inputs, foreign_key: :previous_cell_output_id
# belongs_to :deployed_cell, optional: true
# has_many :referring_cells
# the block_id is actually the same as ckb_transaction.block_id, must be on chain
# but one cell may be included by pending transactions, so block_id may be null
belongs_to :block, optional: true
Expand Down
Loading

0 comments on commit 2f4a476

Please sign in to comment.