c3d 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/c3d/connectors/connect_ethereum.rb +18 -0
- data/lib/c3d/util/util.rb +16 -7
- data/lib/c3d/util/watch.rb +0 -3
- data/lib/c3d/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57c78accf60033381fb7e2a047359b3fda3e4790
|
4
|
+
data.tar.gz: b53f7b610a9b622b3f65ae08cfca01f2b501f6c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 862cd29411262169e3f89081cad6b06803c054d0bc6a25db9e33cb06301ddc9ad59c215c5df3605bdf47fad66d6ae5d616c6a6da491b6bbb266090c2c340b61f
|
7
|
+
data.tar.gz: f33a2b8998ce1809bb10cee4aaf57b5f3950739db7a8b58ea8b8708029c3405cfb71d86649b176c96e2f165a216854976fdafbd30ef903ccf2c0c76d38c9861b
|
data/README.md
CHANGED
@@ -99,6 +99,24 @@ module C3D
|
|
99
99
|
send_command request
|
100
100
|
end
|
101
101
|
|
102
|
+
def get_address key
|
103
|
+
case @client
|
104
|
+
when :go
|
105
|
+
#todo
|
106
|
+
when :cpp
|
107
|
+
request = {
|
108
|
+
method: 'secretToAddress',
|
109
|
+
params: {
|
110
|
+
a: key
|
111
|
+
},
|
112
|
+
id: 'c3d-client',
|
113
|
+
jsonrpc: '2.0'
|
114
|
+
}
|
115
|
+
end
|
116
|
+
|
117
|
+
send_command request
|
118
|
+
end
|
119
|
+
|
102
120
|
private
|
103
121
|
|
104
122
|
def guard_addresses address
|
data/lib/c3d/util/util.rb
CHANGED
@@ -4,18 +4,27 @@ module C3D
|
|
4
4
|
module Utility
|
5
5
|
extend self
|
6
6
|
|
7
|
+
def set_config
|
8
|
+
config = get_config
|
9
|
+
set_the_env config
|
10
|
+
end
|
11
|
+
|
7
12
|
def save_key
|
8
|
-
key
|
9
|
-
config_file
|
10
|
-
config
|
13
|
+
key = Celluloid::Actor[:eth].get_key
|
14
|
+
config_file = File.join(ENV['HOME'], '.epm', 'c3d-config.json')
|
15
|
+
config = JSON.load(File.read(config_file))
|
11
16
|
config["primary_account_key"] = key if config["primary_account_key"] != key
|
12
|
-
ENV['ETH_KEY']
|
17
|
+
ENV['ETH_KEY'] = config["primary_account_key"]
|
13
18
|
File.open(config_file, 'w'){|f| f.write(JSON.pretty_generate(config))}
|
14
19
|
end
|
15
20
|
|
16
|
-
def
|
17
|
-
|
18
|
-
|
21
|
+
def save_address
|
22
|
+
key = Celluloid::Actor[:eth].get_key
|
23
|
+
address = Celluloid::Actor[:eth].get_address
|
24
|
+
config_file = File.join(ENV['HOME'], '.epm', 'c3d-config.json')
|
25
|
+
config = JSON.load(File.read(config_file))
|
26
|
+
config["primary_account"] = address if config["primary_account"] != address
|
27
|
+
File.open(config_file, 'w'){|f| f.write(JSON.pretty_generate(config))}
|
19
28
|
end
|
20
29
|
|
21
30
|
def get_config
|
data/lib/c3d/util/watch.rb
CHANGED
@@ -49,10 +49,7 @@ module C3D
|
|
49
49
|
|
50
50
|
def adder object, file, contract
|
51
51
|
unless object.include? contract
|
52
|
-
p contract
|
53
|
-
p contract.class
|
54
52
|
object << contract if contract.class == (String || Array)
|
55
|
-
p object
|
56
53
|
object.flatten if contract.class == Array
|
57
54
|
saver object, file
|
58
55
|
return true
|
data/lib/c3d/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
VERSION ||= "0.5.
|
1
|
+
VERSION ||= "0.5.5"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: c3d
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Casey Kuhlman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|