Skip to content

Commit

Permalink
chore: remove udt account query fileds select (#1354)
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbitz committed Aug 1, 2023
1 parent 6d569cb commit 3acd674
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/tasks/migration/update_output_cells_status.rake
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,15 @@ class UpdateCellOutputsStatus

address = Address.find(udt_output.address_id)
udt_type = udt_type(udt_output.cell_type)
udt_account = address.udt_accounts.where(type_hash: udt_output.type_hash, udt_type: udt_type).select(:id,
:created_at).first
udt_account = address.udt_accounts.where(type_hash: udt_output.type_hash, udt_type: udt_type).first
amount = udt_account_amount(udt_type, udt_output.type_hash, address)

if udt_account.present?
udt_account.update(amount: amount)
else
puts "udt_account not: #{udt_output.id}"

udt = Udt.where(type_hash: udt_output.type_hash, udt_type: udt_type).select(:id, :udt_type, :full_name,
:symbol, :decimal, :published, :code_hash, :type_hash, :created_at).take!
udt = Udt.where(type_hash: udt_output.type_hash, udt_type: udt_type).take!
nft_token_id =
udt_type == "nrc_721_token" ? CkbUtils.parse_nrc_721_args(udt_output.type_script.args).token_id : nil
new_udt_accounts_attribute = {
Expand Down

0 comments on commit 3acd674

Please sign in to comment.