bit_wallet 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +4 -0
- data/Gemfile +2 -0
- data/bit_wallet.gemspec +0 -1
- data/lib/bit_wallet/account.rb +1 -6
- data/lib/bit_wallet/errors.rb +1 -0
- data/lib/bit_wallet/handles_error.rb +2 -0
- data/lib/bit_wallet/version.rb +1 -1
- data/spec/bit_wallet/handles_error_spec.rb +7 -0
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTdmOGQyNGU2NWI4ZDAyNjc4OTE2ZTYyMTE2YjlkMGIwZjA1ZTA1NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Njg5YzcxMzUyZjIzNWU2NWYyMDUxMWI0ZWM3N2RkZGZiYzMwMTM5ZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTFmYTEzOTAxMTZjM2Y1YTFlYjhiMGYyN2Q5NGUzNTM1YzdkMGVjZDY2ZTI2
|
10
|
+
OTVjOGI3NWE1NWIzOGYwMzRlMGZmZmEwZDY2ZTc1Y2ViNWIzNGUwZTZhODA4
|
11
|
+
ZTE3ZmRlZjhmYzUxZThkYjMzNjliYzhlNDQzYTM4OTQ1MzhiMTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjkwYTU5MDE0MzE2ZmMxYzk2ZTMxODE0YmY3MzQyMjE2OGIxODgyY2ViNjMx
|
14
|
+
NDc3ZDFiMDgxYmE2MGU1MjZhNmRkZGU3ODY0OWMxZmVhMWJlZGQ3NWU2Zjg3
|
15
|
+
ZDAzNTlhNDIxYTMwOWU0NThhNGFlNjQ5MzdkYzJjYzQxNjVhODA=
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/bit_wallet.gemspec
CHANGED
@@ -20,7 +20,6 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.add_dependency 'bitcoin-client'
|
21
21
|
gem.add_dependency 'activesupport'
|
22
22
|
gem.add_development_dependency 'rspec', '~> 2.12'
|
23
|
-
gem.add_development_dependency 'pry'
|
24
23
|
gem.add_development_dependency 'factory_girl', '4.2.0'
|
25
24
|
gem.add_development_dependency 'bitcoin_testnet', '0.5.0'
|
26
25
|
gem.add_development_dependency 'vcr', '~> 2.4'
|
data/lib/bit_wallet/account.rb
CHANGED
@@ -60,12 +60,7 @@ module BitWallet
|
|
60
60
|
BitWallet.config.min_conf)
|
61
61
|
txid
|
62
62
|
rescue => e
|
63
|
-
|
64
|
-
if error_message[:error][:code] == -6
|
65
|
-
fail InsufficientFunds, "'#{self.name}' does not have enough funds"
|
66
|
-
else
|
67
|
-
raise e
|
68
|
-
end
|
63
|
+
parse_error e.message
|
69
64
|
end
|
70
65
|
|
71
66
|
private
|
data/lib/bit_wallet/errors.rb
CHANGED
@@ -6,6 +6,8 @@ module BitWallet
|
|
6
6
|
InsufficientFunds.new("cannot send an amount more than what this account has")
|
7
7
|
elsif message.include?("-3")
|
8
8
|
InvalidAmount.new("amount is invalid")
|
9
|
+
elsif message.include?("-5")
|
10
|
+
InvalidAddress.new("bitcoin address is invalid")
|
9
11
|
else
|
10
12
|
ArgumentError.new("unknown error: #{message}")
|
11
13
|
end
|
data/lib/bit_wallet/version.rb
CHANGED
@@ -10,6 +10,13 @@ module BitWallet
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
+
context "error is -5" do
|
14
|
+
it "raises InvalidAddress error" do
|
15
|
+
expect { described_class.from("some error -5 message") }.
|
16
|
+
to raise_error(InvalidAddress, "bitcoin address is invalid")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
13
20
|
context "error is -6" do
|
14
21
|
it "raises InsufficientFunds error" do
|
15
22
|
expect { described_class.from("-6 message") }.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bit_wallet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramon Tayag
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bitcoin-client
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.12'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: pry
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ! '>='
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: factory_girl
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|