Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvisLYC committed May 8, 2019
1 parent 26a7cdc commit a706f87
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/cryptoexchange/exchanges/uniswap/market.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module Cryptoexchange::Exchanges
module Uniswap
class Market < Cryptoexchange::Models::Market
NAME = 'uniswap'
API_URL = "https://api-test-238309.appspot.com/v0/exchanges?key"
API_KEY = HashHelper.dig(Cryptoexchange::Credentials.get(@exchange), 'api_key')
API_URL = "https://api-test-238309.appspot.com/v0/exchanges?key=#{API_KEY}"
end
end
end
2 changes: 1 addition & 1 deletion lib/cryptoexchange/exchanges/uniswap/services/market.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def fetch
end

def ticker_url
"#{Cryptoexchange::Exchanges::Uniswap::Market::API_URL}"
"#{Cryptoexchange::Exchanges::Uniswap::Market::API_URL}=#{Cryptoexchange::Exchanges::Uniswap::Market::API_KEY}"
end

def adapt_all(output)
Expand Down
2 changes: 1 addition & 1 deletion lib/cryptoexchange/exchanges/uniswap/services/pairs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Cryptoexchange::Exchanges
module Uniswap
module Services
class Pairs < Cryptoexchange::Services::Pairs
PAIRS_URL = "#{Cryptoexchange::Exchanges::Uniswap::Market::API_URL}"
PAIRS_URL = "#{Cryptoexchange::Exchanges::Uniswap::Market::API_URL}=#{Cryptoexchange::Exchanges::Uniswap::Market::API_KEY}"

def fetch
output = super
Expand Down
2 changes: 1 addition & 1 deletion spec/exchanges/uniswap/market_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

RSpec.describe Cryptoexchange::Exchanges::Uniswap::Market do
it { expect(described_class::NAME).to eq 'uniswap' }
it { expect(described_class::API_URL).to eq 'https://api-test-238309.appspot.com/v0/exchanges?key=#{YOUR_API_KEY_HERE}' }
it { expect(described_class::API_URL).to eq 'https://api-test-238309.appspot.com/v0/exchanges?key' }
end

0 comments on commit a706f87

Please sign in to comment.