Skip to content

Commit

Permalink
Merge pull request #2407 from nervosnetwork/testnet
Browse files Browse the repository at this point in the history
Deploy to mainnet
  • Loading branch information
zmcNotafraid authored Jan 15, 2025
2 parents 6e3023c + 099e22e commit 6110307
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions app/controllers/api/v1/blocks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ def index
order_by, asc_or_desc = params[:sort].split(".", 2)
order_by =
case order_by
when "height"
"number"
when "transactions"
"ckb_transactions_count"
else
order_by
when "height"
"number"
when "transactions"
"ckb_transactions_count"
else
order_by
end

head :not_found and return unless order_by.in? %w[number reward timestamp ckb_transactions_count]

blocks = blocks.order(order_by => asc_or_desc).page(@page).per(@page_size)
blocks = blocks.order(order_by => asc_or_desc).order("number DESC").page(@page).per(@page_size)

json =
Rails.cache.realize(blocks.cache_key, version: blocks.cache_version, race_condition_ttl: 3.seconds) do
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/omiga_inscriptions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def sort_udts(records)
if sort == "mint_status"
records.joins(:omiga_inscription_info).order("omiga_inscription_infos.mint_status #{order}")
else
records.order("#{sort} #{order}")
records.order("#{sort} #{order}").order("full_name ASC, id ASC")
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/udts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def sort_udts(records)
order = "asc"
end

records.order("#{sort} #{order}")
records.order("#{sort} #{order}").order("full_name ASC, id ASC")
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/xudts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def sort_udts(records)
order = "asc"
end

records.order("#{sort} #{order}")
records.order("#{sort} #{order}").order("full_name ASC, id ASC")
end

def parse_tags
Expand Down
10 changes: 5 additions & 5 deletions app/controllers/api/v2/pending_transactions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def index
where.not(previous_cell_output_id: nil, from_cell_base: false).
pluck(:ckb_transaction_id).uniq
pending_transactions = CkbTransaction.where(id: unique_tx_ids).
order(transactions_ordering).page(@page).per(@page_size)
order(transactions_ordering).order("id DESC").page(@page).per(@page_size)

json = {
data: pending_transactions.map do |tx|
Expand All @@ -20,21 +20,21 @@ def index
capacity_involved: tx.capacity_involved,
transaction_fee: tx.transaction_fee,
created_at: tx.created_at,
create_timestamp: (tx.created_at.to_f * 1000).to_i
create_timestamp: (tx.created_at.to_f * 1000).to_i,
}
end,
meta: {
total: pending_transactions.total_count,
page_size: @page_size.to_i
}
page_size: @page_size.to_i,
},
}

render json: json
end

def count
render json: {
data: CkbTransaction.tx_pending.count
data: CkbTransaction.tx_pending.count,
}
end

Expand Down
8 changes: 4 additions & 4 deletions app/workers/fiber_graph_detect_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ def build_channel_attributes(channel)
node1: channel["node1"],
node2: channel["node2"],
created_timestamp: channel["created_timestamp"],
last_updated_timestamp_of_node1: channel["last_updated_timestamp_of_node1"].to_i(16),
last_updated_timestamp_of_node2: channel["last_updated_timestamp_of_node2"].to_i(16),
fee_rate_of_node1: channel["fee_rate_of_node1"].to_i(16),
fee_rate_of_node2: channel["fee_rate_of_node2"].to_i(16),
last_updated_timestamp_of_node1: channel["last_updated_timestamp_of_node1"]&.to_i(16),
last_updated_timestamp_of_node2: channel["last_updated_timestamp_of_node2"]&.to_i(16),
fee_rate_of_node1: channel["fee_rate_of_node1"]&.to_i(16),
fee_rate_of_node2: channel["fee_rate_of_node2"]&.to_i(16),
capacity: channel["capacity"].to_i(16),
chain_hash: channel["chain_hash"],
open_transaction_id: open_transaction&.id,
Expand Down

0 comments on commit 6110307

Please sign in to comment.