abi_coder_rb 0.2.4 → 0.2.5

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
  SHA256:
3
- metadata.gz: 5ea1c60ed8bfe0bf5e5b66501698f0cba73a8407293cea13879015c594a1a1fe
4
- data.tar.gz: 80078bcc3870bc1b44c3655d535fc87a4092acaa18f0ca84eacacb303208bd9d
3
+ metadata.gz: 8dc7ba678a03f7f7ba489622979497fb52912b3732dcb27890c270c3b7713e0b
4
+ data.tar.gz: 7280e400c63ba3b901e5240710673aa8d857db86197d784a19c26f7220bc5ead
5
5
  SHA512:
6
- metadata.gz: c2ec394e57941ac7a6d6d1ee765e0ade1f1a449d4e1bdcd221c3e16cb496249dcfe449712d826eb43335556d176c17949d5865be6e85c12f88c53cb8678e38d7
7
- data.tar.gz: 3c5aebd1602663598241c823759bf5a30a508386e93c6624221d80646503db1cfde5365d97f13b35fb98a87cc7f46c5e388bc6c423de180e08eaf0c83dffba14
6
+ metadata.gz: f361c6f8d5eb3321f0f2630b7fbfa3c3e3f962ba5bb0174e9cbf99869c55838a2d15c8a6e94c929916d737b3f8960fc37b0bcec23ae9f100ca5775d5f4a98f4c
7
+ data.tar.gz: 655bc2ba8c29fa3754dca9affba12f9a0cf5625bd354abbede018a6ea21ce74ad495564237ff4c95ef448bd98b0eccc41bc6951959bdee4226e78e8ac204edb9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- abi_coder_rb (0.2.4)
4
+ abi_coder_rb (0.2.5)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AbiCoderRb
4
- VERSION = "0.2.4"
4
+ VERSION = "0.2.5"
5
5
  end
@@ -88,11 +88,11 @@ class EventDecoder
88
88
  def fields_of(inputs)
89
89
  inputs.map do |input|
90
90
  if input["type"] == "tuple"
91
- [input["name"], fields_of(input["components"])]
91
+ [input["name"].underscore, fields_of(input["components"])]
92
92
  elsif input["type"] == "enum"
93
- [input["name"], "uint8"]
93
+ [input["name"].underscore, "uint8"]
94
94
  else
95
- [input["name"], input["type"]]
95
+ [input["name"].underscore, input["type"]]
96
96
  end
97
97
  end
98
98
  end
@@ -127,7 +127,6 @@ class EventDecoder
127
127
 
128
128
  def flat_fields(fields, sep: ".")
129
129
  fields.map do |name, type|
130
- name = name.underscore
131
130
  if type.is_a?(::Array)
132
131
  flat_fields(type, sep: sep).map do |n, t|
133
132
  ["#{name}#{sep}#{n}", t]
@@ -147,7 +146,6 @@ class EventDecoder
147
146
  # ["root", {"message" => ["channel", "index", "fromChainId", "from", "toChainId", "to", "gasLimit", "encoded"]}
148
147
  def fields_names(fields)
149
148
  fields.map do |name, type|
150
- name = name.underscore
151
149
  if type.is_a?(::Array)
152
150
  { name => fields_names(type) }
153
151
  elsif type.is_a?(::String)
@@ -166,7 +164,6 @@ class EventDecoder
166
164
  # ["root", "message_channel", "message_index", "message_fromChainId", "message_from", "message_toChainId", "message_to", "message_gasLimit", "message_encoded"]
167
165
  def fields_names_flatten(fields, prefix: nil, sep: ".")
168
166
  fields.map do |name, type|
169
- name = name.underscore
170
167
  if type.is_a?(::Array)
171
168
  fields_names_flatten(
172
169
  type,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abi_coder_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aki Wu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-22 00:00:00.000000000 Z
11
+ date: 2024-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport