<commit_before>module BitcoinPayments::Models::BtcAddress
  extend ActiveSupport::Concern

  included do
    has_many(:payments, inverse_of: :btc_address)
    has_many(:received_payments, inverse_of: :btc_address)

    validates(:public_key, presence: true, uniqueness: { case_sensitive: true })

    before_validation do
      if public_key.blank?
        self.public_key = BitcoinHelper.get_new_address
      end
    end
  end

  def amount
    return BitcoinPayments::ZERO if received_payments.size == 0
    payments.sum(:amount)
  end
end
<commit_msg>remove amount method unless used<commit_after>module BitcoinPayments::Models::BtcAddress
  extend ActiveSupport::Concern

  included do
    has_many(:payments, inverse_of: :btc_address)
    has_many(:received_payments, inverse_of: :btc_address)

    validates(:public_key, presence: true, uniqueness: { case_sensitive: true })

    before_validation do
      if public_key.blank?
        self.public_key = BitcoinHelper.get_new_address
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.07948969578017664, 'fraction_numerical': 0.0009813542688910696, 'mean_word_length': 4.204081632653061, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3821210', 'n_tokens_mistral': 323, 'n_tokens_neox': 308, 'n_words': 69}