Skip to content

Commit

Permalink
fix: cal pending output balance occupied (#1630)
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbitz authored Feb 20, 2024
1 parent 78e3feb commit 6a85a00
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/jobs/import_transaction_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ def perform(tx_hash, extra_data = {})
tx_hash:,
cell_index: index,
)

# after the cell is created, create a datum
if output_data.present? && output_data != "0x"
(cell.cell_datum || cell.build_cell_datum).update(data: [output_data[2..]].pack("H*"))
end

cell.lock_script = lock
cell.type_script = t
cell.update!(
Expand All @@ -105,10 +111,6 @@ def perform(tx_hash, extra_data = {})
status: "pending",
)
puts "output cell created tx_hash: #{tx_hash}, index: #{index}, cell_id: #{cell.id}"
# after the cell is created, create a datum
if output_data.present? && output_data != "0x"
(cell.cell_datum || cell.build_cell_datum).update(data: [output_data[2..]].pack("H*"))
end

process_output cell
process_deployed_cell(cell.lock_script)
Expand Down

0 comments on commit 6a85a00

Please sign in to comment.