ethereum 0.4.37 → 0.4.38
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 +7 -0
- 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: c47d8e41d8cadd766be88fc11e5b7dea7e0b2f5a
|
4
|
+
data.tar.gz: c44e0d190a7654585d06e2f6ddb1b844fc8be4c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efb67fbde82e4808424770e28735e107b55298a113690a5595f0ccef09677040c38a61c2c78a5de0ff2c93d3f76982e0520694c21674d3ee5b0e969f06096096
|
7
|
+
data.tar.gz: 14143bb3e0c460ea7930cf57434dbc6136322b7279ec54156cd0180535df910d65c68018ba550e94561772c2f0280f81994ce7d51f19a106c7602191acf61d8d
|
data/lib/ethereum/formatter.rb
CHANGED
@@ -29,6 +29,13 @@ module Ethereum
|
|
29
29
|
tether: 1000000000000000000000000000000
|
30
30
|
}
|
31
31
|
|
32
|
+
def valid_address?(address_string)
|
33
|
+
address = address_string.gsub(/^0x/,'')
|
34
|
+
return false if address == "0000000000000000000000000000000000000000"
|
35
|
+
return false if address.length != 40
|
36
|
+
return !(address.match(/[0-9a-fA-F]+/).nil?)
|
37
|
+
end
|
38
|
+
|
32
39
|
def from_bool(boolval)
|
33
40
|
boolval ? "1" : "0"
|
34
41
|
end
|
data/lib/ethereum/version.rb
CHANGED