ethereum.rb 2.1.6 → 2.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/README.md +3 -3
- data/bin/install_parity +1 -1
- data/lib/ethereum/client.rb +1 -1
- data/lib/ethereum/contract.rb +2 -0
- data/lib/ethereum/explorer_url_helper.rb +3 -3
- data/lib/ethereum/ipc_client.rb +6 -3
- data/lib/ethereum/solidity.rb +6 -6
- data/lib/ethereum/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e53cfb3e0ec04452936380a3efe4959598ee1551
|
4
|
+
data.tar.gz: 86a0d4366ca9796e9d9efa1b1f5bb90c89728522
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9d8cc30f9d56fec26463ba96040f687db1872e69c8c343c6e6d25aecc6d8e8289cb7ce5207e8d0eade0d70a07889955a92777f41cc0daf4580d1d67e7c0009d
|
7
|
+
data.tar.gz: 402a8b9741e1700b2561b76c1217c6a22e7b53c2340665bdf469895381303c94168e836801f9d74e0ab406aad53ed5d38770475f8345fe82066581260c74e796
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Ethereum Ruby library - Ethereum.rb
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/
|
3
|
+
[![Build Status](https://travis-ci.org/EthWorks/ethereum.rb.svg?branch=master)](https://travis-ci.org/EthWorks/ethereum.rb) [![security](https://hakiri.io/github/NullVoxPopuli/MetaHash/master.svg)](https://hakiri.io/github/NullVoxPopuli/MetaHash/master) [![Dependency Status](https://gemnasium.com/marekkirejczyk/ethereum.rb.svg)](https://gemnasium.com/marekkirejczyk/ethereum.rb) [![Code Climate](https://codeclimate.com/github/marekkirejczyk/ethereum.rb/badges/gpa.svg)](https://codeclimate.com/github/marekkirejczyk/ethereum.rb)
|
4
4
|
|
5
5
|
The goal of ethereum.rb is to make interacting with ethereum blockchain from ruby as fast and easy as possible (but not easier!).
|
6
6
|
|
@@ -242,7 +242,7 @@ contract.gas_price = 24_000_000_000
|
|
242
242
|
|
243
243
|
## Utils
|
244
244
|
|
245
|
-
### Url helpers for rails
|
245
|
+
### Url helpers for rails applications
|
246
246
|
|
247
247
|
Often in the application you want to link to blockchain explorer. This can be problematic if you want links to work with different networks (ropsten, mainnet, kovan) depending on environment you're working on.
|
248
248
|
Following helpers will generate link according to network connected:
|
@@ -253,7 +253,7 @@ link_to_address("See the wallet", "0xE08cdFD4a1b2Ef5c0FC193877EC6A2Bb8f8Eb373")
|
|
253
253
|
```
|
254
254
|
They use [etherscan.io](http://etherscan.io/) as a blockexplorer.
|
255
255
|
|
256
|
-
Note: Helpers work in rails environment only.
|
256
|
+
Note: Helpers work in rails environment only, works with rails 5.0+.
|
257
257
|
|
258
258
|
### Utils rake tasks
|
259
259
|
|
data/bin/install_parity
CHANGED
@@ -14,4 +14,4 @@ echo "Setuping parity..."
|
|
14
14
|
mkdir -p ~/.local/share/io.parity.ethereum/keys/DevelopmentChain
|
15
15
|
chown -R travis:travis ~/.local/share/io.parity.ethereum
|
16
16
|
echo $devwallet > ~/.local/share/io.parity.ethereum/keys/DevelopmentChain/UTC--2017-03-31T14-19-47Z--c05e3b8b-18aa-ab4f-c5ec-09f555bf5357
|
17
|
-
echo $devpassword > ~/.devpass
|
17
|
+
echo $devpassword > ~/.devpass
|
data/lib/ethereum/client.rb
CHANGED
data/lib/ethereum/contract.rb
CHANGED
@@ -2,8 +2,8 @@ module Ethereum
|
|
2
2
|
module ExplorerUrlHelper
|
3
3
|
|
4
4
|
CHAIN_PREFIX = {
|
5
|
-
|
6
|
-
|
5
|
+
17 => "no-explorer-for-devmode.",
|
6
|
+
42 => "kovan.",
|
7
7
|
3 => "ropsten."
|
8
8
|
}
|
9
9
|
|
@@ -20,4 +20,4 @@ module Ethereum
|
|
20
20
|
"https://#{prefix}etherscan.io/#{suffix}"
|
21
21
|
end
|
22
22
|
end
|
23
|
-
end
|
23
|
+
end
|
data/lib/ethereum/ipc_client.rb
CHANGED
@@ -10,7 +10,9 @@ module Ethereum
|
|
10
10
|
"#{ENV['HOME']}/Library/Application\ Support/io.parity.ethereum/jsonrpc.ipc",
|
11
11
|
"#{ENV['HOME']}/.local/share/parity/jsonrpc.ipc",
|
12
12
|
"#{ENV['HOME']}/.local/share/io.parity.ethereum/jsonrpc.ipc",
|
13
|
-
"#{ENV['HOME']}/AppData/Roaming/Parity/Ethereum/jsonrpc.ipc"
|
13
|
+
"#{ENV['HOME']}/AppData/Roaming/Parity/Ethereum/jsonrpc.ipc",
|
14
|
+
"#{ENV['HOME']}/.ethereum/geth.ipc",
|
15
|
+
"#{ENV['HOME']}/.ethereum/testnet/geth.ipc"
|
14
16
|
]
|
15
17
|
|
16
18
|
def initialize(ipcpath = nil, log = true)
|
@@ -20,7 +22,8 @@ module Ethereum
|
|
20
22
|
end
|
21
23
|
|
22
24
|
def self.default_path(paths = IPC_PATHS)
|
23
|
-
paths.select { |path| File.exist?(path) }.first
|
25
|
+
path = paths.select { |path| File.exist?(path) }.first
|
26
|
+
path || raise("Ipc file not found. Please pass in the file path explicitly to IpcClient initializer")
|
24
27
|
end
|
25
28
|
|
26
29
|
def send_single(payload)
|
@@ -46,4 +49,4 @@ module Ethereum
|
|
46
49
|
return result.sort_by! { |c| c['id'] }
|
47
50
|
end
|
48
51
|
end
|
49
|
-
end
|
52
|
+
end
|
data/lib/ethereum/solidity.rb
CHANGED
@@ -2,7 +2,7 @@ require 'tmpdir'
|
|
2
2
|
require 'open3'
|
3
3
|
|
4
4
|
module Ethereum
|
5
|
-
class CompilationError < StandardError;
|
5
|
+
class CompilationError < StandardError;
|
6
6
|
def initialize(msg)
|
7
7
|
super
|
8
8
|
end
|
@@ -10,7 +10,7 @@ module Ethereum
|
|
10
10
|
|
11
11
|
class Solidity
|
12
12
|
|
13
|
-
OUTPUT_REGEXP = /======= (\S*):(\S*) =======\s*Binary:\s*(\S*)\
|
13
|
+
OUTPUT_REGEXP = /======= (\S*):(\S*) =======\s*Binary:\s*(\S*)\s*Contract JSON ABI\s*(\S*)/
|
14
14
|
|
15
15
|
def initialize(bin_path = "solc")
|
16
16
|
@bin_path = bin_path
|
@@ -28,13 +28,13 @@ module Ethereum
|
|
28
28
|
result
|
29
29
|
end
|
30
30
|
|
31
|
-
private
|
31
|
+
private
|
32
32
|
def execute_solc(filename)
|
33
33
|
cmd = "#{@bin_path} #{@args} '#{filename}'"
|
34
34
|
out, stderr, status = Open3.capture3(cmd)
|
35
35
|
raise SystemCallError, "Unanable to run solc compliers" if status.exitstatus == 127
|
36
36
|
raise CompilationError, stderr unless status.exitstatus == 0
|
37
37
|
out
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/ethereum/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ethereum.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marek Kirejczyk
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|