@@ -84,7 +84,10 @@ def query
8484 CkbTransaction . recent . normal . page ( @page ) . per ( @page_size ) . fast_page
8585 end
8686
87- includes = { :cell_inputs => { :previous_cell_output => { :type_script => [ ] , :bitcoin_vout => [ ] , :lock_script => [ ] } , :block => [ ] } , :cell_outputs => { } , :bitcoin_annotation => [ ] , :account_books => { } }
87+ includes = { bitcoin_annotation : [ ] ,
88+ cell_outputs : [ :address , :deployed_contract , :type_script , :bitcoin_vout , :lock_script ] ,
89+ cell_inputs : [ :block , previous_cell_output : [ :address , :deployed_contract , :type_script , :bitcoin_vout , :lock_script ] ] }
90+
8891 ckb_transactions = ckb_transactions . includes ( includes ) . select ( :id , :tx_hash , :block_id , :tags ,
8992 :block_number , :block_timestamp , :is_cellbase , :updated_at , :created_at )
9093 json =
@@ -139,7 +142,15 @@ def validate_query_params
139142 end
140143
141144 def find_transaction
142- @ckb_transaction = CkbTransaction . where ( tx_hash : params [ :id ] ) . order ( tx_status : :asc ) . first
145+
146+ includes = { bitcoin_annotation : [ ] ,
147+ witnesses : [ ] ,
148+ block : [ :epoch_statistic ] ,
149+ cell_dependencies : [ :cell_output , :contract ] ,
150+ cell_outputs : [ :address , :deployed_contract , :type_script , :bitcoin_vout , :lock_script ] ,
151+ cell_inputs : [ :block , previous_cell_output : [ :address , :deployed_contract , :type_script , :bitcoin_vout , :lock_script ] ] }
152+
153+ @ckb_transaction = CkbTransaction . includes ( includes ) . where ( tx_hash : params [ :id ] ) . first
143154 raise Api ::V1 ::Exceptions ::CkbTransactionNotFoundError if @ckb_transaction . blank?
144155 end
145156 end
0 commit comments