ethereum 0.4.40 → 0.4.41

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50e0a092c6b90539e60fbc9f33a9737045786f17
4
- data.tar.gz: 34caf69d6d45fad9b6d8c5e63711fc419f3da614
3
+ metadata.gz: 0b33eb89e9ff725f99146e1ef5d9037acaf7241c
4
+ data.tar.gz: dda537dc15caa46e74da2729d0579424c9099231
5
5
  SHA512:
6
- metadata.gz: b8043912d4866be8a140ef6e68ffc8a721b001c1ec64d9f0308f6d33b6fc8b6f2d1d625e6f7a132b35dd3dececf1b814b2275c25cbb4ba5ea710c2611cb8f8d0
7
- data.tar.gz: c4cca1936eb1bc030c305a672d88fae24a600591e101fec53bf3b7673395660bd3492228ce924b8882e6235eca0563800eb9ee1a6bfca2b050d8eea951319470
6
+ metadata.gz: 8accc888ecf1b0ef4a40d90742eb8ca7c16691843454f835e92e21db249d38e9afc362fcdfade3c0569bc9598d46ebb78cb95c33b7a45e715fd50c98370cc8ad
7
+ data.tar.gz: a8c48aa2524ce2736857e8c47a19bbac495a2ec593cca0f71ed6ba8467c95a07b81a798d4840ab651d0b0a73c21bfe135350d7995d387484765a65476e5ec16e
@@ -84,10 +84,12 @@ module Ethereum
84
84
 
85
85
  functions.each do |fun|
86
86
 
87
- define_method "call_#{fun.name.underscore}".to_sym do |*args|
87
+ fun_count = functions.select {|x| x.name == fun.name }.count
88
+ derived_function_name = (fun_count == 1) ? "#{fun.name.underscore}" : "#{fun.name.underscore}__#{fun.inputs.collect {|x| x.type}.join("__")}"
89
+
90
+ define_method "call_#{derived_function_name}".to_sym do |*args|
88
91
  formatter = Ethereum::Formatter.new
89
92
  arg_types = fun.inputs.collect(&:type)
90
- #out_types = fun.outputs.collect(&:type)
91
93
  connection = self.connection
92
94
  return {result: :error, message: "missing parameters for #{fun.function_string}" } if arg_types.length != args.length
93
95
  payload = []
@@ -101,7 +103,7 @@ module Ethereum
101
103
  return {data: payload.join(), raw: raw_result, formatted: output}
102
104
  end
103
105
 
104
- define_method "transact_#{fun.name.underscore}".to_sym do |*args|
106
+ define_method "transact_#{derived_function_name}".to_sym do |*args|
105
107
  formatter = Ethereum::Formatter.new
106
108
  arg_types = fun.inputs.collect(&:type)
107
109
  connection = self.connection
@@ -115,8 +117,8 @@ module Ethereum
115
117
  return Ethereum::Transaction.new(txid, self.connection, payload.join(), args)
116
118
  end
117
119
 
118
- define_method "transact_and_wait_#{fun.name.underscore}".to_sym do |*args|
119
- function_name = "transact_#{fun.name.underscore}".to_sym
120
+ define_method "transact_and_wait_#{derived_function_name}".to_sym do |*args|
121
+ function_name = "transact_#{derived_function_name}".to_sym
120
122
  tx = self.send(function_name, *args)
121
123
  tx.wait_for_miner
122
124
  return tx
@@ -1,7 +1,7 @@
1
1
  module Ethereum
2
2
  class Function
3
3
 
4
- attr_accessor :name, :inputs, :outputs, :signature, :constant, :function_string
4
+ attr_accessor :name, :inputs, :outputs, :signature, :constant, :function_string
5
5
 
6
6
  def initialize(data)
7
7
  @name = data["name"]
@@ -1,3 +1,3 @@
1
1
  module Ethereum
2
- VERSION = "0.4.40"
2
+ VERSION = "0.4.41"
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.4.40
4
+ version: 0.4.41
5
5
  platform: ruby
6
6
  authors:
7
7
  - DigixGlobal Pte Ltd (https://dgx.io)