ethereum 0.5.1 → 0.5.2

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: 9a05ae654690a826058ea550ff9c8a1455f69b6d
4
- data.tar.gz: b330ea17618b1f59f8588f924d7f506ce4a267ac
3
+ metadata.gz: 1d7b10376c51362741c2df7a62417477eeb146c8
4
+ data.tar.gz: 2309b18124e2a24c15d429afec3307743948e3d9
5
5
  SHA512:
6
- metadata.gz: 61ffb0a9c3cc798725d910a9dd1566f790ee7edc0e8abf43680ad44cd35f713bcfb4eae3f1d74cc8dc5b287588080097fe431432d0a30cbbebf4c2a20cc8961d
7
- data.tar.gz: cdf551d2340dbdbfbe6ad3424a1e28feb8d0b52ccedf5cab8b55c9d749418760b2fc170922af8690a11addb93fe5b4512b5b8784f76af968d3ad582d7acc99d3
6
+ metadata.gz: a303d996411856f237b83f52cb4fd5ed271755b57f1a2dc2b39da4863ca8b931acbcd4787d91ea6fc99c149fe38b32fc43b517e42780e127465362a6a5a0a298
7
+ data.tar.gz: 2c6c82bcca7b3342f40c4dab2c77edd4fb6951c9895728477c30f2536e6427d5d0b4f855f03e61b681274397276915c272305694494d297143a787d0c47d7e5c
@@ -169,7 +169,7 @@ module Ethereum
169
169
  arg_types.zip(args).each do |arg|
170
170
  payload << formatter.to_payload(arg)
171
171
  end
172
- raw_result = connection.call({to: self.address, from: self.sender, data: "0x" + payload.join()})["result"]
172
+ raw_result = connection.call({to: self.address, from: self.sender, data: payload.join()})["result"]
173
173
  formatted_result = fun.outputs.collect {|x| x.type }.zip(raw_result.gsub(/^0x/,'').scan(/.{64}/))
174
174
  output = formatted_result.collect {|x| formatter.from_payload(x) }
175
175
  return {data: "0x" + payload.join(), raw: raw_result, formatted: output}
@@ -24,6 +24,9 @@ module Ethereum
24
24
  method_name = "#{rpc_command.split("_")[1].underscore}"
25
25
  define_method method_name do |*args|
26
26
  command = rpc_command
27
+ if command == "eth_call"
28
+ args << "latest"
29
+ end
27
30
  payload = {jsonrpc: "2.0", method: command, params: args, id: get_id}
28
31
  http = ::Net::HTTP.new(@host, @port)
29
32
  if @ssl
@@ -17,6 +17,9 @@ module Ethereum
17
17
  method_name = "#{rpc_command.split("_")[1].underscore}"
18
18
  define_method method_name do |*args|
19
19
  command = rpc_command
20
+ if command == "eth_call"
21
+ args << "latest"
22
+ end
20
23
  payload = {jsonrpc: "2.0", method: command, params: args, id: get_id}
21
24
  socket = UNIXSocket.new(@ipcpath)
22
25
  socket.write(payload.to_json)
@@ -1,3 +1,3 @@
1
1
  module Ethereum
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ethereum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - DigixGlobal Pte Ltd (https://dgx.io)