From 5948c40605b7241f6f82dfe06e29156af52b64b9 Mon Sep 17 00:00:00 2001 From: Miles Zhang Date: Thu, 19 Oct 2023 13:23:11 +0800 Subject: [PATCH] feat: filter contract of type script Signed-off-by: Miles Zhang --- lib/tasks/migration/generate_referring_cells.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/migration/generate_referring_cells.rake b/lib/tasks/migration/generate_referring_cells.rake index 7414a3d3a..71a0f59c3 100644 --- a/lib/tasks/migration/generate_referring_cells.rake +++ b/lib/tasks/migration/generate_referring_cells.rake @@ -27,7 +27,7 @@ namespace :migration do desc "Usage: RAILS_ENV=production bundle exec rake migration:generate_missed_type_script_contract_referring_cells" task generate_missed_type_script_contract_referring_cells: :environment do - contract_hashes = Contract.pluck(:code_hash) + contract_hashes = Contract.where(role: "type_script").pluck(:code_hash) binary_hashes = CkbUtils.hexes_to_bins(contract_hashes) contract_type_ids = TypeScript.where(code_hash: binary_hashes).pluck(:id) live_cells = CellOutput.live.where(type_script_id: contract_type_ids)