ethereum 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ethereum/contract.rb +1 -1
- data/lib/ethereum/http_client.rb +3 -0
- data/lib/ethereum/ipc_client.rb +3 -0
- data/lib/ethereum/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d7b10376c51362741c2df7a62417477eeb146c8
|
4
|
+
data.tar.gz: 2309b18124e2a24c15d429afec3307743948e3d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a303d996411856f237b83f52cb4fd5ed271755b57f1a2dc2b39da4863ca8b931acbcd4787d91ea6fc99c149fe38b32fc43b517e42780e127465362a6a5a0a298
|
7
|
+
data.tar.gz: 2c6c82bcca7b3342f40c4dab2c77edd4fb6951c9895728477c30f2536e6427d5d0b4f855f03e61b681274397276915c272305694494d297143a787d0c47d7e5c
|
data/lib/ethereum/contract.rb
CHANGED
@@ -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:
|
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}
|
data/lib/ethereum/http_client.rb
CHANGED
@@ -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
|
data/lib/ethereum/ipc_client.rb
CHANGED
@@ -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)
|
data/lib/ethereum/version.rb
CHANGED