ethereum 0.4.36 → 0.4.37
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ethereum/formatter.rb +2 -2
- data/lib/ethereum/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfd525de7fc31db259cdc41bcf64888e04246042
|
4
|
+
data.tar.gz: 0509aa5518988eca4df6e6e734bf4f271a81d501
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99ea33ff270853cb36e2dc5064c7e136ff071c96dd95d7ea07256431b03b486d982b6d85ba8200ef261fd5d6d26ba2fe2bbdd62d64b10991941eda3ee5dc0675
|
7
|
+
data.tar.gz: 7eb07c33c6bbe09b45b8fb97d5cd99cfc34e1dd085f9ce1fef06822a489c193f9771673f5ebd0e316b12460c6c31a31e122ced0812797c7dc862722ac60da037
|
data/lib/ethereum/formatter.rb
CHANGED
@@ -58,11 +58,11 @@ module Ethereum
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def to_wei(amount, unit)
|
61
|
-
BigDecimal.new(UNITS[unit.to_sym] * amount, 16).to_s.to_i
|
61
|
+
BigDecimal.new(UNITS[unit.to_sym] * amount, 16).to_s.to_i rescue nil
|
62
62
|
end
|
63
63
|
|
64
64
|
def from_wei(amount, unit)
|
65
|
-
(BigDecimal.new(amount, 16) / BigDecimal.new(UNITS[unit.to_sym], 16)).to_s
|
65
|
+
(BigDecimal.new(amount, 16) / BigDecimal.new(UNITS[unit.to_sym], 16)).to_s rescue nil
|
66
66
|
end
|
67
67
|
|
68
68
|
def from_address(address)
|
data/lib/ethereum/version.rb
CHANGED