Skip to content

Commit

Permalink
Issue 548 3 (#1646)
Browse files Browse the repository at this point in the history
chore: debug for TokenTransferDetectWorker

Signed-off-by: Miles Zhang <[email protected]>
  • Loading branch information
zmcNotafraid authored Feb 22, 2024
1 parent e929082 commit 35dfa27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/workers/token_transfer_detect_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ class TokenTransferDetectWorker

def perform(tx_id)
tx = CkbTransaction.includes(:cell_outputs, cell_inputs: :previous_cell_output).find tx_id
puts "==================#{tx.inspect}"
return unless tx

@lock = Redis::Lock.new("token_transfer_#{tx_id}", expiration: 180, timeout: 30)
Expand All @@ -11,6 +12,7 @@ def perform(tx_id)
source_collections = []

tx.cell_inputs.each do |input|
puts input.cell_type
if input.cell_type.in?(%w(m_nft_token nrc_721_token spore_cell))
cell = input.previous_cell_output
type_script = input.type_script
Expand All @@ -20,7 +22,9 @@ def perform(tx_id)
end

tx.cell_outputs.each do |output|
puts output.cell_type
if output.cell_type.in?(%w(m_nft_token nrc_721_token spore_cell))
puts "========================#{output.id}"
type_script = output.type_script
item = find_or_create_item(output, type_script)
attrs = {
Expand Down

0 comments on commit 35dfa27

Please sign in to comment.