<commit_before>module OpenAssets
  class BalanceCheck

    def coins_issued_on_product(product)
      expected = expected_coins_on_product(product)
      existing = sum_coins_with_holders(coinholder_data)
      existing >= expected
    end

    def coinholders_on_asset_address(product)
      remote = OpenAssets::Remote.new("http://coins.assembly.com/")
      if product.coin_info
        asset_id = product.coin_info.asset_address
        if asset_id
          end_url = "v2/coinholders/#{asset_id}"
          coinholders = remote.get end_url
        end
      end
    end
<commit_msg>minor changes<commit_after>module OpenAssets
  class BalanceCheck

    def coins_issued_on_product(product)
      expected = expected_coins_on_product(product)
      coinholder_data = coinholders_on_asset_address(product)
      if !coinholder_data['coinholders']
        puts "cannot get data"
        false
      else
        puts coinholder_data
        existing = sum_coins_with_holders(coinholder_data)
        existing >= expected
      end
    end

    def coinholders_on_asset_address(product)
      remote = OpenAssets::Remote.new("http://coins.assembly.com/")
      if product.coin_info
        asset_id = product.coin_info.asset_address
        if asset_id
          end_url = "v2/coinholders/#{asset_id}"
          coinholders = remote.get end_url
        end
      end
    end

{'fraction_non_alphanumeric': 0.06976744186046512, 'fraction_numerical': 0.0014534883720930232, 'mean_word_length': 2.7418478260869565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7637464', 'n_tokens_mistral': 416, 'n_tokens_neox': 401, 'n_words': 77}