ethereum 0.3.90 → 0.4.0

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: ed9c6d551eb9ada508059a23e99f6c14e1549520
4
- data.tar.gz: b82d97a1bbce969eafaac85413d6053206896fc6
3
+ metadata.gz: 20755f188dc7a2767244c544bb8a5516803dba08
4
+ data.tar.gz: 3003bf980e4eb5ef1bd38fab4e0aeb0e6534eef7
5
5
  SHA512:
6
- metadata.gz: 27cedd3b4bd01319c0489d8640a3fa00ee3e24a083e22ffeb0b5cd07eb074f0cf30075bcd8b971d557b4452f1556521d883a6d89c552a36d93d8a2899396eeac
7
- data.tar.gz: 1e4c072d0a161fab24ce8b0abc7ed5377fb9c0feb798967b8baf787fa90e3401b412dc4ec92c7afeb69f3843919c02f258a5ff8d5b7c6d74db39cf48130323f8
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
 
@@ -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
- return {data: payload.join(), raw: raw_result, formatted: formatted_result}
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|
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Ethereum
2
- VERSION = "0.3.90"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ethereum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.90
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - DigixGlobal Pte Ltd (https://dgx.io)