Skip to content

Commit

Permalink
Return max_float for all coinbase balances
Browse files Browse the repository at this point in the history
  • Loading branch information
hstove committed Jan 19, 2014
1 parent 33e1234 commit 2d36a19
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
rbtc_arbitrage (1.4.5)
rbtc_arbitrage (1.4.6)
activemodel (>= 3.1)
activesupport (>= 3.1)
bitstamp
Expand Down
5 changes: 3 additions & 2 deletions lib/rbtc_arbitrage/clients/coinbase_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ def balance
if @options[:verbose]
warning = "Coinbase doesn't provide a USD balance because"
warning << " it connects to your bank account. Be careful, "
warning << "because this will withdraw directly from your accounts."
warning << "because this will withdraw directly from your accounts"
warning << "when you trade live."
logger.warn warning
end
@balance ||= [interface.balance.to_f, max_float]
@balance ||= [max_float, max_float]
end

# Configures the client's API keys.
Expand Down
2 changes: 1 addition & 1 deletion lib/rbtc_arbitrage/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RbtcArbitrage
VERSION = "1.4.5"
VERSION = "1.4.6"
end
5 changes: 2 additions & 3 deletions spec/clients/coinbase_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
it { client.exchange.should == :coinbase }

describe "#balance" do
it "fetches the balance correctly", :vcr do
balance = coinbase.balance.to_f
expected = [balance, Float::MAX]
it "fetches the balance correctly" do
expected = [Float::MAX, Float::MAX]
client.balance.should eql(expected)
client.balance.each do |b|
b.should be_a(Float)
Expand Down

0 comments on commit 2d36a19

Please sign in to comment.