ethereum 0.4.97 → 0.4.98
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ethereum/http_client.rb +5 -1
- 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: 84008eb04c7583cf3af957baeae6e90c0f2562f5
|
4
|
+
data.tar.gz: 95ffa5112b13ec411aca38426ded830aa011b48c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 888094de234a1c170a178f4df60245d42d0690f157aa6c43028b4cc1abea2fd7679f211629d5be49decc71a5acbd2c2c262a171b363e3f3d89e3fb6a60cc85ec
|
7
|
+
data.tar.gz: 88b31b3785f1e8fff7d2d420196c5cfba1c953b61340870509da4dd92429bdedb3670b2c4c7cec573a746c0f9a3afc60717cb5aa00c19e2224536bafc161dec8
|
data/lib/ethereum/http_client.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
require 'net/http'
|
2
2
|
module Ethereum
|
3
3
|
class HttpClient < Client
|
4
|
-
attr_accessor :command, :id, :host, :port, :batch, :converted_transactions, :uri
|
4
|
+
attr_accessor :command, :id, :host, :port, :batch, :converted_transactions, :uri, :ssl
|
5
5
|
|
6
6
|
def initialize(host, port, ssl = false)
|
7
7
|
@host = host
|
8
8
|
@port = port
|
9
9
|
@id = 1
|
10
|
+
@ssl = ssl
|
10
11
|
if ssl
|
11
12
|
@uri = URI("https://#{@host}:#{@port}")
|
12
13
|
else
|
@@ -21,6 +22,9 @@ module Ethereum
|
|
21
22
|
command = rpc_command
|
22
23
|
payload = {jsonrpc: "2.0", method: command, params: args, id: get_id}
|
23
24
|
http = ::Net::HTTP.new(@host, @port)
|
25
|
+
if @ssl
|
26
|
+
http.use_ssl = true
|
27
|
+
end
|
24
28
|
header = {'Content-Type' => 'application/json'}
|
25
29
|
request = ::Net::HTTP::Post.new(uri, header)
|
26
30
|
request.body = payload.to_json
|
data/lib/ethereum/version.rb
CHANGED