abi_coder_rb 0.2.4 → 0.2.6

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: ff1d3aec04a350f983e9c53f6fff5cec29a07c1e3be1386828a4b71a51860ad6
4
+ data.tar.gz: 3e365e8dfd6d34fb82a36c6ae4400f6a1b0d005a2c62a26e1343e049d97d10e9
5
5
  SHA512:
6
- metadata.gz: c2ec394e57941ac7a6d6d1ee765e0ade1f1a449d4e1bdcd221c3e16cb496249dcfe449712d826eb43335556d176c17949d5865be6e85c12f88c53cb8678e38d7
7
- data.tar.gz: 3c5aebd1602663598241c823759bf5a30a508386e93c6624221d80646503db1cfde5365d97f13b35fb98a87cc7f46c5e388bc6c423de180e08eaf0c83dffba14
6
+ metadata.gz: d66421be4cc772f884e3cb0da9ff0738831b9066094244192d2aa6eaa3e45b1151820796d02e72695ac01e95f4f5a0315e372c9af9800c7a3a0f70a505c8f0a0
7
+ data.tar.gz: 495d5488bae787e0307d2c1561c3a4f962f699e165ce9ad04be099c73b20330652603b1c4a2d662b9bedc7f8899524ec895a4a00749f2bf84350ef6d97c33e80
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.6)
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.6"
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.6
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-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -79,6 +79,8 @@ licenses:
79
79
  - MIT
80
80
  metadata:
81
81
  homepage_uri: https://github.com/wuminzhe/abi_coder_rb
82
+ source_code_uri: https://github.com/wuminzhe/abi_coder_rb
83
+ bug_tracker_uri: https://github.com/wuminzhe/abi_coder_rb/issues
82
84
  post_install_message:
83
85
  rdoc_options: []
84
86
  require_paths: