ethereum.rb 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3f3a3f9140665a3b64447587dcf3bcf8a919a5a
4
- data.tar.gz: 1d8a748b87ee23dfee41d145020186de114d2e44
3
+ metadata.gz: 7f0c7071a558491b450799c58d386c0ee7c15c94
4
+ data.tar.gz: ce75e35934f9e048fc5d1685512b0d18c0c144ae
5
5
  SHA512:
6
- metadata.gz: fe2a8618f99cc13711d2a23db8bc7b80dd82f6a30a5be2bac4cf2c436bf2405e5b17b3aed628c47262afbed010f52c2d2936cca6562702e0554cac4d06add726
7
- data.tar.gz: e44306b317587642f3c719d51566cc80a316f883d9da41435d768541b9147fa55e38aad212c1cb4228c20bd6f646ac3f840e0d8ce8056456d5ad7f5c6b49d6cf
6
+ metadata.gz: 39b3e4e1174094f1f6dcfd5df14378f50b602e7ec50aeb4ded1a3c32e72ce8b35d0382f364260945f28ede9e96293c8b0a4ae0461fc1b57d62a23bf7a0965bb7
7
+ data.tar.gz: af1985db04cfefcfc4f2bea25900d4d7b546da623d5205d090c5e15f6f45870a7758b4195726a892710ee8e2eb1fcd5d5405f551ac97c14b6b08abf5663345fe
@@ -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 ropsten --password ~/.pass --unlock 3089630d06fD90Ef48a0c43f000971587c1F3247 --author 3089630d06fD90Ef48a0c43f000971587c1F3247 daemon ~/.parity.pid --log-file ~/.parity.log
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 ropsten account list
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
@@ -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
- echo $pass > ~/.pass
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 $wallet > ~/.local/share/io.parity.ethereum/keys/test/UTC--2017-01-08T21-02-29.039669388Z--3089630d06fd90ef48a0c43f000971587c1f3247
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
@@ -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
- tx = transfer(key, address, amount)
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
@@ -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 != 64
52
- value[24..64]
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)
@@ -1,3 +1,3 @@
1
1
  module Ethereum
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
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.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-13 00:00:00.000000000 Z
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.6.8
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