Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add parse deps log #1501

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/models/cell_output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ def self.find_by_pointer(tx_hash, index)
race_condition_ttl: 10.seconds,
expires_in: 1.day) do
tx_id = CkbTransaction.find_by_tx_hash(tx_hash)&.id

Rails.logger.info("find_by_pointer: tx_hash: #{tx_hash}, index: #{index}, tx_id: #{tx_id}")
find_by(ckb_transaction_id: tx_id, cell_index: index.is_a?(String) ? index.hex : index) if tx_id
end
end
Expand Down
2 changes: 2 additions & 0 deletions app/models/deployed_cell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def self.create_initial_data(ckb_transaction_id = 0)

def self.create_initial_data_for_ckb_transaction(ckb_transaction, cell_deps)
return if cell_deps.blank?
Rails.logger.info("create cell deps cell_deps: #{cell_deps}")

deployed_cells = []
cell_dependencies_attrs = []
Expand All @@ -66,6 +67,7 @@ def self.create_initial_data_for_ckb_transaction(ckb_transaction, cell_deps)
parse_code_dep =
->(cell_dep) do
# this cell output is the contract cell, i.e. one of deployed cells of the contract
Rails.logger.info("parse_code_dep cell_dep: #{cell_dep}")
cell_output = CellOutput.find_by_pointer cell_dep["out_point"]["tx_hash"], cell_dep["out_point"]["index"]

attr = {
Expand Down