From 0d1e87011bb0718bbf8162be66dc5e913d42cd4e Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Thu, 22 Feb 2024 21:28:23 +0800 Subject: [PATCH] chore: debug for TokenTransferDetectWorker Signed-off-by: Miles Zhang --- app/workers/token_transfer_detect_worker.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/workers/token_transfer_detect_worker.rb b/app/workers/token_transfer_detect_worker.rb index 026aba969..da8aa94fe 100644 --- a/app/workers/token_transfer_detect_worker.rb +++ b/app/workers/token_transfer_detect_worker.rb @@ -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) @@ -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 @@ -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 = {