etheruby 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17452003f0ef0953bc2cc6d9c26ed6b3a3d89edc
4
- data.tar.gz: d7113f02c1a8059ad994dce65d5fa792e4390441
3
+ metadata.gz: fea4ffff4d28d133a0f998ca40f6040c6c114ae4
4
+ data.tar.gz: c14ed6dfaaf3d7708d301233b727a6444cb28e6c
5
5
  SHA512:
6
- metadata.gz: ff11ae317d3d4842e6dfa47a479e4ff38bf8795105201a3510ba0d756c855bba7cb4c49a7bd310957f39812c424d660c95519f17fc1e06aa86bb7f29cb0c71ef
7
- data.tar.gz: a86b0296abdad754f918268bf814f6713ecdb0ad2a37c985f67e006e8c8c9f65bef16b3c149419cc7c70b882ae49743dbe9e8d9f093ef6c4ee535b882fc55327
6
+ metadata.gz: 8899bd1b0bad2748eee4df58a238efb697b753514491292cafdb3192000c826c7e9cd6a9852e49a724b3976b2bb5b09ad82ba7fa67c3ad1f0fa67e84ef16eb00
7
+ data.tar.gz: 6246fe84e03f713e19160e1fbd4f6ad9efa7e4f2df2cad9a86946988dab2bc5e089b6f9264270d14daf351a13483609fb8b34d581f99d707df7e50ed06735037
@@ -52,11 +52,19 @@ module Etheruby
52
52
  arguments = ArgumentsGenerator.new(method_info[:params], args).to_s
53
53
  data = "#{method_info[:signature]}#{arguments}"
54
54
  composed_body = { to: self.address, data: data }
55
+
55
56
  [ :gas, :gasPrice, :value, :from ].each { |kw|
56
57
  composed_body[kw] = method_info[kw] if method_info.has_key? kw
57
58
  }
59
+
58
60
  @@logger.debug("Calling #{method_info[:name]} with parameters #{composed_body.inspect}")
59
- response = call_api composed_body
61
+
62
+ response = if method_info.has_key?(:force_transac) and method_info[:force_transac]
63
+ do_eth_transaction composed_body
64
+ else
65
+ call_api composed_body
66
+ end
67
+
60
68
  if response.is_a? Hash and response.has_key? 'error'
61
69
  @@logger.error("Failed contract execution #{response['error']['message']}")
62
70
  elsif response.is_a? Hash and response.has_key? 'result'
@@ -42,6 +42,10 @@ module Etheruby
42
42
  data[:value] = "0x#{_gas.to_s(16)}"
43
43
  end
44
44
 
45
+ def force_transaction!
46
+ data[:force_transac] = true
47
+ end
48
+
45
49
  def validate!
46
50
  data[:params] = [] unless data.has_key? :params
47
51
  signature = "#{@data[:name]}(#{data[:params].join(',')})"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etheruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jérémy SEBAN
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-08 00:00:00.000000000 Z
11
+ date: 2017-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov