Initial commit
This commit is contained in:
20
bin/check_test_balances.rb
Normal file
20
bin/check_test_balances.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
puts '--- currencies ---'
|
||||
%w[irt cad usdt].each do |cid|
|
||||
c = Currency.find_by(id: cid)
|
||||
puts "#{cid} visible=#{c&.visible} type=#{c&.type}" if c
|
||||
end
|
||||
|
||||
%w[user@test.com bot@test.com admin@test.com].each do |email|
|
||||
member = Member.find_by(email: email)
|
||||
unless member
|
||||
puts "MISSING #{email}"
|
||||
next
|
||||
end
|
||||
|
||||
sample = member.accounts.where('balance > 0').limit(3).map { |a| "#{a.currency_id}=#{a.balance}" }.join(', ')
|
||||
fiat = %w[irt cad].map { |c| a = member.accounts.find_by(currency_id: c); "#{c}=#{a&.balance || 0}" }.join(' ')
|
||||
total = member.accounts.where('balance > 0').count
|
||||
puts "#{email} uid=#{member.uid} nonzero=#{total} fiat=[#{fiat}] sample=#{sample}"
|
||||
end
|
||||
Reference in New Issue
Block a user