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

chore: filter bitcoin vouts in binding status #2173

Merged
merged 1 commit into from
Sep 4, 2024
Merged
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
2 changes: 1 addition & 1 deletion app/controllers/api/v2/bitcoin_addresses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

cell_types = %w(udt xudt xudt_compatible)
cell_outputs = CellOutput.live.includes(:bitcoin_vout).where(cell_outputs: { address_id: address_ids, cell_type: cell_types }).
where.not(bitcoin_vouts: { status: "unbound" }).group(:cell_type, :type_hash).sum(:udt_amount)
where.not(bitcoin_vouts: { status: ["unbound", "binding"] }).group(:cell_type, :type_hash).sum(:udt_amount)

Check warning on line 56 in app/controllers/api/v2/bitcoin_addresses_controller.rb

View check run for this annotation

Codecov / codecov/patch

app/controllers/api/v2/bitcoin_addresses_controller.rb#L56

Added line #L56 was not covered by tests

udt_accounts = cell_outputs.map do |k, v|
udt = Udt.find_by(type_hash: k[1], published: true)
Expand Down
Loading