ethereum 0.3.90 → 0.4.0
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/README.md +1 -2
- data/lib/ethereum/contract.rb +3 -2
- data/lib/ethereum/formatter.rb +5 -0
- 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: 20755f188dc7a2767244c544bb8a5516803dba08
|
4
|
+
data.tar.gz: 3003bf980e4eb5ef1bd38fab4e0aeb0e6534eef7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fd0e2d8aa64b321a6ece13d99cb0feea4fb0f31fda3f59f28036cbd172d66c9604236cf3c65948ca6e862f78b40d30458713be7acd0dfffa7d0c9a37fcd8795
|
7
|
+
data.tar.gz: 4644647d568767bcb41ded0cd0a00e6ccf83c333628df36bed30da57c2a3ed9891f1d348e3e6c1dd87a5ca06101637ebe3b8b2b21fb8121a6bb63f72345a5db3
|
data/README.md
CHANGED
@@ -110,11 +110,10 @@ simple_name_registry_instance.at("0x734533083b5fc0cd14b7cb8c8eb6ed0c9bd184d3")
|
|
110
110
|
* Add Windows IPC Client (named pipes)
|
111
111
|
* Add support for creating and sending of raw transactions
|
112
112
|
* Offline account creation
|
113
|
-
* Solidity constant function output should be properly formatted according to the ouput data type
|
114
|
-
* Unit testing and contract testing examples. Use [web3.js](https://github.com/ethereum/web3.js) tests as a baseline.
|
115
113
|
* ContractTransaction class
|
116
114
|
* Add more examples
|
117
115
|
* API documentation
|
116
|
+
* Unit testing and contract testing examples. Use [web3.js](https://github.com/ethereum/web3.js) tests as a baseline.
|
118
117
|
|
119
118
|
## Support
|
120
119
|
|
data/lib/ethereum/contract.rb
CHANGED
@@ -93,8 +93,9 @@ module Ethereum
|
|
93
93
|
payload << formatter.to_payload(arg)
|
94
94
|
end
|
95
95
|
raw_result = connection.call({to: self.address, from: self.sender, data: payload.join()})["result"]
|
96
|
-
formatted_result = raw_result.gsub(/^0x/,'').scan(/.{64}/)
|
97
|
-
|
96
|
+
formatted_result = fun.outputs.collect {|x| x.type }.zip(raw_result.gsub(/^0x/,'').scan(/.{64}/))
|
97
|
+
output = formatted_result.collect {|x| formatter.from_payload(x) }
|
98
|
+
return {data: payload.join(), raw: raw_result, formatted: output}
|
98
99
|
end
|
99
100
|
|
100
101
|
define_method "transact_#{fun.name.underscore}".to_sym do |*args|
|
data/lib/ethereum/formatter.rb
CHANGED
@@ -74,6 +74,11 @@ module Ethereum
|
|
74
74
|
self.send(converter, args[1])
|
75
75
|
end
|
76
76
|
|
77
|
+
def from_payload(args)
|
78
|
+
converter = "output_to_#{self.get_base_type(args[0])}".to_sym
|
79
|
+
self.send(converter, args[1])
|
80
|
+
end
|
81
|
+
|
77
82
|
def output_to_address(bytes)
|
78
83
|
self.to_address(bytes)
|
79
84
|
end
|
data/lib/ethereum/version.rb
CHANGED