From 886ad95bfbe592919941917ecc3e52b41bb2d9b3 Mon Sep 17 00:00:00 2001 From: Yaroslav Konoplov Date: Tue, 15 May 2018 15:50:24 +0300 Subject: [PATCH] Add magic annotation (encoding + frozen_string_literal) to each Ruby script. (#1101) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add magic annotation (encoding + frozen_string_literal) to each Ruby script ❄️ * Fix --- Gemfile | 3 +++ Rakefile | 3 +++ app/api/api_v2/auth/jwt_authenticator.rb | 3 +++ app/api/api_v2/auth/middleware.rb | 3 +++ app/api/api_v2/auth/utils.rb | 3 +++ app/api/api_v2/constraints.rb | 3 +++ app/api/api_v2/cors/middleware.rb | 3 +++ app/api/api_v2/deposits.rb | 3 +++ app/api/api_v2/entities/account.rb | 3 +++ app/api/api_v2/entities/base.rb | 3 +++ app/api/api_v2/entities/deposit.rb | 3 +++ app/api/api_v2/entities/market.rb | 3 +++ app/api/api_v2/entities/member.rb | 3 +++ app/api/api_v2/entities/order.rb | 3 +++ app/api/api_v2/entities/order_book.rb | 3 +++ app/api/api_v2/entities/solvency/partial_tree.rb | 3 +++ app/api/api_v2/entities/solvency/proof.rb | 3 +++ app/api/api_v2/entities/trade.rb | 3 +++ app/api/api_v2/entities/withdraw.rb | 3 +++ app/api/api_v2/errors.rb | 3 +++ app/api/api_v2/fees.rb | 3 +++ app/api/api_v2/helpers.rb | 3 +++ app/api/api_v2/k.rb | 3 +++ app/api/api_v2/markets.rb | 3 +++ app/api/api_v2/members.rb | 3 +++ app/api/api_v2/mount.rb | 3 +++ app/api/api_v2/named_params.rb | 3 +++ app/api/api_v2/order_books.rb | 3 +++ app/api/api_v2/orders.rb | 3 +++ app/api/api_v2/sessions.rb | 3 +++ app/api/api_v2/solvency.rb | 3 +++ app/api/api_v2/tickers.rb | 3 +++ app/api/api_v2/tools.rb | 3 +++ app/api/api_v2/trades.rb | 3 +++ app/api/api_v2/validations.rb | 3 +++ app/api/api_v2/websocket_protocol.rb | 3 +++ app/api/api_v2/withdraws.rb | 3 +++ app/api/management_api_v1/accounts.rb | 3 +++ app/api/management_api_v1/deposits.rb | 3 +++ app/api/management_api_v1/entities/balance.rb | 3 +++ app/api/management_api_v1/entities/base.rb | 3 +++ app/api/management_api_v1/entities/deposit.rb | 3 +++ app/api/management_api_v1/entities/withdraw.rb | 3 +++ .../management_api_v1/exceptions/authentication.rb | 3 +++ app/api/management_api_v1/exceptions/base.rb | 3 +++ app/api/management_api_v1/helpers.rb | 3 +++ .../jwt_authentication_middleware.rb | 3 +++ app/api/management_api_v1/mount.rb | 3 +++ app/api/management_api_v1/tools.rb | 3 +++ app/api/management_api_v1/withdraws.rb | 3 +++ app/controllers/admin/base_controller.rb | 3 +++ app/controllers/admin/currencies_controller.rb | 3 +++ app/controllers/admin/dashboard_controller.rb | 3 +++ app/controllers/admin/deposits/base_controller.rb | 3 +++ app/controllers/admin/deposits/coins_controller.rb | 3 +++ app/controllers/admin/deposits/fiats_controller.rb | 3 +++ app/controllers/admin/markets_controller.rb | 3 +++ app/controllers/admin/members_controller.rb | 3 +++ app/controllers/admin/proofs_controller.rb | 3 +++ app/controllers/admin/withdraws/base_controller.rb | 3 +++ app/controllers/admin/withdraws/coins_controller.rb | 3 +++ app/controllers/admin/withdraws/fiats_controller.rb | 3 +++ app/controllers/application_controller.rb | 3 +++ app/controllers/concerns/disable_cabinet_ui.rb | 3 +++ app/controllers/concerns/disable_markets_ui.rb | 3 +++ app/controllers/concerns/order_creation.rb | 3 +++ app/controllers/concerns/session_utils.rb | 3 +++ .../private/account_versions_controller.rb | 3 +++ app/controllers/private/assets_controller.rb | 3 +++ app/controllers/private/base_controller.rb | 3 +++ app/controllers/private/deposits_controller.rb | 3 +++ app/controllers/private/funds_controller.rb | 3 +++ app/controllers/private/history_controller.rb | 3 +++ app/controllers/private/markets_controller.rb | 3 +++ app/controllers/private/order_asks_controller.rb | 3 +++ app/controllers/private/order_bids_controller.rb | 3 +++ app/controllers/private/orders_controller.rb | 3 +++ app/controllers/private/pusher_controller.rb | 3 +++ app/controllers/private/settings_controller.rb | 3 +++ app/controllers/private/withdraws_controller.rb | 3 +++ app/controllers/sessions_controller.rb | 3 +++ app/controllers/webhooks_controller.rb | 3 +++ app/controllers/welcome_controller.rb | 3 +++ app/enums/member/levels.rb | 3 +++ app/grids/account_versions_grid.rb | 3 +++ app/grids/proofs_grid.rb | 3 +++ app/helpers/application_helper.rb | 3 +++ app/helpers/currency_helper.rb | 3 +++ app/helpers/private/assets_helper.rb | 3 +++ app/helpers/private/history_helper.rb | 3 +++ app/helpers/tag_helper.rb | 3 +++ app/models/account.rb | 3 +++ app/models/account_version.rb | 3 +++ app/models/admin/ability.rb | 3 +++ app/models/amqp_config.rb | 3 +++ app/models/amqp_queue.rb | 3 +++ app/models/audit/audit_log.rb | 3 +++ app/models/audit/transfer_audit_log.rb | 3 +++ app/models/authentication.rb | 3 +++ app/models/concerns/currencible.rb | 3 +++ app/models/concerns/fee_chargeable.rb | 3 +++ app/models/concerns/tid_identifiable.rb | 3 +++ app/models/currency.rb | 3 +++ app/models/deposit.rb | 3 +++ app/models/deposits/coin.rb | 3 +++ app/models/deposits/fiat.rb | 3 +++ app/models/global.rb | 3 +++ app/models/market.rb | 3 +++ app/models/matching/constants.rb | 3 +++ app/models/matching/engine.rb | 3 +++ app/models/matching/executor.rb | 3 +++ app/models/matching/limit_order.rb | 3 +++ app/models/matching/market_order.rb | 3 +++ app/models/matching/order_book.rb | 3 +++ app/models/matching/order_book_manager.rb | 3 +++ app/models/matching/price_level.rb | 3 +++ app/models/member.rb | 3 +++ app/models/order.rb | 3 +++ app/models/order_ask.rb | 3 +++ app/models/order_bid.rb | 3 +++ app/models/partial_tree.rb | 3 +++ app/models/payment_address.rb | 3 +++ app/models/proof.rb | 3 +++ app/models/trade.rb | 3 +++ app/models/withdraw.rb | 3 +++ app/models/withdraws/coin.rb | 3 +++ app/models/withdraws/fiat.rb | 3 +++ app/models/worker/deposit_coin.rb | 3 +++ app/models/worker/deposit_coin_address.rb | 3 +++ app/models/worker/market_ticker.rb | 3 +++ app/models/worker/matching.rb | 3 +++ app/models/worker/order_processor.rb | 3 +++ app/models/worker/pusher_market.rb | 3 +++ app/models/worker/pusher_member.rb | 3 +++ app/models/worker/slave_book.rb | 3 +++ app/models/worker/stats.rb | 3 +++ app/models/worker/trade_executor.rb | 3 +++ app/models/worker/withdraw_coin.rb | 3 +++ app/observers/audit_observer.rb | 3 +++ app/observers/transfer_observer.rb | 3 +++ app/routers/admin_deposits_router.rb | 3 +++ app/routers/admin_withdraws_router.rb | 3 +++ app/routers/black_hole_router.rb | 3 +++ app/routers/crud_router.rb | 3 +++ app/routers/routing_essentials.rb | 3 +++ .../serializers/event_api/order_canceled.rb | 3 +++ .../serializers/event_api/order_completed.rb | 3 +++ .../serializers/event_api/order_created.rb | 3 +++ app/serializers/serializers/event_api/order_event.rb | 3 +++ .../serializers/event_api/order_updated.rb | 3 +++ .../serializers/event_api/trade_completed.rb | 3 +++ app/services/ordering.rb | 3 +++ .../services/blockchain_transaction_handler.rb | 3 +++ bin/bundle | 4 ++++ bin/init_config | 3 +++ bin/install_plugins | 3 +++ bin/link_config | 3 +++ bin/rails | 4 ++++ bin/rake | 4 ++++ bin/rspec | 2 ++ bin/setup | 3 +++ bin/uninstall_plugins | 3 +++ ci/bump.rb | 3 +++ config.ru | 3 +++ config/application.rb | 3 +++ config/boot.rb | 3 +++ config/environment.rb | 3 +++ config/environments/development.rb | 3 +++ config/environments/production.rb | 3 +++ config/environments/shared.rb | 3 +++ config/environments/shared/cache.rb | 3 +++ config/environments/shared/logger.rb | 3 +++ config/environments/test.rb | 3 +++ config/initializers/abstract_mysql2_adapter.rb | 3 +++ config/initializers/activerecord.rb | 3 +++ config/initializers/assets.rb | 3 +++ config/initializers/backtrace_silencers.rb | 3 +++ config/initializers/cookies_serializer.rb | 3 +++ .../initializers/datagrid/filters/date_time_filter.rb | 3 +++ config/initializers/date_time_format.rb | 3 +++ config/initializers/display_currency.rb | 3 +++ config/initializers/easy_table.rb | 3 +++ config/initializers/event_api.rb | 3 +++ config/initializers/exception_reporting.rb | 3 +++ config/initializers/faraday.rb | 3 +++ config/initializers/filter_parameter_logging.rb | 3 +++ config/initializers/grape.rb | 3 +++ config/initializers/inflections.rb | 3 +++ config/initializers/jwt.rb | 3 +++ config/initializers/kaminari_config.rb | 3 +++ config/initializers/mime_types.rb | 3 +++ config/initializers/omniauth.rb | 3 +++ config/initializers/presence.rb | 3 +++ config/initializers/pusher.rb | 3 +++ config/initializers/redis_store.rb | 3 +++ config/initializers/session_store.rb | 3 +++ config/initializers/string.rb | 3 +++ config/initializers/string_extend.rb | 3 +++ config/initializers/wrap_parameters.rb | 3 +++ config/plugins.rb | 3 +++ config/puma.rb | 3 +++ config/routes.rb | 3 +++ config/routes/admin.rb | 3 +++ db/migrate/20180112151205_init_schema.rb | 3 +++ .../20180212115002_remove_know_your_customer.rb | 3 +++ .../20180212115751_refactor_member_structure.rb | 3 +++ db/migrate/20180213160501_drop_assets.rb | 3 +++ .../20180215124645_shorten_member_serial_number.rb | 3 +++ .../20180215131129_make_serial_number_unique.rb | 3 +++ .../20180215144645_refactor_authentication_token.rb | 3 +++ db/migrate/20180215144646_add_currencies.rb | 3 +++ db/migrate/20180216145412_remove_name_and_nickname.rb | 3 +++ .../20180227163417_good_currency_foreign_key.rb | 3 +++ ...20180303121013_add_details_to_payment_addresses.rb | 3 +++ db/migrate/20180303211737_drop_api_tokens.rb | 3 +++ ...8_create_withdraw_destinations_drop_fund_source.rb | 3 +++ ...315132521_migrate_all_currency_models_to_single.rb | 3 +++ db/migrate/20180315145436_remove_in_and_out.rb | 3 +++ .../20180315150348_migrate_all_bank_models_to_fiat.rb | 3 +++ db/migrate/20180315185255_remove_key_from_currency.rb | 3 +++ db/migrate/20180325001828_create_markets.rb | 3 +++ db/migrate/20180327020701_alter_currency.rb | 5 ++++- db/migrate/20180329145257_alter_trades_currency.rb | 5 ++++- db/migrate/20180329145557_alter_orders_currency.rb | 5 ++++- .../20180329154130_update_deprecated_currency_ids.rb | 3 +++ db/migrate/20180403115050_add_tid_to_deposit.rb | 3 +++ db/migrate/20180403134930_add_tid_to_withdraw.rb | 3 +++ db/migrate/20180403135744_add_bid_to_withdraws.rb | 3 +++ db/migrate/20180403145234_change_bid_to_rid.rb | 3 +++ db/migrate/20180403231931_migrate_states.rb | 3 +++ .../20180406080444_drop_withdraw_destinations.rb | 3 +++ db/migrate/20180406185130_remove_sn_from_withdraw.rb | 3 +++ ...180407082641_remove_fund_uid_extra_from_deposit.rb | 3 +++ .../20180409115144_drop_useless_deposit_state.rb | 3 +++ db/migrate/20180409115902_refactor_deposit.rb | 3 +++ db/migrate/20180416160438_add_fee_to_orders.rb | 3 +++ ...0417085823_migrate_deposit_channels_to_currency.rb | 3 +++ ...417111305_migrate_withdraw_channels_to_currency.rb | 3 +++ db/migrate/20180417175453_increase_fee_limits.rb | 3 +++ .../20180419122223_add_deposit_fee_to_currencies.rb | 3 +++ db/migrate/20180425094920_limit_trading_fee.rb | 3 +++ ...152420_convert_to_legacy_bitcoin_cash_addresses.rb | 3 +++ .../20180425224307_change_wallet_id_to_address_id.rb | 3 +++ ...0501082703_normalize_addresses_and_transactions.rb | 3 +++ db/migrate/20180501141718_case_sensitive_data.rb | 3 +++ db/schema.rb | 2 ++ db/seeds.rb | 3 +++ lib/aasm/locking.rb | 3 +++ lib/coin_api.rb | 3 +++ lib/coin_api/bch.rb | 3 +++ lib/coin_api/bit_go.rb | 3 +++ lib/coin_api/btc.rb | 3 +++ lib/coin_api/dash.rb | 3 +++ lib/coin_api/erc20.rb | 3 +++ lib/coin_api/eth.rb | 3 +++ lib/coin_api/ltc.rb | 3 +++ lib/coin_api/xrp.rb | 3 +++ lib/daemons/amqp_daemon.rb | 3 +++ lib/daemons/coins.rb | 3 +++ lib/daemons/daemons.god | 3 +++ lib/daemons/global_state.rb | 3 +++ lib/daemons/hot_wallets.rb | 3 +++ lib/daemons/k.rb | 3 +++ lib/daemons/payment_transaction.rb | 3 +++ lib/daemons/websocket_api.rb | 1 + lib/daemons/withdraw_audit.rb | 3 +++ lib/datagrid/column_i18n.rb | 3 +++ lib/datagrid/naming.rb | 3 +++ lib/js_locale_helper.rb | 11 ++++++----- lib/kline_db.rb | 3 +++ lib/market_constraint.rb | 3 +++ lib/peatio.rb | 3 +++ lib/peatio/feeders/abstract_feeder.rb | 3 +++ lib/peatio/feeders/admin_feeder.rb | 3 +++ lib/peatio/feeders/admins_feeder.rb | 3 +++ lib/peatio/feeders/member_feeder.rb | 3 +++ lib/peatio/feeders/members_feeder.rb | 3 +++ lib/peatio/tasks/feed.rake | 3 +++ lib/peatio/tasks/test.rake | 3 +++ lib/peatio/version.rb | 3 +++ lib/tasks/accounts.rake | 3 +++ lib/tasks/auto_annotate_models.rake | 3 +++ lib/tasks/barong.rake | 3 +++ lib/tasks/currencies.rake | 3 +++ lib/tasks/markets.rake | 3 +++ lib/tasks/solvency.rake | 3 +++ lib/tasks/yarn.rake | 3 +++ spec/api/api_v2/auth/jwt_authenticator_spec.rb | 3 +++ spec/api/api_v2/auth/middleware_spec.rb | 3 +++ spec/api/api_v2/cors_spec.rb | 3 +++ spec/api/api_v2/deposits_spec.rb | 3 +++ spec/api/api_v2/entities/account_spec.rb | 3 +++ spec/api/api_v2/entities/member_spec.rb | 3 +++ spec/api/api_v2/entities/order_spec.rb | 3 +++ spec/api/api_v2/entities/trade_spec.rb | 3 +++ spec/api/api_v2/fees_spec.rb | 3 +++ spec/api/api_v2/helpers_spec.rb | 3 +++ spec/api/api_v2/markets_spec.rb | 3 +++ spec/api/api_v2/members_spec.rb | 3 +++ spec/api/api_v2/mount_spec.rb | 3 +++ spec/api/api_v2/order_books_spec.rb | 3 +++ spec/api/api_v2/orders_spec.rb | 3 +++ spec/api/api_v2/sessions_spec.rb | 3 +++ spec/api/api_v2/solvency_spec.rb | 3 +++ spec/api/api_v2/tickers_spec.rb | 3 +++ spec/api/api_v2/trades_spec.rb | 3 +++ spec/api/api_v2/withdraws_spec.rb | 3 +++ spec/api/management_api_v1/accounts_spec.rb | 3 +++ spec/api/management_api_v1/deposits_spec.rb | 3 +++ spec/api/management_api_v1/entities/balance_spec.rb | 3 +++ spec/api/management_api_v1/entities/deposit_spec.rb | 3 +++ spec/api/management_api_v1/entities/withdraw_spec.rb | 3 +++ .../jwt_authentication_middleware_spec.rb | 3 +++ spec/api/management_api_v1/tools_spec.rb | 3 +++ spec/api/management_api_v1/withdraws_spec.rb | 3 +++ spec/controllers/admin/currencies_controller_spec.rb | 3 +++ spec/controllers/admin/markets_controller_spec.rb | 3 +++ spec/controllers/admin/members_controller_spec.rb | 3 +++ spec/controllers/private/assets_controller_spec.rb | 3 +++ spec/controllers/private/funds_controller_spec.rb | 3 +++ spec/controllers/private/markets_controller_spec.rb | 3 +++ .../controllers/private/order_asks_controller_spec.rb | 3 +++ .../controllers/private/order_bids_controller_spec.rb | 3 +++ spec/controllers/private/settings_controller_spec.rb | 3 +++ spec/controllers/private/withdraws_controller_spec.rb | 3 +++ spec/controllers/sessions_controller_spec.rb | 3 +++ spec/controllers/welcome_controller_spec.rb | 3 +++ spec/factories/account.rb | 3 +++ spec/factories/authentications.rb | 3 +++ spec/factories/currencies.rb | 3 +++ spec/factories/deposits.rb | 3 +++ spec/factories/market.rb | 3 +++ spec/factories/member.rb | 3 +++ spec/factories/orders.rb | 3 +++ spec/factories/partial_trees.rb | 3 +++ spec/factories/payment_addresses.rb | 3 +++ spec/factories/proofs.rb | 3 +++ spec/factories/trade.rb | 3 +++ spec/factories/withdraw.rb | 3 +++ spec/features/admin/withdraw_spec.rb | 3 +++ spec/features/market_spec.rb | 3 +++ spec/features/market_trade_history_spec.rb | 3 +++ spec/helpers/private/assets_helper_spec.rb | 3 +++ spec/lib/coin_api/bit_go.rb | 3 +++ spec/lib/coin_api/erc20_spec.rb | 3 +++ spec/lib/coin_api/eth_spec.rb | 3 +++ spec/lib/coin_api/xrp_spec.rb | 3 +++ spec/models/account_spec.rb | 3 +++ spec/models/account_version_spec.rb | 3 +++ spec/models/amqp_config_spec.rb | 3 +++ spec/models/amqp_queue_spec.rb | 3 +++ spec/models/audit/transfer_audit_log_spec.rb | 3 +++ spec/models/currency_spec.rb | 3 +++ spec/models/deposit_spec.rb | 3 +++ spec/models/global_spec.rb | 3 +++ spec/models/market_spec.rb | 3 +++ spec/models/matching/engine_spec.rb | 3 +++ spec/models/matching/executor_spec.rb | 3 +++ spec/models/matching/limit_order_spec.rb | 3 +++ spec/models/matching/market_order_spec.rb | 3 +++ spec/models/matching/order_book_manager_spec.rb | 3 +++ spec/models/matching/order_book_spec.rb | 3 +++ spec/models/matching/price_level_spec.rb | 3 +++ spec/models/member_spec.rb | 3 +++ spec/models/order_ask_spec.rb | 3 +++ spec/models/order_bid_spec.rb | 3 +++ spec/models/order_spec.rb | 3 +++ spec/models/partial_tree_spec.rb | 3 +++ spec/models/payment_address_spec.rb | 3 +++ spec/models/proof_spec.rb | 3 +++ spec/models/trade_spec.rb | 3 +++ spec/models/withdraw_spec.rb | 3 +++ spec/models/worker/deposit_coin_spec.rb | 3 +++ spec/models/worker/matching_spec.rb | 3 +++ spec/models/worker/slave_book_spec.rb | 3 +++ spec/observers/transfer_observer_spec.rb | 3 +++ spec/routing/admin/members_spec.rb | 3 +++ spec/routing/trade_spec.rb | 3 +++ .../serializers/event_api/order_canceled_spec.rb | 3 +++ .../serializers/event_api/order_completed_spec.rb | 3 +++ .../serializers/event_api/order_created_spec.rb | 3 +++ .../serializers/event_api/order_updated_spec.rb | 3 +++ .../serializers/event_api/trade_completed_spec.rb | 3 +++ spec/services/blockchain_transaction_handler_spec.rb | 3 +++ spec/services/ordering_spec.rb | 3 +++ spec/spec_helper.rb | 3 +++ spec/support/api_helper.rb | 3 +++ spec/support/capybara.rb | 3 +++ spec/support/cookie_helper.rb | 3 +++ spec/support/inject_session.rb | 3 +++ spec/support/matching_helper.rb | 3 +++ spec/support/member_helper.rb | 3 +++ spec/support/pusher.rb | 3 +++ spec/support/rspec_matchers.rb | 3 +++ 394 files changed, 1187 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index bd94029ac2..c368c83ec9 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + source 'https://rubygems.org' git_source(:github) { |repo_slug| "https://github.com/#{repo_slug}" } diff --git a/Rakefile b/Rakefile index c9c1c45c0e..bfde374e7d 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + #!/usr/bin/env rake # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. diff --git a/app/api/api_v2/auth/jwt_authenticator.rb b/app/api/api_v2/auth/jwt_authenticator.rb index f1a7cdab51..9b14ee29ce 100644 --- a/app/api/api_v2/auth/jwt_authenticator.rb +++ b/app/api/api_v2/auth/jwt_authenticator.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Auth class JWTAuthenticator diff --git a/app/api/api_v2/auth/middleware.rb b/app/api/api_v2/auth/middleware.rb index b5863b9447..ee081ffadc 100644 --- a/app/api/api_v2/auth/middleware.rb +++ b/app/api/api_v2/auth/middleware.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Auth class Middleware < Grape::Middleware::Base diff --git a/app/api/api_v2/auth/utils.rb b/app/api/api_v2/auth/utils.rb index a667424f35..1a196c3660 100644 --- a/app/api/api_v2/auth/utils.rb +++ b/app/api/api_v2/auth/utils.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Auth module Utils diff --git a/app/api/api_v2/constraints.rb b/app/api/api_v2/constraints.rb index 8287d2c1dc..0e804bf8ac 100644 --- a/app/api/api_v2/constraints.rb +++ b/app/api/api_v2/constraints.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Constraints class << self diff --git a/app/api/api_v2/cors/middleware.rb b/app/api/api_v2/cors/middleware.rb index 953632bed9..a0d52d0201 100644 --- a/app/api/api_v2/cors/middleware.rb +++ b/app/api/api_v2/cors/middleware.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module CORS class Middleware < Grape::Middleware::Base diff --git a/app/api/api_v2/deposits.rb b/app/api/api_v2/deposits.rb index 247ba66853..b4bb97fd15 100644 --- a/app/api/api_v2/deposits.rb +++ b/app/api/api_v2/deposits.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require_relative 'validations' module APIv2 diff --git a/app/api/api_v2/entities/account.rb b/app/api/api_v2/entities/account.rb index 33d8ed0fc1..9236210174 100644 --- a/app/api/api_v2/entities/account.rb +++ b/app/api/api_v2/entities/account.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Entities class Account < Base diff --git a/app/api/api_v2/entities/base.rb b/app/api/api_v2/entities/base.rb index eb8bace70a..17f64ed03d 100644 --- a/app/api/api_v2/entities/base.rb +++ b/app/api/api_v2/entities/base.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Entities class Base < Grape::Entity diff --git a/app/api/api_v2/entities/deposit.rb b/app/api/api_v2/entities/deposit.rb index 88649601a0..5c5d709c84 100644 --- a/app/api/api_v2/entities/deposit.rb +++ b/app/api/api_v2/entities/deposit.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Entities class Deposit < Base diff --git a/app/api/api_v2/entities/market.rb b/app/api/api_v2/entities/market.rb index 99a8637c8f..c1dcda550c 100644 --- a/app/api/api_v2/entities/market.rb +++ b/app/api/api_v2/entities/market.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Entities class Market < Base diff --git a/app/api/api_v2/entities/member.rb b/app/api/api_v2/entities/member.rb index 75b1c4ea14..d64ea440fa 100644 --- a/app/api/api_v2/entities/member.rb +++ b/app/api/api_v2/entities/member.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Entities class Member < Base diff --git a/app/api/api_v2/entities/order.rb b/app/api/api_v2/entities/order.rb index 7649e95e29..c886b673e7 100644 --- a/app/api/api_v2/entities/order.rb +++ b/app/api/api_v2/entities/order.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Entities class Order < Base diff --git a/app/api/api_v2/entities/order_book.rb b/app/api/api_v2/entities/order_book.rb index 9941c8921c..661e356855 100644 --- a/app/api/api_v2/entities/order_book.rb +++ b/app/api/api_v2/entities/order_book.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require_dependency 'api_v2/entities/order' module APIv2 diff --git a/app/api/api_v2/entities/solvency/partial_tree.rb b/app/api/api_v2/entities/solvency/partial_tree.rb index d5e233749f..db11507288 100644 --- a/app/api/api_v2/entities/solvency/partial_tree.rb +++ b/app/api/api_v2/entities/solvency/partial_tree.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Entities module Solvency diff --git a/app/api/api_v2/entities/solvency/proof.rb b/app/api/api_v2/entities/solvency/proof.rb index ddbf891bcc..f8f3539981 100644 --- a/app/api/api_v2/entities/solvency/proof.rb +++ b/app/api/api_v2/entities/solvency/proof.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Entities module Solvency diff --git a/app/api/api_v2/entities/trade.rb b/app/api/api_v2/entities/trade.rb index 2938448b59..c343d23b71 100644 --- a/app/api/api_v2/entities/trade.rb +++ b/app/api/api_v2/entities/trade.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Entities class Trade < Base diff --git a/app/api/api_v2/entities/withdraw.rb b/app/api/api_v2/entities/withdraw.rb index cb7151549d..71c76d17b3 100644 --- a/app/api/api_v2/entities/withdraw.rb +++ b/app/api/api_v2/entities/withdraw.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Entities class Withdraw < Base diff --git a/app/api/api_v2/errors.rb b/app/api/api_v2/errors.rb index 19e96c4f04..2a4a9e40b7 100644 --- a/app/api/api_v2/errors.rb +++ b/app/api/api_v2/errors.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module ExceptionHandlers diff --git a/app/api/api_v2/fees.rb b/app/api/api_v2/fees.rb index 3f9b27b178..0a11992622 100644 --- a/app/api/api_v2/fees.rb +++ b/app/api/api_v2/fees.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class Fees < Grape::API Fee = Struct.new(:type, :value) diff --git a/app/api/api_v2/helpers.rb b/app/api/api_v2/helpers.rb index 92a6b6b241..dfd418ccea 100644 --- a/app/api/api_v2/helpers.rb +++ b/app/api/api_v2/helpers.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Helpers def authenticate! diff --git a/app/api/api_v2/k.rb b/app/api/api_v2/k.rb index 94988f10cc..a82276e714 100644 --- a/app/api/api_v2/k.rb +++ b/app/api/api_v2/k.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class K < Grape::API helpers ::APIv2::NamedParams diff --git a/app/api/api_v2/markets.rb b/app/api/api_v2/markets.rb index 36a8ba4bf6..f88f08fa0d 100644 --- a/app/api/api_v2/markets.rb +++ b/app/api/api_v2/markets.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class Markets < Grape::API diff --git a/app/api/api_v2/members.rb b/app/api/api_v2/members.rb index 7a6e8d8371..c6467174ff 100644 --- a/app/api/api_v2/members.rb +++ b/app/api/api_v2/members.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class Members < Grape::API helpers APIv2::NamedParams diff --git a/app/api/api_v2/mount.rb b/app/api/api_v2/mount.rb index 7f8e64e0f5..76ac8f199f 100644 --- a/app/api/api_v2/mount.rb +++ b/app/api/api_v2/mount.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require_dependency 'api_v2/errors' require_dependency 'api_v2/validations' require_dependency 'api_v2/withdraws' diff --git a/app/api/api_v2/named_params.rb b/app/api/api_v2/named_params.rb index 81287b42bd..6127225efe 100644 --- a/app/api/api_v2/named_params.rb +++ b/app/api/api_v2/named_params.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module NamedParams extend ::Grape::API::Helpers diff --git a/app/api/api_v2/order_books.rb b/app/api/api_v2/order_books.rb index 3d037d30da..63fed4316d 100644 --- a/app/api/api_v2/order_books.rb +++ b/app/api/api_v2/order_books.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class OrderBook < Struct.new(:asks, :bids); end diff --git a/app/api/api_v2/orders.rb b/app/api/api_v2/orders.rb index 11cc7e6cf0..44778ad789 100644 --- a/app/api/api_v2/orders.rb +++ b/app/api/api_v2/orders.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class Orders < Grape::API helpers ::APIv2::NamedParams diff --git a/app/api/api_v2/sessions.rb b/app/api/api_v2/sessions.rb index 69091dc4af..ee2ffeff99 100644 --- a/app/api/api_v2/sessions.rb +++ b/app/api/api_v2/sessions.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class Sessions < Grape::API helpers { include SessionUtils } diff --git a/app/api/api_v2/solvency.rb b/app/api/api_v2/solvency.rb index 0079f0f4a6..caa92a61e2 100644 --- a/app/api/api_v2/solvency.rb +++ b/app/api/api_v2/solvency.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class Solvency < Grape::API diff --git a/app/api/api_v2/tickers.rb b/app/api/api_v2/tickers.rb index 1d0a114e9a..53ef151909 100644 --- a/app/api/api_v2/tickers.rb +++ b/app/api/api_v2/tickers.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class Tickers < Grape::API helpers ::APIv2::NamedParams diff --git a/app/api/api_v2/tools.rb b/app/api/api_v2/tools.rb index b7b3ed4461..e7a6ab6358 100644 --- a/app/api/api_v2/tools.rb +++ b/app/api/api_v2/tools.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class Tools < Grape::API desc 'Get server current time, in seconds since Unix epoch.' diff --git a/app/api/api_v2/trades.rb b/app/api/api_v2/trades.rb index f7870d1525..7366d17464 100644 --- a/app/api/api_v2/trades.rb +++ b/app/api/api_v2/trades.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class Trades < Grape::API helpers ::APIv2::NamedParams diff --git a/app/api/api_v2/validations.rb b/app/api/api_v2/validations.rb index 0261d2d7a4..aabd20315a 100644 --- a/app/api/api_v2/validations.rb +++ b/app/api/api_v2/validations.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 module Validations class Range < Grape::Validations::Base diff --git a/app/api/api_v2/websocket_protocol.rb b/app/api/api_v2/websocket_protocol.rb index e760455c1c..e9ab1136a6 100644 --- a/app/api/api_v2/websocket_protocol.rb +++ b/app/api/api_v2/websocket_protocol.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class WebSocketProtocol def initialize(socket, channel, logger) diff --git a/app/api/api_v2/withdraws.rb b/app/api/api_v2/withdraws.rb index 670f05332c..358eb86de8 100644 --- a/app/api/api_v2/withdraws.rb +++ b/app/api/api_v2/withdraws.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class Withdraws < Grape::API helpers APIv2::NamedParams diff --git a/app/api/management_api_v1/accounts.rb b/app/api/management_api_v1/accounts.rb index e01a39fc3a..fe894a26ea 100644 --- a/app/api/management_api_v1/accounts.rb +++ b/app/api/management_api_v1/accounts.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module ManagementAPIv1 class Accounts < Grape::API desc 'Queries the account balance for the given UID and currency.' do diff --git a/app/api/management_api_v1/deposits.rb b/app/api/management_api_v1/deposits.rb index b838a14148..a2a4d71293 100644 --- a/app/api/management_api_v1/deposits.rb +++ b/app/api/management_api_v1/deposits.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module ManagementAPIv1 class Deposits < Grape::API diff --git a/app/api/management_api_v1/entities/balance.rb b/app/api/management_api_v1/entities/balance.rb index d317facd2a..4b24c0defa 100644 --- a/app/api/management_api_v1/entities/balance.rb +++ b/app/api/management_api_v1/entities/balance.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module ManagementAPIv1 module Entities class Balance < Base diff --git a/app/api/management_api_v1/entities/base.rb b/app/api/management_api_v1/entities/base.rb index 40bbbb1ab4..f4a56eab3f 100644 --- a/app/api/management_api_v1/entities/base.rb +++ b/app/api/management_api_v1/entities/base.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module ManagementAPIv1 module Entities class Base < Grape::Entity diff --git a/app/api/management_api_v1/entities/deposit.rb b/app/api/management_api_v1/entities/deposit.rb index f786f1ef28..21789e86d7 100644 --- a/app/api/management_api_v1/entities/deposit.rb +++ b/app/api/management_api_v1/entities/deposit.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module ManagementAPIv1 module Entities class Deposit < Base diff --git a/app/api/management_api_v1/entities/withdraw.rb b/app/api/management_api_v1/entities/withdraw.rb index 2224126612..c13579a1ba 100644 --- a/app/api/management_api_v1/entities/withdraw.rb +++ b/app/api/management_api_v1/entities/withdraw.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module ManagementAPIv1 module Entities class Withdraw < Base diff --git a/app/api/management_api_v1/exceptions/authentication.rb b/app/api/management_api_v1/exceptions/authentication.rb index f298524c10..b2ce312817 100644 --- a/app/api/management_api_v1/exceptions/authentication.rb +++ b/app/api/management_api_v1/exceptions/authentication.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module ManagementAPIv1 module Exceptions class Authentication < Base diff --git a/app/api/management_api_v1/exceptions/base.rb b/app/api/management_api_v1/exceptions/base.rb index 58af323c33..7f4231bbef 100644 --- a/app/api/management_api_v1/exceptions/base.rb +++ b/app/api/management_api_v1/exceptions/base.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module ManagementAPIv1 module Exceptions class Base < StandardError diff --git a/app/api/management_api_v1/helpers.rb b/app/api/management_api_v1/helpers.rb index 26e6423667..ee35beba06 100644 --- a/app/api/management_api_v1/helpers.rb +++ b/app/api/management_api_v1/helpers.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module ManagementAPIv1 module Helpers diff --git a/app/api/management_api_v1/jwt_authentication_middleware.rb b/app/api/management_api_v1/jwt_authentication_middleware.rb index b71903c02f..1a0e6b291f 100644 --- a/app/api/management_api_v1/jwt_authentication_middleware.rb +++ b/app/api/management_api_v1/jwt_authentication_middleware.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require 'stringio' module ManagementAPIv1 diff --git a/app/api/management_api_v1/mount.rb b/app/api/management_api_v1/mount.rb index 916cef641a..3b40bcafaa 100644 --- a/app/api/management_api_v1/mount.rb +++ b/app/api/management_api_v1/mount.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module ManagementAPIv1 class Mount < Grape::API PREFIX = '/management_api' diff --git a/app/api/management_api_v1/tools.rb b/app/api/management_api_v1/tools.rb index 4f47f345c9..0676c4c7a9 100644 --- a/app/api/management_api_v1/tools.rb +++ b/app/api/management_api_v1/tools.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module ManagementAPIv1 class Tools < Grape::API desc 'Returns server time in seconds since Unix epoch.' do diff --git a/app/api/management_api_v1/withdraws.rb b/app/api/management_api_v1/withdraws.rb index 1fa9c2aa53..3de319e499 100644 --- a/app/api/management_api_v1/withdraws.rb +++ b/app/api/management_api_v1/withdraws.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module ManagementAPIv1 class Withdraws < Grape::API diff --git a/app/controllers/admin/base_controller.rb b/app/controllers/admin/base_controller.rb index 2b789376ed..37f8cbb86d 100644 --- a/app/controllers/admin/base_controller.rb +++ b/app/controllers/admin/base_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Admin class BaseController < ::ApplicationController layout 'admin' diff --git a/app/controllers/admin/currencies_controller.rb b/app/controllers/admin/currencies_controller.rb index 7015d4f276..f69d719108 100644 --- a/app/controllers/admin/currencies_controller.rb +++ b/app/controllers/admin/currencies_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Admin class CurrenciesController < BaseController load_and_authorize_resource diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rb index 677fafc80f..6b15a289cf 100644 --- a/app/controllers/admin/dashboard_controller.rb +++ b/app/controllers/admin/dashboard_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Admin class DashboardController < BaseController skip_load_and_authorize_resource diff --git a/app/controllers/admin/deposits/base_controller.rb b/app/controllers/admin/deposits/base_controller.rb index 53ffae72eb..3f598bceb3 100644 --- a/app/controllers/admin/deposits/base_controller.rb +++ b/app/controllers/admin/deposits/base_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require_dependency 'admin/base_controller' module Admin diff --git a/app/controllers/admin/deposits/coins_controller.rb b/app/controllers/admin/deposits/coins_controller.rb index c76a8d8dd4..459659b615 100644 --- a/app/controllers/admin/deposits/coins_controller.rb +++ b/app/controllers/admin/deposits/coins_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require_dependency 'admin/deposits/base_controller' module Admin diff --git a/app/controllers/admin/deposits/fiats_controller.rb b/app/controllers/admin/deposits/fiats_controller.rb index 553fd2c75b..fd9fb2f5c7 100644 --- a/app/controllers/admin/deposits/fiats_controller.rb +++ b/app/controllers/admin/deposits/fiats_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require_dependency 'admin/deposits/base_controller' module Admin diff --git a/app/controllers/admin/markets_controller.rb b/app/controllers/admin/markets_controller.rb index f2d657423a..a804e6f8a1 100644 --- a/app/controllers/admin/markets_controller.rb +++ b/app/controllers/admin/markets_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Admin class MarketsController < BaseController load_and_authorize_resource diff --git a/app/controllers/admin/members_controller.rb b/app/controllers/admin/members_controller.rb index d96edfa5b2..f33eaa45c6 100644 --- a/app/controllers/admin/members_controller.rb +++ b/app/controllers/admin/members_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Admin class MembersController < BaseController load_and_authorize_resource diff --git a/app/controllers/admin/proofs_controller.rb b/app/controllers/admin/proofs_controller.rb index 35118e74f2..69cdbb3dae 100644 --- a/app/controllers/admin/proofs_controller.rb +++ b/app/controllers/admin/proofs_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Admin class ProofsController < BaseController load_and_authorize_resource diff --git a/app/controllers/admin/withdraws/base_controller.rb b/app/controllers/admin/withdraws/base_controller.rb index 208c2acbfc..e528a798dc 100644 --- a/app/controllers/admin/withdraws/base_controller.rb +++ b/app/controllers/admin/withdraws/base_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require_dependency 'admin/base_controller' module Admin diff --git a/app/controllers/admin/withdraws/coins_controller.rb b/app/controllers/admin/withdraws/coins_controller.rb index 040e169bc3..141065efe5 100644 --- a/app/controllers/admin/withdraws/coins_controller.rb +++ b/app/controllers/admin/withdraws/coins_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require_dependency 'admin/withdraws/base_controller' module Admin diff --git a/app/controllers/admin/withdraws/fiats_controller.rb b/app/controllers/admin/withdraws/fiats_controller.rb index 18f54e104b..89fbf9f264 100644 --- a/app/controllers/admin/withdraws/fiats_controller.rb +++ b/app/controllers/admin/withdraws/fiats_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require_dependency 'admin/withdraws/base_controller' module Admin diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9f32e4e515..1ba08efe8e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class ApplicationController < ActionController::Base include SessionUtils protect_from_forgery with: :exception diff --git a/app/controllers/concerns/disable_cabinet_ui.rb b/app/controllers/concerns/disable_cabinet_ui.rb index 203eeb43ff..30b9d49d00 100644 --- a/app/controllers/concerns/disable_cabinet_ui.rb +++ b/app/controllers/concerns/disable_cabinet_ui.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Concerns module DisableCabinetUI extend ActiveSupport::Concern diff --git a/app/controllers/concerns/disable_markets_ui.rb b/app/controllers/concerns/disable_markets_ui.rb index fa07d03938..7476224fdf 100644 --- a/app/controllers/concerns/disable_markets_ui.rb +++ b/app/controllers/concerns/disable_markets_ui.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Concerns module DisableMarketsUI extend ActiveSupport::Concern diff --git a/app/controllers/concerns/order_creation.rb b/app/controllers/concerns/order_creation.rb index bea091540a..e3e3109750 100644 --- a/app/controllers/concerns/order_creation.rb +++ b/app/controllers/concerns/order_creation.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Concerns module OrderCreation extend ActiveSupport::Concern diff --git a/app/controllers/concerns/session_utils.rb b/app/controllers/concerns/session_utils.rb index 320882d4b1..4ec08fb9ea 100644 --- a/app/controllers/concerns/session_utils.rb +++ b/app/controllers/concerns/session_utils.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module SessionUtils def memoize_member_session_id(member_id, session_id, options = {}) options[:expire_after] ||= ENV.fetch('SESSION_LIFETIME').to_i diff --git a/app/controllers/private/account_versions_controller.rb b/app/controllers/private/account_versions_controller.rb index bd2304412b..e27c7ac20c 100644 --- a/app/controllers/private/account_versions_controller.rb +++ b/app/controllers/private/account_versions_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Private class AccountVersionsController < BaseController def index diff --git a/app/controllers/private/assets_controller.rb b/app/controllers/private/assets_controller.rb index 72514c5fc2..12147c487f 100644 --- a/app/controllers/private/assets_controller.rb +++ b/app/controllers/private/assets_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Private class AssetsController < BaseController skip_before_action :auth_member!, only: [:index] diff --git a/app/controllers/private/base_controller.rb b/app/controllers/private/base_controller.rb index 78fb954baa..9606d58960 100644 --- a/app/controllers/private/base_controller.rb +++ b/app/controllers/private/base_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Private class BaseController < ::ApplicationController before_filter :no_cache, :auth_member! diff --git a/app/controllers/private/deposits_controller.rb b/app/controllers/private/deposits_controller.rb index 64b7d561a8..f8337996f0 100644 --- a/app/controllers/private/deposits_controller.rb +++ b/app/controllers/private/deposits_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Private class DepositsController < BaseController before_action :auth_verified! diff --git a/app/controllers/private/funds_controller.rb b/app/controllers/private/funds_controller.rb index 581c26381a..9add583eb5 100644 --- a/app/controllers/private/funds_controller.rb +++ b/app/controllers/private/funds_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Private class FundsController < BaseController include CurrencyHelper diff --git a/app/controllers/private/history_controller.rb b/app/controllers/private/history_controller.rb index cd6fcd9a66..c90a7c53c8 100644 --- a/app/controllers/private/history_controller.rb +++ b/app/controllers/private/history_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Private class HistoryController < BaseController diff --git a/app/controllers/private/markets_controller.rb b/app/controllers/private/markets_controller.rb index ceb9996c24..6793f45f3d 100644 --- a/app/controllers/private/markets_controller.rb +++ b/app/controllers/private/markets_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Private class MarketsController < BaseController include Concerns::DisableMarketsUI diff --git a/app/controllers/private/order_asks_controller.rb b/app/controllers/private/order_asks_controller.rb index c1205c96bd..71706c5b79 100644 --- a/app/controllers/private/order_asks_controller.rb +++ b/app/controllers/private/order_asks_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Private class OrderAsksController < BaseController include Concerns::OrderCreation diff --git a/app/controllers/private/order_bids_controller.rb b/app/controllers/private/order_bids_controller.rb index 5a83d5ff27..41b3d0e61e 100644 --- a/app/controllers/private/order_bids_controller.rb +++ b/app/controllers/private/order_bids_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Private class OrderBidsController < BaseController include Concerns::OrderCreation diff --git a/app/controllers/private/orders_controller.rb b/app/controllers/private/orders_controller.rb index 5f9b58be47..64e2cd5103 100644 --- a/app/controllers/private/orders_controller.rb +++ b/app/controllers/private/orders_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Private class OrdersController < BaseController diff --git a/app/controllers/private/pusher_controller.rb b/app/controllers/private/pusher_controller.rb index 8f32fcd6dd..b2509837fc 100644 --- a/app/controllers/private/pusher_controller.rb +++ b/app/controllers/private/pusher_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require "openssl" module Private diff --git a/app/controllers/private/settings_controller.rb b/app/controllers/private/settings_controller.rb index 35dd616e82..684c12d1b1 100644 --- a/app/controllers/private/settings_controller.rb +++ b/app/controllers/private/settings_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Private class SettingsController < BaseController def index diff --git a/app/controllers/private/withdraws_controller.rb b/app/controllers/private/withdraws_controller.rb index c4b88ea193..f4e4efe5d2 100644 --- a/app/controllers/private/withdraws_controller.rb +++ b/app/controllers/private/withdraws_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Private class WithdrawsController < BaseController before_action :auth_verified! diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index bf8dfc60aa..6f91ecba98 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class SessionsController < ApplicationController before_action :auth_member!, only: :destroy before_action :auth_anybody!, only: :failure diff --git a/app/controllers/webhooks_controller.rb b/app/controllers/webhooks_controller.rb index 79fd28e8e2..0edc471702 100644 --- a/app/controllers/webhooks_controller.rb +++ b/app/controllers/webhooks_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class WebhooksController < ApplicationController skip_before_action :verify_authenticity_token diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 1e3ce920f9..40a6e75e78 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class WelcomeController < ApplicationController layout 'landing' include Concerns::DisableCabinetUI diff --git a/app/enums/member/levels.rb b/app/enums/member/levels.rb index b6bcf9cc28..f57960a8e9 100644 --- a/app/enums/member/levels.rb +++ b/app/enums/member/levels.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require_dependency 'member' class Member diff --git a/app/grids/account_versions_grid.rb b/app/grids/account_versions_grid.rb index d0f9549a16..1b78178a76 100644 --- a/app/grids/account_versions_grid.rb +++ b/app/grids/account_versions_grid.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class AccountVersionsGrid include Datagrid include Datagrid::Naming diff --git a/app/grids/proofs_grid.rb b/app/grids/proofs_grid.rb index 9d86e8b30f..5116074884 100644 --- a/app/grids/proofs_grid.rb +++ b/app/grids/proofs_grid.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class ProofsGrid include Datagrid diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a2ae19e39d..9107ad38c9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module ApplicationHelper def check_active(klass) if klass.is_a? String diff --git a/app/helpers/currency_helper.rb b/app/helpers/currency_helper.rb index e094837b14..a7ce171bfc 100644 --- a/app/helpers/currency_helper.rb +++ b/app/helpers/currency_helper.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module CurrencyHelper # Yaroslav Konoplov: I don't use #image_path & #image_url here # since Gon::Jbuilder attaches ActionView::Helpers which behave differently diff --git a/app/helpers/private/assets_helper.rb b/app/helpers/private/assets_helper.rb index 0f93c8e608..dd68b06941 100644 --- a/app/helpers/private/assets_helper.rb +++ b/app/helpers/private/assets_helper.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Private::AssetsHelper def verify_link(proof, partial_tree) diff --git a/app/helpers/private/history_helper.rb b/app/helpers/private/history_helper.rb index 09b4b5a8a7..1b498a43cf 100644 --- a/app/helpers/private/history_helper.rb +++ b/app/helpers/private/history_helper.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Private::HistoryHelper def trade_side(trade) trade.ask_member == current_user ? 'sell' : 'buy' diff --git a/app/helpers/tag_helper.rb b/app/helpers/tag_helper.rb index 365699f875..a008f8664e 100644 --- a/app/helpers/tag_helper.rb +++ b/app/helpers/tag_helper.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module TagHelper def admin_asset_tag(asset) return if asset.blank? diff --git a/app/models/account.rb b/app/models/account.rb index 9cd7ec0147..b786a97565 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class Account < ActiveRecord::Base include Currencible diff --git a/app/models/account_version.rb b/app/models/account_version.rb index 56860ba7f5..0a3466c8bf 100644 --- a/app/models/account_version.rb +++ b/app/models/account_version.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class AccountVersion < ActiveRecord::Base extend Enumerize include Currencible diff --git a/app/models/admin/ability.rb b/app/models/admin/ability.rb index cf674e2a82..311ed078f6 100644 --- a/app/models/admin/ability.rb +++ b/app/models/admin/ability.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Admin class Ability include CanCan::Ability diff --git a/app/models/amqp_config.rb b/app/models/amqp_config.rb index 8f804f85cc..c8863c48a9 100644 --- a/app/models/amqp_config.rb +++ b/app/models/amqp_config.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class AMQPConfig class < 'Deposits::Bank' ] diff --git a/db/migrate/20180315145436_remove_in_and_out.rb b/db/migrate/20180315145436_remove_in_and_out.rb index 6fc98063d7..8b877a9b60 100644 --- a/db/migrate/20180315145436_remove_in_and_out.rb +++ b/db/migrate/20180315145436_remove_in_and_out.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class RemoveInAndOut < ActiveRecord::Migration def change remove_columns :accounts, :in, :out diff --git a/db/migrate/20180315150348_migrate_all_bank_models_to_fiat.rb b/db/migrate/20180315150348_migrate_all_bank_models_to_fiat.rb index ae2756d28c..eb2ef73b21 100644 --- a/db/migrate/20180315150348_migrate_all_bank_models_to_fiat.rb +++ b/db/migrate/20180315150348_migrate_all_bank_models_to_fiat.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class MigrateAllBankModelsToFiat < ActiveRecord::Migration def change execute %[ UPDATE deposits SET type = 'Deposits::Fiat' WHERE type = 'Deposits::Bank' ] diff --git a/db/migrate/20180315185255_remove_key_from_currency.rb b/db/migrate/20180315185255_remove_key_from_currency.rb index dd1775901a..fb7c31d62d 100644 --- a/db/migrate/20180315185255_remove_key_from_currency.rb +++ b/db/migrate/20180315185255_remove_key_from_currency.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class RemoveKeyFromCurrency < ActiveRecord::Migration def change remove_column :currencies, :key diff --git a/db/migrate/20180325001828_create_markets.rb b/db/migrate/20180325001828_create_markets.rb index 28d0d97286..0ccb9a9faa 100644 --- a/db/migrate/20180325001828_create_markets.rb +++ b/db/migrate/20180325001828_create_markets.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class CreateMarkets < ActiveRecord::Migration def change create_table :markets do |t| diff --git a/db/migrate/20180327020701_alter_currency.rb b/db/migrate/20180327020701_alter_currency.rb index 08b0865e5f..69631ccb92 100644 --- a/db/migrate/20180327020701_alter_currency.rb +++ b/db/migrate/20180327020701_alter_currency.rb @@ -1,5 +1,8 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class AlterCurrency < ActiveRecord::Migration def change change_column :orders, :currency, :string, limit: 10 end -end \ No newline at end of file +end diff --git a/db/migrate/20180329145257_alter_trades_currency.rb b/db/migrate/20180329145257_alter_trades_currency.rb index 51f62dd62f..d4f2f235c4 100644 --- a/db/migrate/20180329145257_alter_trades_currency.rb +++ b/db/migrate/20180329145257_alter_trades_currency.rb @@ -1,6 +1,9 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class AlterTradesCurrency < ActiveRecord::Migration def change change_column :trades, :currency, :string, limit: 10 rename_column :trades, :currency, :market_id end -end \ No newline at end of file +end diff --git a/db/migrate/20180329145557_alter_orders_currency.rb b/db/migrate/20180329145557_alter_orders_currency.rb index 62b5b549fd..5261c77619 100644 --- a/db/migrate/20180329145557_alter_orders_currency.rb +++ b/db/migrate/20180329145557_alter_orders_currency.rb @@ -1,5 +1,8 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class AlterOrdersCurrency < ActiveRecord::Migration def change rename_column :orders, :currency, :market_id end -end \ No newline at end of file +end diff --git a/db/migrate/20180329154130_update_deprecated_currency_ids.rb b/db/migrate/20180329154130_update_deprecated_currency_ids.rb index 7bb6ff17b2..194de3745e 100644 --- a/db/migrate/20180329154130_update_deprecated_currency_ids.rb +++ b/db/migrate/20180329154130_update_deprecated_currency_ids.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class UpdateDeprecatedCurrencyIds < ActiveRecord::Migration def change # Migrate deprecated market codes to new. diff --git a/db/migrate/20180403115050_add_tid_to_deposit.rb b/db/migrate/20180403115050_add_tid_to_deposit.rb index 9acbe2e04b..9ad9730eb8 100644 --- a/db/migrate/20180403115050_add_tid_to_deposit.rb +++ b/db/migrate/20180403115050_add_tid_to_deposit.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class AddTIDToDeposit < ActiveRecord::Migration def change add_column :deposits, :tid, :string, limit: 64 diff --git a/db/migrate/20180403134930_add_tid_to_withdraw.rb b/db/migrate/20180403134930_add_tid_to_withdraw.rb index 91c709e9a7..4432abdd80 100644 --- a/db/migrate/20180403134930_add_tid_to_withdraw.rb +++ b/db/migrate/20180403134930_add_tid_to_withdraw.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class AddTIDToWithdraw < ActiveRecord::Migration def change add_column :withdraws, :tid, :string, limit: 64 diff --git a/db/migrate/20180403135744_add_bid_to_withdraws.rb b/db/migrate/20180403135744_add_bid_to_withdraws.rb index a41c9674a9..ac655b46bb 100644 --- a/db/migrate/20180403135744_add_bid_to_withdraws.rb +++ b/db/migrate/20180403135744_add_bid_to_withdraws.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class AddBidToWithdraws < ActiveRecord::Migration def change add_column :withdraws, :bid, :string, limit: 64 diff --git a/db/migrate/20180403145234_change_bid_to_rid.rb b/db/migrate/20180403145234_change_bid_to_rid.rb index 6df7673764..bab8f9704d 100644 --- a/db/migrate/20180403145234_change_bid_to_rid.rb +++ b/db/migrate/20180403145234_change_bid_to_rid.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class ChangeBidToRid < ActiveRecord::Migration def change rename_column :withdraws, :bid, :rid diff --git a/db/migrate/20180403231931_migrate_states.rb b/db/migrate/20180403231931_migrate_states.rb index 55b9c7f3d8..9101981f08 100644 --- a/db/migrate/20180403231931_migrate_states.rb +++ b/db/migrate/20180403231931_migrate_states.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class MigrateStates < ActiveRecord::Migration def change execute %{UPDATE deposits SET aasm_state = 'submitted' WHERE aasm_state = 'submitting'} diff --git a/db/migrate/20180406080444_drop_withdraw_destinations.rb b/db/migrate/20180406080444_drop_withdraw_destinations.rb index 0ca2922075..449186944f 100644 --- a/db/migrate/20180406080444_drop_withdraw_destinations.rb +++ b/db/migrate/20180406080444_drop_withdraw_destinations.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class DropWithdrawDestinations < ActiveRecord::Migration class WithdrawDestination < ActiveRecord::Base serialize :details, JSON diff --git a/db/migrate/20180406185130_remove_sn_from_withdraw.rb b/db/migrate/20180406185130_remove_sn_from_withdraw.rb index c315ee6724..35aabbd2ee 100644 --- a/db/migrate/20180406185130_remove_sn_from_withdraw.rb +++ b/db/migrate/20180406185130_remove_sn_from_withdraw.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class RemoveSnFromWithdraw < ActiveRecord::Migration def change remove_column :withdraws, :sn diff --git a/db/migrate/20180407082641_remove_fund_uid_extra_from_deposit.rb b/db/migrate/20180407082641_remove_fund_uid_extra_from_deposit.rb index 679df31087..1eaecc53b2 100644 --- a/db/migrate/20180407082641_remove_fund_uid_extra_from_deposit.rb +++ b/db/migrate/20180407082641_remove_fund_uid_extra_from_deposit.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class RemoveFundUidExtraFromDeposit < ActiveRecord::Migration def change remove_column :deposits, :fund_uid diff --git a/db/migrate/20180409115144_drop_useless_deposit_state.rb b/db/migrate/20180409115144_drop_useless_deposit_state.rb index a77c1f3740..962e7ee6f3 100644 --- a/db/migrate/20180409115144_drop_useless_deposit_state.rb +++ b/db/migrate/20180409115144_drop_useless_deposit_state.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class DropUselessDepositState < ActiveRecord::Migration def change remove_column :deposits, :state diff --git a/db/migrate/20180409115902_refactor_deposit.rb b/db/migrate/20180409115902_refactor_deposit.rb index efb07b0bf4..e95ac50f3c 100644 --- a/db/migrate/20180409115902_refactor_deposit.rb +++ b/db/migrate/20180409115902_refactor_deposit.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class RefactorDeposit < ActiveRecord::Migration def change change_column_null :deposits, :account_id, false diff --git a/db/migrate/20180416160438_add_fee_to_orders.rb b/db/migrate/20180416160438_add_fee_to_orders.rb index 7b9ef65d2f..c92e701691 100644 --- a/db/migrate/20180416160438_add_fee_to_orders.rb +++ b/db/migrate/20180416160438_add_fee_to_orders.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class AddFeeToOrders < ActiveRecord::Migration def change add_column :orders, :fee, :decimal, null: false, default: 0, precision: 7, scale: 6, after: :origin_volume diff --git a/db/migrate/20180417085823_migrate_deposit_channels_to_currency.rb b/db/migrate/20180417085823_migrate_deposit_channels_to_currency.rb index 9b04044f25..6fef72e8ed 100644 --- a/db/migrate/20180417085823_migrate_deposit_channels_to_currency.rb +++ b/db/migrate/20180417085823_migrate_deposit_channels_to_currency.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class MigrateDepositChannelsToCurrency < ActiveRecord::Migration def change if defined?(Currency) && File.file?('config/deposit_channels.old.yml') diff --git a/db/migrate/20180417111305_migrate_withdraw_channels_to_currency.rb b/db/migrate/20180417111305_migrate_withdraw_channels_to_currency.rb index 4413fe562f..fafda03420 100644 --- a/db/migrate/20180417111305_migrate_withdraw_channels_to_currency.rb +++ b/db/migrate/20180417111305_migrate_withdraw_channels_to_currency.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class MigrateWithdrawChannelsToCurrency < ActiveRecord::Migration def change add_column :currencies, :withdraw_fee, :decimal, after: :quick_withdraw_limit, null: false, default: 0, precision: 7, scale: 6 diff --git a/db/migrate/20180417175453_increase_fee_limits.rb b/db/migrate/20180417175453_increase_fee_limits.rb index 7c3aae9a5c..98b429d9ee 100644 --- a/db/migrate/20180417175453_increase_fee_limits.rb +++ b/db/migrate/20180417175453_increase_fee_limits.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class IncreaseFeeLimits < ActiveRecord::Migration def change change_column :markets, :ask_fee, :decimal, null: false, default: 0, precision: 32, scale: 16 diff --git a/db/migrate/20180419122223_add_deposit_fee_to_currencies.rb b/db/migrate/20180419122223_add_deposit_fee_to_currencies.rb index 6b51f8fb3e..42a00e9aa2 100644 --- a/db/migrate/20180419122223_add_deposit_fee_to_currencies.rb +++ b/db/migrate/20180419122223_add_deposit_fee_to_currencies.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class AddDepositFeeToCurrencies < ActiveRecord::Migration def change add_column :currencies, :deposit_fee, :decimal, after: :type, null: false, default: 0, precision: 32, scale: 16 diff --git a/db/migrate/20180425094920_limit_trading_fee.rb b/db/migrate/20180425094920_limit_trading_fee.rb index 4907c2d86f..b305aae321 100644 --- a/db/migrate/20180425094920_limit_trading_fee.rb +++ b/db/migrate/20180425094920_limit_trading_fee.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class LimitTradingFee < ActiveRecord::Migration def change execute %{UPDATE markets SET ask_fee = 0.5 WHERE ask_fee > 0.5} diff --git a/db/migrate/20180425152420_convert_to_legacy_bitcoin_cash_addresses.rb b/db/migrate/20180425152420_convert_to_legacy_bitcoin_cash_addresses.rb index e7ff71fc56..b734a177a6 100644 --- a/db/migrate/20180425152420_convert_to_legacy_bitcoin_cash_addresses.rb +++ b/db/migrate/20180425152420_convert_to_legacy_bitcoin_cash_addresses.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class ConvertToLegacyBitcoinCashAddresses < ActiveRecord::Migration def change return unless defined?(PaymentAddress) diff --git a/db/migrate/20180425224307_change_wallet_id_to_address_id.rb b/db/migrate/20180425224307_change_wallet_id_to_address_id.rb index 76b6b06805..4e04331701 100644 --- a/db/migrate/20180425224307_change_wallet_id_to_address_id.rb +++ b/db/migrate/20180425224307_change_wallet_id_to_address_id.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class ChangeWalletIdToAddressId < ActiveRecord::Migration def change return unless defined?(PaymentAddress) diff --git a/db/migrate/20180501082703_normalize_addresses_and_transactions.rb b/db/migrate/20180501082703_normalize_addresses_and_transactions.rb index 14b68707eb..59e95cc106 100644 --- a/db/migrate/20180501082703_normalize_addresses_and_transactions.rb +++ b/db/migrate/20180501082703_normalize_addresses_and_transactions.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class NormalizeAddressesAndTransactions < ActiveRecord::Migration class Ccy < ActiveRecord::Base serialize :options, JSON diff --git a/db/migrate/20180501141718_case_sensitive_data.rb b/db/migrate/20180501141718_case_sensitive_data.rb index 2544ab03e2..a925765536 100644 --- a/db/migrate/20180501141718_case_sensitive_data.rb +++ b/db/migrate/20180501141718_case_sensitive_data.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class CaseSensitiveData < ActiveRecord::Migration def change execute %[ALTER TABLE deposits MODIFY address VARCHAR(64) BINARY;] diff --git a/db/schema.rb b/db/schema.rb index 7f1ce69dda..3befd331c9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,4 +1,6 @@ # encoding: UTF-8 +# frozen_string_literal: true + # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. diff --git a/db/seeds.rb b/db/seeds.rb index b67c51b0f4..b3e10f0914 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,2 +1,5 @@ +# encoding: UTF-8 +# frozen_string_literal: true + Rake::Task['currencies:seed'].invoke Rake::Task['markets:seed'].invoke diff --git a/lib/aasm/locking.rb b/lib/aasm/locking.rb index d3c4b2d10f..caae78af7f 100644 --- a/lib/aasm/locking.rb +++ b/lib/aasm/locking.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module AASM::Locking def aasm_write_state(*) lock! diff --git a/lib/coin_api.rb b/lib/coin_api.rb index 1b13d5a35a..4b35ea3416 100644 --- a/lib/coin_api.rb +++ b/lib/coin_api.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module CoinAPI Error = Class.new(StandardError) # TODO: Rename to Exception. ConnectionRefusedError = Class.new(StandardError) # TODO: Remove this. diff --git a/lib/coin_api/bch.rb b/lib/coin_api/bch.rb index 3ec1504212..4201b336c4 100644 --- a/lib/coin_api/bch.rb +++ b/lib/coin_api/bch.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module CoinAPI class BCH < BTC def normalize_address(address) diff --git a/lib/coin_api/bit_go.rb b/lib/coin_api/bit_go.rb index f304e533d3..ac692d41e8 100644 --- a/lib/coin_api/bit_go.rb +++ b/lib/coin_api/bit_go.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require 'cgi' module CoinAPI diff --git a/lib/coin_api/btc.rb b/lib/coin_api/btc.rb index f054e83be9..6a3e434e3a 100644 --- a/lib/coin_api/btc.rb +++ b/lib/coin_api/btc.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module CoinAPI class BTC < BaseAPI def initialize(*) diff --git a/lib/coin_api/dash.rb b/lib/coin_api/dash.rb index b90c53a422..3c58374dc4 100644 --- a/lib/coin_api/dash.rb +++ b/lib/coin_api/dash.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module CoinAPI class DASH < BTC diff --git a/lib/coin_api/erc20.rb b/lib/coin_api/erc20.rb index 5641ae2f58..4c62eaec5e 100644 --- a/lib/coin_api/erc20.rb +++ b/lib/coin_api/erc20.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module CoinAPI class ERC20 < ETH def contract_address diff --git a/lib/coin_api/eth.rb b/lib/coin_api/eth.rb index 4eed4d5a42..c815253dcf 100644 --- a/lib/coin_api/eth.rb +++ b/lib/coin_api/eth.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module CoinAPI class ETH < BaseAPI def initialize(*) diff --git a/lib/coin_api/ltc.rb b/lib/coin_api/ltc.rb index 72330fe2ce..0d2dbacc49 100644 --- a/lib/coin_api/ltc.rb +++ b/lib/coin_api/ltc.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module CoinAPI class LTC < BTC diff --git a/lib/coin_api/xrp.rb b/lib/coin_api/xrp.rb index 924e5d27fd..c750b9a539 100644 --- a/lib/coin_api/xrp.rb +++ b/lib/coin_api/xrp.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module CoinAPI class XRP < BaseAPI def initialize(*) diff --git a/lib/daemons/amqp_daemon.rb b/lib/daemons/amqp_daemon.rb index 73254a0fc8..8d2e8a8759 100644 --- a/lib/daemons/amqp_daemon.rb +++ b/lib/daemons/amqp_daemon.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require File.join(ENV.fetch('RAILS_ROOT'), 'config', 'environment') raise "bindings must be provided." if ARGV.size == 0 diff --git a/lib/daemons/coins.rb b/lib/daemons/coins.rb index ca947a3d19..88f0a727e0 100755 --- a/lib/daemons/coins.rb +++ b/lib/daemons/coins.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require File.join(ENV.fetch('RAILS_ROOT'), 'config', 'environment') running = true diff --git a/lib/daemons/daemons.god b/lib/daemons/daemons.god index 3953c66df4..b0ba0d4c53 100644 --- a/lib/daemons/daemons.god +++ b/lib/daemons/daemons.god @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + RAILS_ENV = ENV.fetch('RAILS_ENV', 'development') RAILS_ROOT = File.expand_path('../../..', __FILE__) diff --git a/lib/daemons/global_state.rb b/lib/daemons/global_state.rb index 29de9d3069..e8089f684b 100755 --- a/lib/daemons/global_state.rb +++ b/lib/daemons/global_state.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require File.join(ENV.fetch('RAILS_ROOT'), 'config', 'environment') $running = true diff --git a/lib/daemons/hot_wallets.rb b/lib/daemons/hot_wallets.rb index ea9b4af502..fa99beff15 100755 --- a/lib/daemons/hot_wallets.rb +++ b/lib/daemons/hot_wallets.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require File.join(ENV.fetch('RAILS_ROOT'), 'config', 'environment') $running = true diff --git a/lib/daemons/k.rb b/lib/daemons/k.rb index 596aaf26d9..883c527702 100755 --- a/lib/daemons/k.rb +++ b/lib/daemons/k.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require File.join(ENV.fetch('RAILS_ROOT'), "config", "environment") @logger = Rails.logger diff --git a/lib/daemons/payment_transaction.rb b/lib/daemons/payment_transaction.rb index f9bf93c624..affb8ecda2 100755 --- a/lib/daemons/payment_transaction.rb +++ b/lib/daemons/payment_transaction.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require File.join(ENV.fetch('RAILS_ROOT'), 'config', 'environment') running = true diff --git a/lib/daemons/websocket_api.rb b/lib/daemons/websocket_api.rb index f5c512c0f3..3cea26fc26 100755 --- a/lib/daemons/websocket_api.rb +++ b/lib/daemons/websocket_api.rb @@ -1,3 +1,4 @@ +# encoding: UTF-8 # frozen_string_literal: true require 'em-websocket' diff --git a/lib/daemons/withdraw_audit.rb b/lib/daemons/withdraw_audit.rb index 09ef82384b..2815e0afad 100755 --- a/lib/daemons/withdraw_audit.rb +++ b/lib/daemons/withdraw_audit.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require File.join(ENV.fetch('RAILS_ROOT'), 'config', 'environment') $running = true diff --git a/lib/datagrid/column_i18n.rb b/lib/datagrid/column_i18n.rb index 9051c70a9e..449ce14d9a 100644 --- a/lib/datagrid/column_i18n.rb +++ b/lib/datagrid/column_i18n.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Datagrid module ColumnI18n extend ActiveSupport::Concern diff --git a/lib/datagrid/naming.rb b/lib/datagrid/naming.rb index ceed11c302..b8a2c27f32 100644 --- a/lib/datagrid/naming.rb +++ b/lib/datagrid/naming.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Datagrid module Naming extend ActiveSupport::Concern diff --git a/lib/js_locale_helper.rb b/lib/js_locale_helper.rb index c784386217..17759af79f 100644 --- a/lib/js_locale_helper.rb +++ b/lib/js_locale_helper.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module JsLocaleHelper def self.load_yaml(locale) @@ -9,11 +12,9 @@ def self.load_yaml(locale) {locale_str => {}} end - def self.output_locale(locale=:en) - result = "" - result << "I18n.translations = #{load_yaml(locale).to_json};\n" - result << "I18n.locale = '#{locale}';\n" - result + def self.output_locale(locale = :en) + "I18n.translations = #{load_yaml(locale).to_json}; + I18n.locale = '#{locale}';" end end diff --git a/lib/kline_db.rb b/lib/kline_db.rb index 8c1ae10f9b..845f57b296 100644 --- a/lib/kline_db.rb +++ b/lib/kline_db.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module KlineDB class << self diff --git a/lib/market_constraint.rb b/lib/market_constraint.rb index 0c96ccd35f..d62da8226b 100644 --- a/lib/market_constraint.rb +++ b/lib/market_constraint.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class MarketConstraint def self.matches?(request) id = request.path_parameters[:market_id] || request.path_parameters[:id] diff --git a/lib/peatio.rb b/lib/peatio.rb index 1230e158d2..464c064978 100644 --- a/lib/peatio.rb +++ b/lib/peatio.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Peatio end diff --git a/lib/peatio/feeders/abstract_feeder.rb b/lib/peatio/feeders/abstract_feeder.rb index e2a303c10f..e563736809 100644 --- a/lib/peatio/feeders/abstract_feeder.rb +++ b/lib/peatio/feeders/abstract_feeder.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class AbstractFeeder def feed diff --git a/lib/peatio/feeders/admin_feeder.rb b/lib/peatio/feeders/admin_feeder.rb index 4d0cd25739..9bb2bc5ac4 100644 --- a/lib/peatio/feeders/admin_feeder.rb +++ b/lib/peatio/feeders/admin_feeder.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class AdminFeeder < MemberFeeder end diff --git a/lib/peatio/feeders/admins_feeder.rb b/lib/peatio/feeders/admins_feeder.rb index 522dd3edb2..aba6fe223d 100644 --- a/lib/peatio/feeders/admins_feeder.rb +++ b/lib/peatio/feeders/admins_feeder.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class AdminsFeeder < AbstractFeeder def feed feeder = AdminFeeder.new diff --git a/lib/peatio/feeders/member_feeder.rb b/lib/peatio/feeders/member_feeder.rb index 94b31199a7..30b93cb15c 100644 --- a/lib/peatio/feeders/member_feeder.rb +++ b/lib/peatio/feeders/member_feeder.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class MemberFeeder < AbstractFeeder def feed(email) Member.transaction do diff --git a/lib/peatio/feeders/members_feeder.rb b/lib/peatio/feeders/members_feeder.rb index 00cfee8b91..3e2d345fda 100644 --- a/lib/peatio/feeders/members_feeder.rb +++ b/lib/peatio/feeders/members_feeder.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + class MembersFeeder < AbstractFeeder def feed(n = 10) feeder = MemberFeeder.new diff --git a/lib/peatio/tasks/feed.rake b/lib/peatio/tasks/feed.rake index 0a82cfc43c..552a21f6aa 100644 --- a/lib/peatio/tasks/feed.rake +++ b/lib/peatio/tasks/feed.rake @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + namespace :peatio do desc 'Fill database with demo members' task feed: :environment do diff --git a/lib/peatio/tasks/test.rake b/lib/peatio/tasks/test.rake index 6b267b61e1..629fd87168 100644 --- a/lib/peatio/tasks/test.rake +++ b/lib/peatio/tasks/test.rake @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + namespace :peatio do namespace :test do desc 'Fill database with fake data' diff --git a/lib/peatio/version.rb b/lib/peatio/version.rb index c987244730..4628af9fa3 100644 --- a/lib/peatio/version.rb +++ b/lib/peatio/version.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Peatio VERSION = '1.8.7' end diff --git a/lib/tasks/accounts.rake b/lib/tasks/accounts.rake index 1f1ba83354..ac155f8eae 100644 --- a/lib/tasks/accounts.rake +++ b/lib/tasks/accounts.rake @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + namespace :accounts do desc 'Create missing accounts for existing members.' task touch: :environment do diff --git a/lib/tasks/auto_annotate_models.rake b/lib/tasks/auto_annotate_models.rake index 0d6522f0b5..a75444a775 100644 --- a/lib/tasks/auto_annotate_models.rake +++ b/lib/tasks/auto_annotate_models.rake @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + # NOTE: only doing this in development as some production environments (Heroku) # NOTE: are sensitive to local FS writes, and besides -- it's just not proper # NOTE: to have a dev-mode tool do its thing in production. diff --git a/lib/tasks/barong.rake b/lib/tasks/barong.rake index ad67c53cd2..8f47b7af08 100644 --- a/lib/tasks/barong.rake +++ b/lib/tasks/barong.rake @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + namespace :barong do desc 'Refresh access level for Barong members.' task levels: :environment do diff --git a/lib/tasks/currencies.rake b/lib/tasks/currencies.rake index 530f090987..014dda9cd4 100644 --- a/lib/tasks/currencies.rake +++ b/lib/tasks/currencies.rake @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + namespace :currencies do desc 'Adds missing currencies to database defined at config/seed/currencies.yml.' task seed: :environment do diff --git a/lib/tasks/markets.rake b/lib/tasks/markets.rake index 4db77798ae..3cdde5a137 100644 --- a/lib/tasks/markets.rake +++ b/lib/tasks/markets.rake @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + namespace :markets do desc 'Adds missing markets to database defined at config/seed/markets.yml.' task seed: :environment do diff --git a/lib/tasks/solvency.rake b/lib/tasks/solvency.rake index 5ea74d4c1a..70598aa1d6 100644 --- a/lib/tasks/solvency.rake +++ b/lib/tasks/solvency.rake @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + namespace :solvency do desc 'Clear old liability proofs' task clean: :environment do diff --git a/lib/tasks/yarn.rake b/lib/tasks/yarn.rake index d10483f537..7dbf851a2b 100644 --- a/lib/tasks/yarn.rake +++ b/lib/tasks/yarn.rake @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + namespace :yarn do task :install do system 'yarn install --modules-folder ./vendor/assets/yarn_components/yarn_components' diff --git a/spec/api/api_v2/auth/jwt_authenticator_spec.rb b/spec/api/api_v2/auth/jwt_authenticator_spec.rb index 2b0f185640..35d423841f 100644 --- a/spec/api/api_v2/auth/jwt_authenticator_spec.rb +++ b/spec/api/api_v2/auth/jwt_authenticator_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Auth::JWTAuthenticator do let :token do 'Bearer ' + jwt_build(payload) diff --git a/spec/api/api_v2/auth/middleware_spec.rb b/spec/api/api_v2/auth/middleware_spec.rb index 91e961bf83..30f1bdbcee 100644 --- a/spec/api/api_v2/auth/middleware_spec.rb +++ b/spec/api/api_v2/auth/middleware_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Auth::Middleware, type: :request do class TestApp < Grape::API helpers APIv2::Helpers diff --git a/spec/api/api_v2/cors_spec.rb b/spec/api/api_v2/cors_spec.rb index d67970483f..41ce1cc5ce 100644 --- a/spec/api/api_v2/cors_spec.rb +++ b/spec/api/api_v2/cors_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Members, type: :request do let(:member) { create :member, :verified_identity } let(:token) { jwt_for(member) } diff --git a/spec/api/api_v2/deposits_spec.rb b/spec/api/api_v2/deposits_spec.rb index 84a733cb57..d79533405e 100644 --- a/spec/api/api_v2/deposits_spec.rb +++ b/spec/api/api_v2/deposits_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Deposits, type: :request do let(:member) { create(:member, :verified_identity) } let(:other_member) { create(:member, :verified_identity) } diff --git a/spec/api/api_v2/entities/account_spec.rb b/spec/api/api_v2/entities/account_spec.rb index fb4c702e27..f06c73461d 100644 --- a/spec/api/api_v2/entities/account_spec.rb +++ b/spec/api/api_v2/entities/account_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Entities::Account do let(:account) { create_account(:btc, balance: 100) } diff --git a/spec/api/api_v2/entities/member_spec.rb b/spec/api/api_v2/entities/member_spec.rb index 4319c61e81..15753a639f 100644 --- a/spec/api/api_v2/entities/member_spec.rb +++ b/spec/api/api_v2/entities/member_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Entities::Member do let(:member) { create(:member, :verified_identity) } diff --git a/spec/api/api_v2/entities/order_spec.rb b/spec/api/api_v2/entities/order_spec.rb index e1e521fcfd..634e8cc705 100644 --- a/spec/api/api_v2/entities/order_spec.rb +++ b/spec/api/api_v2/entities/order_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Entities::Order do let(:order) do create( diff --git a/spec/api/api_v2/entities/trade_spec.rb b/spec/api/api_v2/entities/trade_spec.rb index 433fd5754b..e20d6c5203 100644 --- a/spec/api/api_v2/entities/trade_spec.rb +++ b/spec/api/api_v2/entities/trade_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Entities::Trade do let(:trade) do create :trade, ask: create(:order_ask), bid: create(:order_bid) diff --git a/spec/api/api_v2/fees_spec.rb b/spec/api/api_v2/fees_spec.rb index f5ed83cf20..c84f844a1f 100644 --- a/spec/api/api_v2/fees_spec.rb +++ b/spec/api/api_v2/fees_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Fees, type: :request do describe 'GET /api/v2/fees/withdraw' do it 'returns withdraw fees for every visible currency' do diff --git a/spec/api/api_v2/helpers_spec.rb b/spec/api/api_v2/helpers_spec.rb index 1e04e2e1f1..22f8f5caff 100644 --- a/spec/api/api_v2/helpers_spec.rb +++ b/spec/api/api_v2/helpers_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class AuthTest < Grape::API get('/auth_test') do diff --git a/spec/api/api_v2/markets_spec.rb b/spec/api/api_v2/markets_spec.rb index a4c3e44180..02d9509dbe 100644 --- a/spec/api/api_v2/markets_spec.rb +++ b/spec/api/api_v2/markets_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Markets, type: :request do describe 'GET /api/v2/markets' do it 'should all available markets' do diff --git a/spec/api/api_v2/members_spec.rb b/spec/api/api_v2/members_spec.rb index 9c37098082..90b590b753 100644 --- a/spec/api/api_v2/members_spec.rb +++ b/spec/api/api_v2/members_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Members, type: :request do let(:member) do create(:member, :verified_identity).tap do |m| diff --git a/spec/api/api_v2/mount_spec.rb b/spec/api/api_v2/mount_spec.rb index 413451b8ee..5486ac1d15 100644 --- a/spec/api/api_v2/mount_spec.rb +++ b/spec/api/api_v2/mount_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APIv2 class Mount get('/null') { '' } diff --git a/spec/api/api_v2/order_books_spec.rb b/spec/api/api_v2/order_books_spec.rb index 07dc365fff..eec9aab8f7 100644 --- a/spec/api/api_v2/order_books_spec.rb +++ b/spec/api/api_v2/order_books_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::OrderBooks, type: :request do describe 'GET /api/v2/order_book' do before do diff --git a/spec/api/api_v2/orders_spec.rb b/spec/api/api_v2/orders_spec.rb index 5ad4af3a78..3391b65443 100644 --- a/spec/api/api_v2/orders_spec.rb +++ b/spec/api/api_v2/orders_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Orders, type: :request do let(:member) { create(:member, :verified_identity) } let(:unverified_member) { create(:member, :unverified) } diff --git a/spec/api/api_v2/sessions_spec.rb b/spec/api/api_v2/sessions_spec.rb index 1b33841344..52d056389b 100644 --- a/spec/api/api_v2/sessions_spec.rb +++ b/spec/api/api_v2/sessions_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Sessions, type: :request do let(:member) { create(:member, :verified_identity) } let(:token) { jwt_for(member) } diff --git a/spec/api/api_v2/solvency_spec.rb b/spec/api/api_v2/solvency_spec.rb index f0b421ca6b..9570e02e70 100644 --- a/spec/api/api_v2/solvency_spec.rb +++ b/spec/api/api_v2/solvency_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Solvency, type: :request do let!(:member) { create(:member, :verified_identity) } diff --git a/spec/api/api_v2/tickers_spec.rb b/spec/api/api_v2/tickers_spec.rb index bcdee37abf..cbb0257035 100644 --- a/spec/api/api_v2/tickers_spec.rb +++ b/spec/api/api_v2/tickers_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Tickers, type: :request do describe 'GET /api/v2/tickers' do it 'returns ticker of all markets' do diff --git a/spec/api/api_v2/trades_spec.rb b/spec/api/api_v2/trades_spec.rb index 05478ade93..d2e628c133 100644 --- a/spec/api/api_v2/trades_spec.rb +++ b/spec/api/api_v2/trades_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Trades, type: :request do let(:member) do create(:member, :verified_identity).tap do |m| diff --git a/spec/api/api_v2/withdraws_spec.rb b/spec/api/api_v2/withdraws_spec.rb index b894fff416..5d56a4e544 100644 --- a/spec/api/api_v2/withdraws_spec.rb +++ b/spec/api/api_v2/withdraws_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe APIv2::Withdraws, type: :request do let(:member) { create(:member, :verified_identity) } let(:token) { jwt_for(member) } diff --git a/spec/api/management_api_v1/accounts_spec.rb b/spec/api/management_api_v1/accounts_spec.rb index 402a9588f7..e83dbbb468 100644 --- a/spec/api/management_api_v1/accounts_spec.rb +++ b/spec/api/management_api_v1/accounts_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe ManagementAPIv1::Deposits, type: :request do before do defaults_for_management_api_v1_security_configuration! diff --git a/spec/api/management_api_v1/deposits_spec.rb b/spec/api/management_api_v1/deposits_spec.rb index fa3ea939f4..e6912a637d 100644 --- a/spec/api/management_api_v1/deposits_spec.rb +++ b/spec/api/management_api_v1/deposits_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe ManagementAPIv1::Deposits, type: :request do before do defaults_for_management_api_v1_security_configuration! diff --git a/spec/api/management_api_v1/entities/balance_spec.rb b/spec/api/management_api_v1/entities/balance_spec.rb index 856b216ddf..e42e3736b2 100644 --- a/spec/api/management_api_v1/entities/balance_spec.rb +++ b/spec/api/management_api_v1/entities/balance_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe ManagementAPIv1::Entities::Balance do let(:member) { create(:member, :barong) } let(:record) { member.ac(:usd) } diff --git a/spec/api/management_api_v1/entities/deposit_spec.rb b/spec/api/management_api_v1/entities/deposit_spec.rb index fdaf83710a..12d795bb05 100644 --- a/spec/api/management_api_v1/entities/deposit_spec.rb +++ b/spec/api/management_api_v1/entities/deposit_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe ManagementAPIv1::Entities::Deposit do context 'fiat' do let(:record) { create(:deposit_usd, member: create(:member, :barong)) } diff --git a/spec/api/management_api_v1/entities/withdraw_spec.rb b/spec/api/management_api_v1/entities/withdraw_spec.rb index b7b5d6ceeb..337a5bb0d3 100644 --- a/spec/api/management_api_v1/entities/withdraw_spec.rb +++ b/spec/api/management_api_v1/entities/withdraw_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe ManagementAPIv1::Entities::Withdraw do context 'fiat' do let(:rid) { Faker::Bank.iban } diff --git a/spec/api/management_api_v1/jwt_authentication_middleware_spec.rb b/spec/api/management_api_v1/jwt_authentication_middleware_spec.rb index 20c45e0062..e535414d3d 100644 --- a/spec/api/management_api_v1/jwt_authentication_middleware_spec.rb +++ b/spec/api/management_api_v1/jwt_authentication_middleware_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe ManagementAPIv1::JWTAuthenticationMiddleware, type: :request do let(:member) { create(:member, :verified_identity) } let(:config) { management_api_v1_security_configuration } diff --git a/spec/api/management_api_v1/tools_spec.rb b/spec/api/management_api_v1/tools_spec.rb index fe22af0861..8a5bc81d38 100644 --- a/spec/api/management_api_v1/tools_spec.rb +++ b/spec/api/management_api_v1/tools_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe ManagementAPIv1::Tools, type: :request do before do defaults_for_management_api_v1_security_configuration! diff --git a/spec/api/management_api_v1/withdraws_spec.rb b/spec/api/management_api_v1/withdraws_spec.rb index 98ccc3b279..3c9ac983a0 100644 --- a/spec/api/management_api_v1/withdraws_spec.rb +++ b/spec/api/management_api_v1/withdraws_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe ManagementAPIv1::Withdraws, type: :request do before do defaults_for_management_api_v1_security_configuration! diff --git a/spec/controllers/admin/currencies_controller_spec.rb b/spec/controllers/admin/currencies_controller_spec.rb index fea7ffff5c..747e8bafaf 100644 --- a/spec/controllers/admin/currencies_controller_spec.rb +++ b/spec/controllers/admin/currencies_controller_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Admin::CurrenciesController, type: :controller do let(:member) { create(:admin_member) } let :valid_currency_attributes do diff --git a/spec/controllers/admin/markets_controller_spec.rb b/spec/controllers/admin/markets_controller_spec.rb index 01265bb60e..6be4cfb89c 100644 --- a/spec/controllers/admin/markets_controller_spec.rb +++ b/spec/controllers/admin/markets_controller_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Admin::MarketsController, type: :controller do let(:member) { create(:admin_member) } let(:valid_market_attributes) do diff --git a/spec/controllers/admin/members_controller_spec.rb b/spec/controllers/admin/members_controller_spec.rb index e1ed9d7e97..48eee0b540 100644 --- a/spec/controllers/admin/members_controller_spec.rb +++ b/spec/controllers/admin/members_controller_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Admin::MembersController do let(:member) { create(:admin_member) } before { session[:member_id] = member.id } diff --git a/spec/controllers/private/assets_controller_spec.rb b/spec/controllers/private/assets_controller_spec.rb index c560c996f2..5cf97e676d 100644 --- a/spec/controllers/private/assets_controller_spec.rb +++ b/spec/controllers/private/assets_controller_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Private::AssetsController, type: :controller do let(:member) { create :member, :verified_identity } before { session[:member_id] = member.id } diff --git a/spec/controllers/private/funds_controller_spec.rb b/spec/controllers/private/funds_controller_spec.rb index 2658658977..85e099d8de 100644 --- a/spec/controllers/private/funds_controller_spec.rb +++ b/spec/controllers/private/funds_controller_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Private::FundsController, type: :controller do end diff --git a/spec/controllers/private/markets_controller_spec.rb b/spec/controllers/private/markets_controller_spec.rb index 200f3ebadf..b65cd8e951 100644 --- a/spec/controllers/private/markets_controller_spec.rb +++ b/spec/controllers/private/markets_controller_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Private::MarketsController, type: :controller do let(:member) { create :member, :verified_identity } before { session[:member_id] = member.id } diff --git a/spec/controllers/private/order_asks_controller_spec.rb b/spec/controllers/private/order_asks_controller_spec.rb index 272a617c56..7cc2c97697 100644 --- a/spec/controllers/private/order_asks_controller_spec.rb +++ b/spec/controllers/private/order_asks_controller_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Private::OrderAsksController, type: :controller do let(:member) do create(:member, :verified_identity).tap do |m| diff --git a/spec/controllers/private/order_bids_controller_spec.rb b/spec/controllers/private/order_bids_controller_spec.rb index d8327bbc54..9dbeb3b6ba 100644 --- a/spec/controllers/private/order_bids_controller_spec.rb +++ b/spec/controllers/private/order_bids_controller_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Private::OrderBidsController, type: :controller do let(:member) do create(:member, :verified_identity).tap do |m| diff --git a/spec/controllers/private/settings_controller_spec.rb b/spec/controllers/private/settings_controller_spec.rb index 92c6e2050d..b443928ddb 100644 --- a/spec/controllers/private/settings_controller_spec.rb +++ b/spec/controllers/private/settings_controller_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Private::SettingsController, type: :controller do let(:member) { create :member, :verified_identity } before { session[:member_id] = member.id } diff --git a/spec/controllers/private/withdraws_controller_spec.rb b/spec/controllers/private/withdraws_controller_spec.rb index 34f84a6549..7d75bf518d 100644 --- a/spec/controllers/private/withdraws_controller_spec.rb +++ b/spec/controllers/private/withdraws_controller_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Private::WithdrawsController, type: :controller do describe '#create' do let(:params) { { withdraw: { currency: :btc, sum: 90.1, rid: 'rfUKVVX5KJQ2FsWYrjS6JMedz3jdjPhRPZ' } } } diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb index ffdb572775..2a7d2855c6 100644 --- a/spec/controllers/sessions_controller_spec.rb +++ b/spec/controllers/sessions_controller_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe SessionsController, type: :controller do %i[ google_oauth2 auth0 barong ].each do |provider| normalized_provider = provider.to_s.gsub(/(?:_|oauth2)+\z/i, '') diff --git a/spec/controllers/welcome_controller_spec.rb b/spec/controllers/welcome_controller_spec.rb index f89a87261a..0c9bb3b885 100644 --- a/spec/controllers/welcome_controller_spec.rb +++ b/spec/controllers/welcome_controller_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe WelcomeController, type: :controller do describe 'ability to disable cabinet UI' do diff --git a/spec/factories/account.rb b/spec/factories/account.rb index e11668fe06..839498c7a0 100644 --- a/spec/factories/account.rb +++ b/spec/factories/account.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module AccountFactory def create_account(*arguments) currency = Symbol === arguments.first ? arguments.first : :usd diff --git a/spec/factories/authentications.rb b/spec/factories/authentications.rb index 870f019e36..d73575fdfe 100644 --- a/spec/factories/authentications.rb +++ b/spec/factories/authentications.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + # Read about factories at https://github.com/thoughtbot/factory_bot FactoryBot.define do diff --git a/spec/factories/currencies.rb b/spec/factories/currencies.rb index 46cab94cff..0e2f83ae6a 100644 --- a/spec/factories/currencies.rb +++ b/spec/factories/currencies.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + FactoryBot.define do factory :currency do trait :usd do diff --git a/spec/factories/deposits.rb b/spec/factories/deposits.rb index e9037d3394..b4133d4348 100644 --- a/spec/factories/deposits.rb +++ b/spec/factories/deposits.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + FactoryBot.define do factory :deposit do member { create(:member, :verified_identity) } diff --git a/spec/factories/market.rb b/spec/factories/market.rb index 9734eb0294..da62a7b5c3 100644 --- a/spec/factories/market.rb +++ b/spec/factories/market.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + FactoryBot.define do factory :market do trait :btcusd do diff --git a/spec/factories/member.rb b/spec/factories/member.rb index 294bea8913..436b28506d 100644 --- a/spec/factories/member.rb +++ b/spec/factories/member.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + FactoryBot.define do factory :member do email { Faker::Internet.email } diff --git a/spec/factories/orders.rb b/spec/factories/orders.rb index c2f2a41d56..94058db44f 100644 --- a/spec/factories/orders.rb +++ b/spec/factories/orders.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + FactoryBot.define do factory :order_bid do bid { Currency.find_by!(code: :usd).id } diff --git a/spec/factories/partial_trees.rb b/spec/factories/partial_trees.rb index 3c65036419..f0fa9751e8 100644 --- a/spec/factories/partial_trees.rb +++ b/spec/factories/partial_trees.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + # Read about factories at https://github.com/thoughtbot/factory_bot FactoryBot.define do diff --git a/spec/factories/payment_addresses.rb b/spec/factories/payment_addresses.rb index 9de8acab49..036046e7c3 100644 --- a/spec/factories/payment_addresses.rb +++ b/spec/factories/payment_addresses.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + FactoryBot.define do factory :payment_address do address { Faker::Bitcoin.address } diff --git a/spec/factories/proofs.rb b/spec/factories/proofs.rb index 41afdda9d2..565f5fe711 100644 --- a/spec/factories/proofs.rb +++ b/spec/factories/proofs.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + FactoryBot.define do factory :proof do root 'root: {}' diff --git a/spec/factories/trade.rb b/spec/factories/trade.rb index 6ef15f376f..6d7924f7dc 100644 --- a/spec/factories/trade.rb +++ b/spec/factories/trade.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + FactoryBot.define do factory :trade do price '10.0' diff --git a/spec/factories/withdraw.rb b/spec/factories/withdraw.rb index ac58834fd0..c7c6731dde 100644 --- a/spec/factories/withdraw.rb +++ b/spec/factories/withdraw.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + FactoryBot.define do factory :btc_withdraw, class: Withdraws::Coin do currency { Currency.find_by!(code: :btc) } diff --git a/spec/features/admin/withdraw_spec.rb b/spec/features/admin/withdraw_spec.rb index b514b59cb8..b33ab69c6d 100644 --- a/spec/features/admin/withdraw_spec.rb +++ b/spec/features/admin/withdraw_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + feature 'Withdraw', js: true do let!(:member) { create(:member, :verified_identity) } let!(:admin_member) { create(:member, :verified_identity, email: Member.admins.first) } diff --git a/spec/features/market_spec.rb b/spec/features/market_spec.rb index 243400ce70..f6776c3492 100644 --- a/spec/features/market_spec.rb +++ b/spec/features/market_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + feature 'show account info', js: true do let!(:member) { create :member, :verified_identity } diff --git a/spec/features/market_trade_history_spec.rb b/spec/features/market_trade_history_spec.rb index f29fd85ace..1339675488 100644 --- a/spec/features/market_trade_history_spec.rb +++ b/spec/features/market_trade_history_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + feature 'show account info', js: true do let(:other_member) { create :member, :verified_identity } let(:member) { create :member, :verified_identity } diff --git a/spec/helpers/private/assets_helper_spec.rb b/spec/helpers/private/assets_helper_spec.rb index fdaaa73ca8..555497c469 100644 --- a/spec/helpers/private/assets_helper_spec.rb +++ b/spec/helpers/private/assets_helper_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + # Specs in this file have access to a helper object that includes # the Private::AssetsHelper. For example: # diff --git a/spec/lib/coin_api/bit_go.rb b/spec/lib/coin_api/bit_go.rb index bbeeca1e00..2348563022 100644 --- a/spec/lib/coin_api/bit_go.rb +++ b/spec/lib/coin_api/bit_go.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe CoinAPI::BitGo do let(:currency) { Currency.find_by_code!(:btc) } let(:client) { currency.api } diff --git a/spec/lib/coin_api/erc20_spec.rb b/spec/lib/coin_api/erc20_spec.rb index 2393132024..85d3956867 100644 --- a/spec/lib/coin_api/erc20_spec.rb +++ b/spec/lib/coin_api/erc20_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe CoinAPI::ERC20 do let(:client) { CoinAPI[:trst] } diff --git a/spec/lib/coin_api/eth_spec.rb b/spec/lib/coin_api/eth_spec.rb index 970e3ae854..d5b6726dce 100644 --- a/spec/lib/coin_api/eth_spec.rb +++ b/spec/lib/coin_api/eth_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe CoinAPI::ETH do let(:client) { CoinAPI[:eth] } diff --git a/spec/lib/coin_api/xrp_spec.rb b/spec/lib/coin_api/xrp_spec.rb index a46956d19c..88c3e5b75e 100644 --- a/spec/lib/coin_api/xrp_spec.rb +++ b/spec/lib/coin_api/xrp_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe CoinAPI::XRP do let(:client) { CoinAPI[:xrp] } diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index bc51f79ea5..05bc0043bb 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Account do subject { create_account(:btc, locked: '10.0'.to_d, balance: '10.0') } diff --git a/spec/models/account_version_spec.rb b/spec/models/account_version_spec.rb index 2691cd145a..68de5b0ca0 100644 --- a/spec/models/account_version_spec.rb +++ b/spec/models/account_version_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe AccountVersion do let(:member) { create(:member, :verified_identity) } let(:account) { member.get_account(:btc) } diff --git a/spec/models/amqp_config_spec.rb b/spec/models/amqp_config_spec.rb index c31c0a250f..4d48bdf48a 100644 --- a/spec/models/amqp_config_spec.rb +++ b/spec/models/amqp_config_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Worker class Test end diff --git a/spec/models/amqp_queue_spec.rb b/spec/models/amqp_queue_spec.rb index ea8e25ee86..a9fbac3cbf 100644 --- a/spec/models/amqp_queue_spec.rb +++ b/spec/models/amqp_queue_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe AMQPQueue do let(:config) do Hashie::Mash.new(connect: { host: '127.0.0.1' }, diff --git a/spec/models/audit/transfer_audit_log_spec.rb b/spec/models/audit/transfer_audit_log_spec.rb index 343c650b95..dbae49e5f3 100644 --- a/spec/models/audit/transfer_audit_log_spec.rb +++ b/spec/models/audit/transfer_audit_log_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module Audit describe TransferAuditLog do describe '.audit!' do diff --git a/spec/models/currency_spec.rb b/spec/models/currency_spec.rb index 9eca00f013..7cfc231607 100644 --- a/spec/models/currency_spec.rb +++ b/spec/models/currency_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Currency do let!(:deposit_fee) { currency.deposit_fee } after { currency.update_columns(deposit_fee: deposit_fee) } diff --git a/spec/models/deposit_spec.rb b/spec/models/deposit_spec.rb index c3ad5d7a57..64ca2f77ac 100644 --- a/spec/models/deposit_spec.rb +++ b/spec/models/deposit_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Deposit do let(:member) { create(:member) } let(:amount) { 100.to_d } diff --git a/spec/models/global_spec.rb b/spec/models/global_spec.rb index 4f75e8f1f4..651cb58014 100644 --- a/spec/models/global_spec.rb +++ b/spec/models/global_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Global do let(:global) { Global[:btcusd] } end diff --git a/spec/models/market_spec.rb b/spec/models/market_spec.rb index 0af19998da..d4fa66e41a 100644 --- a/spec/models/market_spec.rb +++ b/spec/models/market_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Market do context 'visible market' do it { expect(Market.visible.count).to eq(1) } diff --git a/spec/models/matching/engine_spec.rb b/spec/models/matching/engine_spec.rb index ceec3c873f..16132fdded 100644 --- a/spec/models/matching/engine_spec.rb +++ b/spec/models/matching/engine_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Matching::Engine do let(:market) { Market.find('btcusd') } let(:price) { 10.to_d } diff --git a/spec/models/matching/executor_spec.rb b/spec/models/matching/executor_spec.rb index 8abcdd0ff5..74656b8d66 100644 --- a/spec/models/matching/executor_spec.rb +++ b/spec/models/matching/executor_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Matching::Executor do let(:alice) { who_is_billionaire } let(:bob) { who_is_billionaire } diff --git a/spec/models/matching/limit_order_spec.rb b/spec/models/matching/limit_order_spec.rb index e1e81039f5..4a67922963 100644 --- a/spec/models/matching/limit_order_spec.rb +++ b/spec/models/matching/limit_order_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Matching::LimitOrder do context 'initialize' do it 'should throw invalid order error for empty attributes' do diff --git a/spec/models/matching/market_order_spec.rb b/spec/models/matching/market_order_spec.rb index 0d1c4116a3..6fea122dea 100644 --- a/spec/models/matching/market_order_spec.rb +++ b/spec/models/matching/market_order_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Matching::MarketOrder do context 'initialize' do it 'should not allow price attribute' do diff --git a/spec/models/matching/order_book_manager_spec.rb b/spec/models/matching/order_book_manager_spec.rb index fcb2f31e44..d363675d16 100644 --- a/spec/models/matching/order_book_manager_spec.rb +++ b/spec/models/matching/order_book_manager_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Matching::OrderBookManager do context '.build_order' do it 'should build limit order' do diff --git a/spec/models/matching/order_book_spec.rb b/spec/models/matching/order_book_spec.rb index d67d4ef604..3d45621eff 100644 --- a/spec/models/matching/order_book_spec.rb +++ b/spec/models/matching/order_book_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Matching::OrderBook do context '#find' do subject { Matching::OrderBook.new('btcusd', :ask) } diff --git a/spec/models/matching/price_level_spec.rb b/spec/models/matching/price_level_spec.rb index 75fd118690..8ca1147fbe 100644 --- a/spec/models/matching/price_level_spec.rb +++ b/spec/models/matching/price_level_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Matching::PriceLevel do subject { Matching::PriceLevel.new('1.0'.to_d) } let(:o1) { Matching.mock_limit_order(type: :ask) } diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb index 200978a81a..67a06c30e0 100644 --- a/spec/models/member_spec.rb +++ b/spec/models/member_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Member do let(:member) { build(:member, :verified_identity) } subject { member } diff --git a/spec/models/order_ask_spec.rb b/spec/models/order_ask_spec.rb index cb03df44f5..9456aaf588 100644 --- a/spec/models/order_ask_spec.rb +++ b/spec/models/order_ask_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe OrderAsk do subject { create(:order_ask) } diff --git a/spec/models/order_bid_spec.rb b/spec/models/order_bid_spec.rb index d64f2def15..ff1cd9a552 100644 --- a/spec/models/order_bid_spec.rb +++ b/spec/models/order_bid_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe OrderBid do subject { create(:order_bid) } diff --git a/spec/models/order_spec.rb b/spec/models/order_spec.rb index 4716ac8bc4..edecea5e25 100644 --- a/spec/models/order_spec.rb +++ b/spec/models/order_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Order, 'validations', type: :model do context 'validations' do subject do diff --git a/spec/models/partial_tree_spec.rb b/spec/models/partial_tree_spec.rb index 6b307ec8ff..77d91fc06f 100644 --- a/spec/models/partial_tree_spec.rb +++ b/spec/models/partial_tree_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe PartialTree do pending "add some examples to (or delete) #{__FILE__}" end diff --git a/spec/models/payment_address_spec.rb b/spec/models/payment_address_spec.rb index d886ae9830..d2b8716e16 100644 --- a/spec/models/payment_address_spec.rb +++ b/spec/models/payment_address_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe PaymentAddress do context '.create' do let(:member) { create(:member, :verified_identity) } diff --git a/spec/models/proof_spec.rb b/spec/models/proof_spec.rb index 66de6ebf3c..0351525e54 100644 --- a/spec/models/proof_spec.rb +++ b/spec/models/proof_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Proof do describe '#asset_sum' do it 'aggregates address balances' do diff --git a/spec/models/trade_spec.rb b/spec/models/trade_spec.rb index b26b43f9cb..fc7d240fd5 100644 --- a/spec/models/trade_spec.rb +++ b/spec/models/trade_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Trade, '.latest_price' do context 'no trade' do it { expect(Trade.latest_price(:btcusd)).to be_d '0.0' } diff --git a/spec/models/withdraw_spec.rb b/spec/models/withdraw_spec.rb index 48fb1bbda3..851b2bb38a 100644 --- a/spec/models/withdraw_spec.rb +++ b/spec/models/withdraw_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Withdraw do describe '#fix_precision' do it 'should round down to max precision' do diff --git a/spec/models/worker/deposit_coin_spec.rb b/spec/models/worker/deposit_coin_spec.rb index 8809c922ea..064b9de547 100644 --- a/spec/models/worker/deposit_coin_spec.rb +++ b/spec/models/worker/deposit_coin_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Worker::DepositCoin do around do |example| WebMock.disable_net_connect! diff --git a/spec/models/worker/matching_spec.rb b/spec/models/worker/matching_spec.rb index 042b6a8afc..67b66ae397 100644 --- a/spec/models/worker/matching_spec.rb +++ b/spec/models/worker/matching_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Worker::Matching do let(:alice) { who_is_billionaire } let(:bob) { who_is_billionaire } diff --git a/spec/models/worker/slave_book_spec.rb b/spec/models/worker/slave_book_spec.rb index 6c3af3b356..521206d182 100644 --- a/spec/models/worker/slave_book_spec.rb +++ b/spec/models/worker/slave_book_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Worker::SlaveBook do subject { Worker::SlaveBook.new(false) } diff --git a/spec/observers/transfer_observer_spec.rb b/spec/observers/transfer_observer_spec.rb index 0f4e8a012c..21d915fbaa 100644 --- a/spec/observers/transfer_observer_spec.rb +++ b/spec/observers/transfer_observer_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe TransferObserver do describe '#after_update' do let!(:member) { create(:member, :verified_identity) } diff --git a/spec/routing/admin/members_spec.rb b/spec/routing/admin/members_spec.rb index 7716549d5b..159c13853d 100644 --- a/spec/routing/admin/members_spec.rb +++ b/spec/routing/admin/members_spec.rb @@ -1,2 +1,5 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe '/admin/members' do end diff --git a/spec/routing/trade_spec.rb b/spec/routing/trade_spec.rb index 699ce69bbd..5b42831e4e 100644 --- a/spec/routing/trade_spec.rb +++ b/spec/routing/trade_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe 'routes for trade', type: :routing do it 'routes /markets/xxxyyy to the trade controller' do Market.expects(:find_by_id).with('xxxyyy').returns(Market.new(id: 'xxxyyy', ask_unit: 'xxx', bid_unit: 'yyy')) diff --git a/spec/serializers/serializers/event_api/order_canceled_spec.rb b/spec/serializers/serializers/event_api/order_canceled_spec.rb index 1375d4d38d..fecc715c77 100644 --- a/spec/serializers/serializers/event_api/order_canceled_spec.rb +++ b/spec/serializers/serializers/event_api/order_canceled_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Serializers::EventAPI::OrderCanceled do let(:seller) { create(:member, :verified_identity, :barong) } diff --git a/spec/serializers/serializers/event_api/order_completed_spec.rb b/spec/serializers/serializers/event_api/order_completed_spec.rb index b737213e08..9370cee6f6 100644 --- a/spec/serializers/serializers/event_api/order_completed_spec.rb +++ b/spec/serializers/serializers/event_api/order_completed_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Serializers::EventAPI::OrderCompleted do let(:seller) { create(:member, :verified_identity, :barong) } diff --git a/spec/serializers/serializers/event_api/order_created_spec.rb b/spec/serializers/serializers/event_api/order_created_spec.rb index 3775f74eab..3011a1deb0 100644 --- a/spec/serializers/serializers/event_api/order_created_spec.rb +++ b/spec/serializers/serializers/event_api/order_created_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Serializers::EventAPI::OrderCreated do let(:buyer) { create(:member, :verified_identity, :barong) } diff --git a/spec/serializers/serializers/event_api/order_updated_spec.rb b/spec/serializers/serializers/event_api/order_updated_spec.rb index 552639358b..0faf4f3b5b 100644 --- a/spec/serializers/serializers/event_api/order_updated_spec.rb +++ b/spec/serializers/serializers/event_api/order_updated_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Serializers::EventAPI::OrderUpdated, OrderAsk do let(:seller) { create(:member, :verified_identity, :barong) } diff --git a/spec/serializers/serializers/event_api/trade_completed_spec.rb b/spec/serializers/serializers/event_api/trade_completed_spec.rb index f51f897b61..15ea1d419a 100644 --- a/spec/serializers/serializers/event_api/trade_completed_spec.rb +++ b/spec/serializers/serializers/event_api/trade_completed_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Serializers::EventAPI::TradeCompleted, 'Event API' do let(:seller) { create(:member, :verified_identity, :barong) } diff --git a/spec/services/blockchain_transaction_handler_spec.rb b/spec/services/blockchain_transaction_handler_spec.rb index 6f40c7a21b..33834f7ec2 100644 --- a/spec/services/blockchain_transaction_handler_spec.rb +++ b/spec/services/blockchain_transaction_handler_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Services::BlockchainTransactionHandler do subject { Services::BlockchainTransactionHandler.new(currency) } diff --git a/spec/services/ordering_spec.rb b/spec/services/ordering_spec.rb index 3863cc8d3e..e116fb1e12 100644 --- a/spec/services/ordering_spec.rb +++ b/spec/services/ordering_spec.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + describe Ordering do let(:order) { create(:order_bid, volume: '1.23456789', price: '1.23456789') } let(:account) { create_account(:usd, balance: 100.to_d, locked: 100.to_d) } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a858e39ed4..2d35afb68c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + # This file is copied to spec/ when you run 'rails generate rspec:install' ENV['RAILS_ENV'] ||= 'test' ENV['ADMIN'] ||= 'admin@peatio.tech' diff --git a/spec/support/api_helper.rb b/spec/support/api_helper.rb index 5629d6b762..5313342af0 100644 --- a/spec/support/api_helper.rb +++ b/spec/support/api_helper.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + module APITestHelpers extend Memoist diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index ed1c18b3f3..1e119c822a 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + screen_size = [1280, 800] if ENV.key?('SELENIUM_HOST') diff --git a/spec/support/cookie_helper.rb b/spec/support/cookie_helper.rb index 1bf3cec29a..3dd3451ccb 100644 --- a/spec/support/cookie_helper.rb +++ b/spec/support/cookie_helper.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + def clear_cookie page.driver.browser.manage.delete_all_cookies end diff --git a/spec/support/inject_session.rb b/spec/support/inject_session.rb index 4a56027eb9..e395c89964 100644 --- a/spec/support/inject_session.rb +++ b/spec/support/inject_session.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + require 'rack_session_access/capybara' module InjectSession diff --git a/spec/support/matching_helper.rb b/spec/support/matching_helper.rb index c390766216..fbb78f9c98 100644 --- a/spec/support/matching_helper.rb +++ b/spec/support/matching_helper.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + def who_is_billionaire member = create(:member, :verified_identity) member.get_account(:btc).update_attributes( diff --git a/spec/support/member_helper.rb b/spec/support/member_helper.rb index 6c6b9fa0e8..cc808960cc 100644 --- a/spec/support/member_helper.rb +++ b/spec/support/member_helper.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + def sign_in(member) inject_session member_id: member.id visit settings_path diff --git a/spec/support/pusher.rb b/spec/support/pusher.rb index 67be46c053..892f28a4b0 100644 --- a/spec/support/pusher.rb +++ b/spec/support/pusher.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + # stub pusher requests class Pusher::Client diff --git a/spec/support/rspec_matchers.rb b/spec/support/rspec_matchers.rb index 7ff346bbc3..1dd4a244e9 100644 --- a/spec/support/rspec_matchers.rb +++ b/spec/support/rspec_matchers.rb @@ -1,3 +1,6 @@ +# encoding: UTF-8 +# frozen_string_literal: true + RSpec::Matchers.define :be_d do |expected| match do |actual| if expected.is_a? BigDecimal