Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy to testnet #2393

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions app/interactions/addresses/live_cells.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ def execute
raise AddressNotFoundError if address.is_a?(NullAddress)

order_by, asc_or_desc = live_cells_ordering
cell_outputs = CellOutput.includes(:bitcoin_vout).where(
cell_outputs: { status: "live", address_id: address.map(&:id) },
)
cell_outputs = cell_outputs.where(bitcoin_vouts: { status: bound_status }) if bound_status
cell_output_ids = cell_outputs.pluck("cell_outputs.id")
records = CellOutput.where(id: cell_output_ids).order(order_by => asc_or_desc).
page(page).per(page_size).fast_page
options = FastJsonapi::PaginationMetaGenerator.new(
request:, records:, page:, page_size:,
).call
if bound_status
bitcoin_vouts = BitcoinVout.where(address_id: address.map(&:id), status: bound_status)
records = CellOutput.live.where(id: bitcoin_vouts.map(&:cell_output_id)).order(order_by => asc_or_desc).
page(page).per(page_size).fast_page
else
records = CellOutput.live.where(address_id: address.map(&:id)).order(order_by => asc_or_desc).
page(page).per(page_size).fast_page
end

options = FastJsonapi::PaginationMetaGenerator.new(request:, records:, page:, page_size:).call
CellOutputSerializer.new(records, options).serialized_json
end

Expand Down
4 changes: 2 additions & 2 deletions app/models/bitcoin_vout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class BitcoinVout < ApplicationRecord
def commitment
return unless op_return?

script_pubkey = Bitcoin::Script.parse_from_payload(data.htb)
script_pubkey.op_return_data.bth
script_pub_key = Bitcoin::Script.parse_from_payload(data.htb)
script_pub_key.op_return_data.bth
end
end

Expand Down
Loading