Skip to content

Commit

Permalink
fix: spore cluster cell and spore cell may exist in same block and al… (
Browse files Browse the repository at this point in the history
#2277)

fix: spore cluster cell and spore cell may exist in same block and all pending

Signed-off-by: Miles Zhang <[email protected]>
  • Loading branch information
zmcNotafraid authored Nov 10, 2024
1 parent 472a5d4 commit e9cecdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/ckb_sync/new_node_data_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def build_udts!(local_block, outputs, outputs_data)
binary_hashes = CkbUtils.hexes_to_bins_sql(CkbSync::Api.instance.spore_cluster_code_hashes)
spore_cluster_type_ids = TypeScript.where("code_hash IN (#{binary_hashes})").where(hash_type: "data1", args: parsed_spore_cell[:cluster_id]).pluck(:id)
if spore_cluster_type_ids.present?
spore_cluster_cell = CellOutput.live.where(type_script_id: spore_cluster_type_ids).last
spore_cluster_cell = CellOutput.where(type_script_id: spore_cluster_type_ids, status: %i[pending live]).last
parsed_cluster_data = CkbUtils.parse_spore_cluster_data(spore_cluster_cell.data)
nft_token_attr[:full_name] = parsed_cluster_data[:name]
end
Expand Down

0 comments on commit e9cecdc

Please sign in to comment.