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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c6e74fa7d05adf9592342735028198f944390d3
4
- data.tar.gz: 3c368529abe2a59a94d9f4e8a2abd6bc189c675f
3
+ metadata.gz: 57c78accf60033381fb7e2a047359b3fda3e4790
4
+ data.tar.gz: b53f7b610a9b622b3f65ae08cfca01f2b501f6c0
5
5
  SHA512:
6
- metadata.gz: a66fdeb4b4a3efb6a0c922f2bfd869dad919f389969c71493a8daae7c7e02f78c45fdbce30262ea591902678446f16066f3249b2bc8657fc2537e87c18e2c06d
7
- data.tar.gz: 7d9456a552b429fc3363b101b918df35cd98ff43541f2e166e80850b72f4b7602af28f8f05966d8fa1f735019089f47799cfbe95449bb1667cef9f7e5d88bb51
6
+ metadata.gz: 862cd29411262169e3f89081cad6b06803c054d0bc6a25db9e33cb06301ddc9ad59c215c5df3605bdf47fad66d6ae5d616c6a6da491b6bbb266090c2c340b61f
7
+ data.tar.gz: f33a2b8998ce1809bb10cee4aaf57b5f3950739db7a8b58ea8b8708029c3405cfb71d86649b176c96e2f165a216854976fdafbd30ef903ccf2c0c76d38c9861b
data/README.md CHANGED
@@ -1,3 +1,4 @@
1
+ [![Stories in Ready](https://badge.waffle.io/project-douglas/c3d.png?label=ready&title=Ready)](https://waffle.io/project-douglas/c3d)
1
2
  ## Introduction
2
3
 
3
4
  C3D => Contract Controlled Content Distribution
@@ -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 = Celluloid::Actor[:eth].get_key
9
- config_file = File.join(ENV['HOME'], '.epm', 'c3d-config.json')
10
- config = JSON.load(File.read(config_file))
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'] = config["primary_account_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 set_config
17
- config = get_config
18
- set_the_env config
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
@@ -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.4"
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
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-24 00:00:00.000000000 Z
11
+ date: 2014-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty