Skip to content

Commit d039dd9

Browse files
authored
Merge pull request #2573 from nervosnetwork/testnet
Deploy to mainnet
2 parents f6cda10 + 5dce251 commit d039dd9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

app/interactions/graph_nodes/transactions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Transactions < ActiveInteraction::Base
2020
def execute
2121
channels = FiberGraphChannel.with_deleted
2222
channels = channels.where(node1: node_id).or(channels.where(node2: node_id))
23-
return FiberGraphChannel.none if channels.empty?
23+
return Kaminari.paginate_array([]).page(page).per(page_size) if channels.empty?
2424

2525
channels = filter_by_address(channels)
2626
channels = filter_by_type_hash(channels)

app/models/concerns/ckb_transactions/display_cells.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ def normal_tx_display_inputs(cell_inputs_for_display)
130130
if previous_cell_output.cell_type.in?(%w(spore_cluster spore_cell did_cell))
131131
display_input.merge!(attributes_for_dob_cell(previous_cell_output))
132132
end
133+
if previous_cell_output.lock_script.code_hash == Settings.fiber_funding_code_hash
134+
display_input.merge!(attributes_for_fiber_cell(previous_cell_output))
135+
end
133136

134137
CkbUtils.hash_value_to_s(display_input)
135138
end
@@ -172,6 +175,9 @@ def normal_tx_display_outputs(cell_outputs_for_display)
172175
if output.cell_type.in?(%w(spore_cluster spore_cell did_cell))
173176
display_output.merge!(attributes_for_dob_cell(output))
174177
end
178+
if output.lock_script.code_hash == Settings.fiber_funding_code_hash
179+
display_output.merge!(attributes_for_fiber_cell(output))
180+
end
175181

176182
CkbUtils.hash_value_to_s(display_output)
177183
end
@@ -262,6 +268,12 @@ def attributes_for_dob_cell(dob_cell)
262268
{ dob_info: info, extra_info: info }
263269
end
264270

271+
def attributes_for_fiber_cell(fiber_cell)
272+
fiber_graph_channel = FiberGraphChannel.with_deleted.find_by(cell_output_id: fiber_cell.id)
273+
info = fiber_graph_channel&.slice(:node1, :node2)
274+
{ fiber_graph_channel_info: info }
275+
end
276+
265277
def hex_since(int_since_value)
266278
"0x#{int_since_value.to_s(16).rjust(16, '0')}"
267279
end

0 commit comments

Comments
 (0)