blockchain-wallet 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ea53cebeb388e93903c1ff0011d99bad5028686
4
- data.tar.gz: 7dfb920e51b110ae6d4dbf56e88b5713edcf0b34
3
+ metadata.gz: af43ea8a7770600a0fbdb8bd7f1c322160f53075
4
+ data.tar.gz: 88db9b96313341adfecc41065d329b0f7883d333
5
5
  SHA512:
6
- metadata.gz: 49daacb3283ddec9e4ec0948b916869db76474ddee478ef0367b9fbeef0bcb31986f5200390bfcdeec0714d876d8fa726f815b54f18cc926d76e6eb887292233
7
- data.tar.gz: e041daa4817d5cfeed182c6f5fc969f11541b9318d9638cc3da34b6abb9ccb0fb48b865a0ac91690616e19d240ec33ff1e83b1a9352f8d5905f92313e5fc391f
6
+ metadata.gz: 5c3f40320d872d9046ca7abefec2d3a43aaf3e13f03fbb399f72f30e90c6228e75dca7a023a029740c2e8569e6b668a0810fa5d2d52d783d0107336b9f0539aa
7
+ data.tar.gz: 09093e2df21f8e05766ce7a2fa2244466e1e63da9331979ad6eaf33e64c76d2bd497098a9b432e77497d66ea84945b3e148e1dc5781a22ea29af121c69a882c6
@@ -54,7 +54,7 @@ module Blockchain
54
54
  end
55
55
 
56
56
  def payment(address, amount, from = nil, shared = nil, fee = nil, note = nil)
57
- url = build_url("payment", {:password => @password, :second_password => @second_password, :to => address, :amount => bitcoins_to_satoshi(amount),
57
+ url = build_url("payment", {:password => @password, :second_password => @second_password, :to => address, :amount => Wallet::bitcoins_to_satoshi(amount),
58
58
  :from => from, :shared => shared, :fee => fee, :note => note})
59
59
  handle(url) { |answer| answer }
60
60
  end
@@ -75,7 +75,7 @@ module Blockchain
75
75
  def handle(url)
76
76
  answer = execute_request(url)
77
77
  check_error(answer)
78
- answer['balance'] = satoshi_to_bitcoins(answer['balance']) if answer['balance']
78
+ answer['balance'] = Wallet::satoshi_to_bitcoins(answer['balance']) if answer['balance']
79
79
  yield ImmutableStruct.new(*answer.keys.map(&:to_sym)).new(*answer.values)
80
80
  end
81
81
 
@@ -1,3 +1,3 @@
1
1
  module Blockchain
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -1,17 +1,35 @@
1
1
  require File.expand_path("../../lib/blockchain/wallet", __FILE__)
2
2
 
3
- describe Blockchain, ".addresses" do
4
- it "returns all addresses" do
5
- wallet = Blockchain::Wallet.new("b14d36af-2fa6-4d76-91b5-ff70b8370ec7", "n$grJ74hAshfggnb6864%j78@#^hChttp://ya.ru@contentpurl", nil)
6
- addresses=wallet.addresses
3
+ describe Blockchain::Wallet, ".addresses" do
4
+
5
+ before do
6
+ @wallet = Blockchain::Wallet.new("b14d36af-2fa6-4d76-91b5-ff70b8370ec7", "n$grJ74hAshfggnb6864%j78@#^hChttp://ya.ru@contentpurl", nil)
7
+ end
8
+
9
+ it "should returns all addresses" do
10
+ addresses=@wallet.addresses
7
11
  addresses.should_not be_empty
8
12
  end
13
+
14
+ after do
15
+ @account = nil
16
+ end
17
+
9
18
  end
10
19
 
11
- describe Blockchain, ".address_balance" do
20
+ describe Blockchain::Wallet, ".address_balance" do
21
+
22
+ before do
23
+ @wallet = Blockchain::Wallet.new("b14d36af-2fa6-4d76-91b5-ff70b8370ec7", "n$grJ74hAshfggnb6864%j78@#^hChttp://ya.ru@contentpurl", nil)
24
+ end
25
+
12
26
  it "should return '1JX7FrBm4Y96Z8BN6m9fWLN3bWVrEZ7dVs' balance >=0" do
13
- wallet = Blockchain::Wallet.new("b14d36af-2fa6-4d76-91b5-ff70b8370ec7", "n$grJ74hAshfggnb6864%j78@#^hChttp://ya.ru@contentpurl", nil)
14
- address_balance=wallet.address_balance("1JX7FrBm4Y96Z8BN6m9fWLN3bWVrEZ7dVs")
27
+ address_balance=@wallet.address_balance("1JX7FrBm4Y96Z8BN6m9fWLN3bWVrEZ7dVs")
15
28
  address_balance.balance.should >=(0)
16
29
  end
30
+
31
+ after do
32
+ @account = nil
33
+ end
34
+
17
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blockchain-wallet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Tolmachev