abi_coder_rb 0.2.4 → 0.2.5
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/Gemfile.lock +1 -1
- data/lib/abi_coder_rb/version.rb +1 -1
- data/lib/periphery/event_decoder.rb +3 -6
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 8dc7ba678a03f7f7ba489622979497fb52912b3732dcb27890c270c3b7713e0b
         | 
| 4 | 
            +
              data.tar.gz: 7280e400c63ba3b901e5240710673aa8d857db86197d784a19c26f7220bc5ead
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: f361c6f8d5eb3321f0f2630b7fbfa3c3e3f962ba5bb0174e9cbf99869c55838a2d15c8a6e94c929916d737b3f8960fc37b0bcec23ae9f100ca5775d5f4a98f4c
         | 
| 7 | 
            +
              data.tar.gz: 655bc2ba8c29fa3754dca9affba12f9a0cf5625bd354abbede018a6ea21ce74ad495564237ff4c95ef448bd98b0eccc41bc6951959bdee4226e78e8ac204edb9
         | 
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/lib/abi_coder_rb/version.rb
    CHANGED
    
    
| @@ -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 | 
            +
              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:  | 
| 11 | 
            +
            date: 2024-01-16 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activesupport
         |