ethereum.rb 2.1.3 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ethereum/client.rb +2 -2
- data/lib/ethereum/explorer_url_helper.rb +9 -6
- data/lib/ethereum/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 521d5de9ea9a0d4d65ea0a9c8d40aee5cd30059a
|
4
|
+
data.tar.gz: 301e695e2005d2b4c4b1a5860f3ca4251ac81d6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cc58822478802ba206592bbe70e3293f6abbcbf5b3a8dfd8be2ee235a87fa0ae13e05540feb2690b22c307d2812a0aee47dbb6c725e7e6f5a3748da4ec39dae
|
7
|
+
data.tar.gz: e4688a1546e99107facf5e6cde3240c4b9cb5490a49d8e17793d138cdc0d3fb282edd129c927fc2a6f4b89493390748ff7aa5af445559b7af16ddafb0da1c396
|
data/lib/ethereum/client.rb
CHANGED
@@ -53,7 +53,7 @@ module Ethereum
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def default_account
|
56
|
-
@default_account
|
56
|
+
@default_account ||= eth_accounts["result"][0]
|
57
57
|
end
|
58
58
|
|
59
59
|
def int_to_hex(p)
|
@@ -69,7 +69,7 @@ module Ethereum
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def get_chain
|
72
|
-
net_version["result"].to_i(16)
|
72
|
+
@net_version ||= net_version["result"].to_i(16)
|
73
73
|
end
|
74
74
|
|
75
75
|
def get_nonce(address)
|
@@ -1,5 +1,12 @@
|
|
1
1
|
module Ethereum
|
2
2
|
module ExplorerUrlHelper
|
3
|
+
|
4
|
+
CHAIN_PREFIX = {
|
5
|
+
23 => "no-explorer-for-devmode.",
|
6
|
+
66 => "kovan.",
|
7
|
+
3 => "ropsten."
|
8
|
+
}
|
9
|
+
|
3
10
|
def link_to_tx(label, txid, **opts)
|
4
11
|
link_to label, explorer_path("tx/#{txid}"), {target: "_blank"}.merge(opts)
|
5
12
|
end
|
@@ -8,12 +15,8 @@ module Ethereum
|
|
8
15
|
link_to label, explorer_path("address/#{address}"), {target: "_blank"}.merge(opts)
|
9
16
|
end
|
10
17
|
|
11
|
-
def explorer_path(suffix)
|
12
|
-
|
13
|
-
prefix = ""
|
14
|
-
prefix = "no-explorer-for-devmode." if version.to_i == 17
|
15
|
-
prefix = "kovan." if version.to_i == 42
|
16
|
-
prefix = "ropsten." if version.to_i == 3
|
18
|
+
def explorer_path(suffix, version = Ethereum::Singleton.instance.get_chain)
|
19
|
+
prefix = CHAIN_PREFIX.fetch(version, "")
|
17
20
|
"https://#{prefix}etherscan.io/#{suffix}"
|
18
21
|
end
|
19
22
|
end
|
data/lib/ethereum/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ethereum.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marek Kirejczyk
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -210,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
210
|
version: '0'
|
211
211
|
requirements: []
|
212
212
|
rubyforge_project:
|
213
|
-
rubygems_version: 2.
|
213
|
+
rubygems_version: 2.6.8
|
214
214
|
signing_key:
|
215
215
|
specification_version: 4
|
216
216
|
summary: Ruby Ethereum client using the JSON-RPC interface
|