ethereum.rb 2.0.6 → 2.0.7
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 +1 -1
- data/lib/ethereum/client.rb +0 -1
- data/lib/ethereum/contract.rb +10 -2
- 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: 49c6da26b64e4d9ca2cc696c67a455eaed8e3b48
|
4
|
+
data.tar.gz: 7eb88a934534f292fd05930270f157f1c17a299c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f2bda6848455535558e18ecc9fde467fba0f685e36bc8befeec29e2bbc083cdd317aeb8ffa3d207cbb96f29004dd0061183a3f5e85544d13aa20fb359bc6b5e
|
7
|
+
data.tar.gz: 9356203de304aca16fd53a60b04c83da5de78b7427d080e2e87920a8909bdd92fdfb3a9039a5ce8472b6709bcd3a38eead1d31df098fd02222e95779de00481c
|
data/.travis.yml
CHANGED
@@ -4,6 +4,7 @@ rvm:
|
|
4
4
|
- 2.3.1
|
5
5
|
env:
|
6
6
|
- PARITY="1.5.0"
|
7
|
+
- PARITY="1.5.7"
|
7
8
|
cache:
|
8
9
|
bundler: true
|
9
10
|
directories:
|
@@ -18,7 +19,6 @@ before_script:
|
|
18
19
|
- parity --chain testnet account list
|
19
20
|
- cat ~/.parity.log
|
20
21
|
- bundle exec rake ethereum:node:waitforsync
|
21
|
-
- bundle exec rake ethereum:test:setup
|
22
22
|
script:
|
23
23
|
- bundle exec rspec --tag ~blockchain && bundle exec rspec --tag blockchain
|
24
24
|
before_cache:
|
data/lib/ethereum/client.rb
CHANGED
data/lib/ethereum/contract.rb
CHANGED
@@ -2,6 +2,7 @@ module Ethereum
|
|
2
2
|
class Contract
|
3
3
|
|
4
4
|
attr_reader :address
|
5
|
+
attr_accessor :gas, :gas_price
|
5
6
|
attr_accessor :code, :name, :abi, :class_object, :sender, :deployment, :client
|
6
7
|
attr_accessor :events, :functions, :constructor_inputs
|
7
8
|
attr_accessor :call_raw_proxy, :call_proxy, :transact_proxy, :transact_and_wait_proxy
|
@@ -35,7 +36,6 @@ module Ethereum
|
|
35
36
|
contract
|
36
37
|
end
|
37
38
|
|
38
|
-
|
39
39
|
def address=(addr)
|
40
40
|
@address = addr
|
41
41
|
@events.each do |event|
|
@@ -93,9 +93,16 @@ module Ethereum
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
+
def add_gas_options_args(args)
|
97
|
+
args[:gas] = @client.int_to_hex(@gas) if @gas.present?
|
98
|
+
args[:gasPrice] = @client.int_to_hex(@gas_price) if @gas_price.present?
|
99
|
+
args
|
100
|
+
end
|
101
|
+
|
96
102
|
def transact(fun, *args)
|
97
103
|
payload = fun.signature + @encoder.encode_arguments(fun.inputs, args)
|
98
|
-
|
104
|
+
args = {to: @address, from: @sender, data: "0x" + payload}
|
105
|
+
txid = @client.eth_send_transaction(add_gas_options_args(args))["result"]
|
99
106
|
return Ethereum::Transaction.new(txid, @client, payload, args)
|
100
107
|
end
|
101
108
|
|
@@ -151,6 +158,7 @@ module Ethereum
|
|
151
158
|
create_event_proxies
|
152
159
|
class_methods = Class.new do
|
153
160
|
extend Forwardable
|
161
|
+
def_delegators :parent, :gas, :gas_price, :gas=, :gas_price=
|
154
162
|
def_delegators :parent, :abi, :deployment, :events
|
155
163
|
def_delegators :parent, :estimate, :deploy, :deploy_and_wait
|
156
164
|
def_delegators :parent, :address, :address=, :sender, :sender=
|
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.0.
|
4
|
+
version: 2.0.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-03-
|
11
|
+
date: 2017-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|