From f743f40fb5390c5568bd27ea8e04be90d346d974 Mon Sep 17 00:00:00 2001 From: Rabbit Date: Thu, 4 Apr 2024 01:43:50 +0800 Subject: [PATCH] chore: display_cells add xudt info (#1743) --- app/models/concerns/ckb_transactions/display_cells.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/models/concerns/ckb_transactions/display_cells.rb b/app/models/concerns/ckb_transactions/display_cells.rb index f0cedb48c..d735c3f93 100644 --- a/app/models/concerns/ckb_transactions/display_cells.rb +++ b/app/models/concerns/ckb_transactions/display_cells.rb @@ -103,6 +103,9 @@ def normal_tx_display_inputs(cell_inputs_for_display) if previous_cell_output.udt? display_input.merge!(attributes_for_udt_cell(previous_cell_output)) end + if previous_cell_output.xudt? + display_input.merge!(attributes_for_xudt_cell(previous_cell_output)) + end if previous_cell_output.cell_type.in?(%w(m_nft_issuer m_nft_class m_nft_token)) display_input.merge!(attributes_for_m_nft_cell(previous_cell_output)) end @@ -134,6 +137,7 @@ def normal_tx_display_outputs(cell_outputs_for_display) } display_output.merge!(attributes_for_udt_cell(output)) if output.udt? + display_output.merge!(attributes_for_xudt_cell(output)) if output.xudt? display_output.merge!(attributes_for_cota_registry_cell(output)) if output.cota_registry? display_output.merge!(attributes_for_cota_regular_cell(output)) if output.cota_regular? if output.cell_type.in?(%w(m_nft_issuer m_nft_class m_nft_token)) @@ -215,6 +219,11 @@ def attributes_for_rgb_cell(rgb_cell) { rgb_info: rgb_cell.rgb_info } end + def attributes_for_xudt_cell(xudt_cell) + info = CkbUtils.hash_value_to_s(xudt_cell.udt_info) + { xudt_info: info, extra_info: info } + end + def hex_since(int_since_value) "0x#{int_since_value.to_s(16).rjust(16, '0')}" end