bitex 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,12 +37,18 @@ module Bitex
37
37
  order = from_json(Api.private(:post, "/private#{base_path}", params))
38
38
  retries = 0
39
39
  while wait && order.status == :received
40
- order = find(order.id)
41
- sleep 0.2
40
+ new_order = all.select{|o| o.id == order.id}.first
41
+ if new_order.nil?
42
+ raise StandardError.new(
43
+ "Order #{base_path} ##{order.id} not found in list")
44
+ end
45
+ order = new_order
42
46
  retries += 1
43
47
  if retries > 100
44
- raise StandardError.new("Timed out waiting for #{base_path} ##{order.id}")
48
+ raise StandardError.new(
49
+ "Timed out waiting for #{base_path} ##{order.id}")
45
50
  end
51
+ sleep 0.2
46
52
  end
47
53
  return order
48
54
  end
@@ -1,3 +1,3 @@
1
1
  module Bitex
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -39,7 +39,7 @@ shared_examples_for 'Order' do |api_path|
39
39
  it 'places for btc and waits until processed by our matching engine' do
40
40
  stub_private(:post, "/private/#{api_path}", "#{api_path}_create",
41
41
  {amount: 100.50, price: 1000.00, specie: 1})
42
- stub_private(:get, "/private/orders/active", 'orders')
42
+ stub_private(:get, "/private/orders", 'orders')
43
43
  order = subject.class.create!(:btc, 100.50, 1000.00, true)
44
44
  order.should be_a subject.class
45
45
  order.status.should == :executing
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: