diff --git a/app/utils/ckb_utils.rb b/app/utils/ckb_utils.rb index f640e3ddc..38c879fb9 100644 --- a/app/utils/ckb_utils.rb +++ b/app/utils/ckb_utils.rb @@ -404,6 +404,26 @@ def self.decode_header_deps(raw_header_deps) # @param [String] output_data # @return [String] cell type def self.cell_type(type_script, output_data) + if (CkbSync::Api.instance.mode == CKB::MODE::TESTNET && type_script&.hash_type == "type") || + (CkbSync::Api.instance.mode == CKB::MODE::MAINNET && type_script&.hash_type == "data1") + if type_script&.code_hash == CkbSync::Api.instance.xudt_code_hash + str = Kredis.string type_script.compute_hash + unless str.value + if OmigaInscriptionInfo.exists?(udt_hash: type_script.compute_hash) + str.value ="omiga_inscription" + else + str.value = "xudt" + end + end + + return str.value + end + + if type_script&.code_hash == CkbSync::Api.instance.omiga_inscription_info_code_hash + return "omiga_inscription_info" + end + end + return "normal" unless ([ Settings.dao_code_hash, Settings.dao_type_hash, Settings.sudt_cell_type_hash, Settings.sudt1_cell_type_hash, CkbSync::Api.instance.issuer_script_code_hash, CkbSync::Api.instance.token_class_script_code_hash, @@ -446,14 +466,6 @@ def self.cell_type(type_script, output_data) "spore_cluster" when *CkbSync::Api.instance.spore_cell_code_hashes "spore_cell" - when CkbSync::Api.instance.omiga_inscription_info_code_hash - "omiga_inscription_info" - when CkbSync::Api.instance.xudt_code_hash - if OmigaInscriptionInfo.where(udt_hash: type_script.compute_hash).exists? - "omiga_inscription" - else - "xudt" - end else if is_nrc_721_token_cell?(output_data) "nrc_721_token"