ethereum.rb 2.1.1 → 2.1.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 +4 -4
- data/.travis.yml +2 -5
- data/bin/install_parity +3 -3
- data/lib/ethereum/client.rb +14 -1
- data/lib/ethereum/decoder.rb +3 -3
- data/lib/ethereum/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f0c7071a558491b450799c58d386c0ee7c15c94
|
4
|
+
data.tar.gz: ce75e35934f9e048fc5d1685512b0d18c0c144ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39b3e4e1174094f1f6dcfd5df14378f50b602e7ec50aeb4ded1a3c32e72ce8b35d0382f364260945f28ede9e96293c8b0a4ae0461fc1b57d62a23bf7a0965bb7
|
7
|
+
data.tar.gz: af1985db04cfefcfc4f2bea25900d4d7b546da623d5205d090c5e15f6f45870a7758b4195726a892710ee8e2eb1fcd5d5405f551ac97c14b6b08abf5663345fe
|
data/.travis.yml
CHANGED
@@ -12,12 +12,9 @@ before_install:
|
|
12
12
|
- sudo bin/install_parity
|
13
13
|
- gem install bundler -v 1.11.2
|
14
14
|
before_script:
|
15
|
-
- parity --warp --chain
|
16
|
-
- cat ~/.parity.log
|
15
|
+
- parity --warp --chain dev --password ~/.devpass --unlock 00a329c0648769a73afac7f9381e08fb43dbea72 --author 00a329c0648769a73afac7f9381e08fb43dbea72 daemon ~/.parity.pid --log-file ~/.parity.log
|
17
16
|
- sleep 5
|
18
|
-
- parity --chain
|
19
|
-
- cat ~/.parity.log
|
20
|
-
- bundle exec rake ethereum:node:waitforsync
|
17
|
+
- parity --chain dev account list
|
21
18
|
- cat ~/.parity.log
|
22
19
|
script:
|
23
20
|
- bundle exec rspec --tag ~blockchain && bundle exec rspec --tag blockchain
|
data/bin/install_parity
CHANGED
@@ -11,7 +11,7 @@ wget http://d1h4xl4cr1h0mo.cloudfront.net/v$PARITY\/x86_64-unknown-linux-gnu/par
|
|
11
11
|
sudo dpkg -i parity_$PARITY\_amd64.deb
|
12
12
|
|
13
13
|
echo "Setuping parity..."
|
14
|
-
|
15
|
-
mkdir -p ~/.local/share/io.parity.ethereum/keys/test
|
14
|
+
mkdir -p ~/.local/share/io.parity.ethereum/keys/DevelopmentChain
|
16
15
|
chown -R travis:travis ~/.local/share/io.parity.ethereum
|
17
|
-
echo $
|
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
|
data/lib/ethereum/client.rb
CHANGED
@@ -76,6 +76,16 @@ module Ethereum
|
|
76
76
|
eth_get_transaction_count(address)["result"].to_i(16)
|
77
77
|
end
|
78
78
|
|
79
|
+
|
80
|
+
def transfer_to(address, amount)
|
81
|
+
eth_send_transaction({to: address, value: int_to_hex(amount)})
|
82
|
+
end
|
83
|
+
|
84
|
+
def transfer_to_and_wait(address, amount)
|
85
|
+
wait_for(transfer_to(address, amount)["result"])
|
86
|
+
end
|
87
|
+
|
88
|
+
|
79
89
|
def transfer(key, address, amount)
|
80
90
|
Eth.configure { |c| c.chain_id = get_chain }
|
81
91
|
args = {
|
@@ -93,7 +103,10 @@ module Ethereum
|
|
93
103
|
end
|
94
104
|
|
95
105
|
def transfer_and_wait(key, address, amount)
|
96
|
-
|
106
|
+
return wait_for(transfer(key, address, amount))
|
107
|
+
end
|
108
|
+
|
109
|
+
def wait_for(tx)
|
97
110
|
transaction = Ethereum::Transaction.new(tx, self, "", [])
|
98
111
|
transaction.wait_for_miner
|
99
112
|
return transaction
|
data/lib/ethereum/decoder.rb
CHANGED
@@ -47,9 +47,9 @@ module Ethereum
|
|
47
47
|
raise ArgumentError
|
48
48
|
end
|
49
49
|
|
50
|
-
def decode_address(value, _ = nil,
|
51
|
-
raise ArgumentError if value.size
|
52
|
-
value[24..
|
50
|
+
def decode_address(value, _ = nil, start)
|
51
|
+
raise ArgumentError if value.size-start < 64
|
52
|
+
value[start+24..start+63]
|
53
53
|
end
|
54
54
|
|
55
55
|
def decode_bytes(value, subtype, start)
|
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.2
|
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-04-
|
11
|
+
date: 2017-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -210,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
210
|
version: '0'
|
211
211
|
requirements: []
|
212
212
|
rubyforge_project:
|
213
|
-
rubygems_version: 2.
|
213
|
+
rubygems_version: 2.5.1
|
214
214
|
signing_key:
|
215
215
|
specification_version: 4
|
216
216
|
summary: Ruby Ethereum client using the JSON-RPC interface
|