Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abi::Event.decode_log raised an error #247

Closed
wuminzhe opened this issue Oct 11, 2023 · 2 comments
Closed

Abi::Event.decode_log raised an error #247

wuminzhe opened this issue Oct 11, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@wuminzhe
Copy link
Contributor

Abi::Event.decode_log failed:

 NoMethodError:
   undefined method `none?' for nil:NilClass

             elsif base_type == "tuple" && components.none?(&:dynamic?)

abi:

[
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "bytes32",
        "name": "msgHash",
        "type": "bytes32"
      },
      {
        "indexed": false,
        "internalType": "bytes32",
        "name": "root",
        "type": "bytes32"
      },
      {
        "components": [
          {
            "internalType": "address",
            "name": "channel",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "index",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "fromChainId",
            "type": "uint256"
          },
          {
            "internalType": "address",
            "name": "from",
            "type": "address"
          },
          {
            "internalType": "uint256",
            "name": "toChainId",
            "type": "uint256"
          },
          {
            "internalType": "address",
            "name": "to",
            "type": "address"
          },
          {
            "internalType": "bytes",
            "name": "encoded",
            "type": "bytes"
          }
        ],
        "indexed": false,
        "internalType": "struct Message",
        "name": "message",
        "type": "tuple"
      }
    ],
    "name": "MessageAccepted",
    "type": "event"
  }
]

log:

      log = {
        "address"=>"0x0000000000bd9dcfda5c60697039e2b3b28b079b", 
        "blockHash"=>"0xf9c70715305172f0d7ae0e335c38df5582c6138d96b742183c02a69ff3c11304", 
        "blockNumber"=>"0xddcb4d", 
        "data"=>"0xfc2a07bae9b75d5a817aa5ff752d263d213286dda48387a2e818814f4557d61200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000bd9dcfda5c60697039e2b3b28b079b00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000066eed0000000000000000000000000f14341a7f464320319025540e8fe48ad0fe5aec000000000000000000000000000000000000000000000000000000000000002b0000000000000000000000000000000000bd9dcfda5c60697039e2b3b28b079b00000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000", 
        "logIndex"=>"0xcd", 
        "removed"=>false, 
        "topics"=>[
          "0xa047cf3271a6e55d76e7706ca90d011a4f2f641f7c46dfd31f6abe4cd94db53f", 
          "0xf654c17ea89108d7183eaf31c762fe0c125d476aa8130938d8a1895307b7db5a"
        ], 
        "transactionHash"=>"0x215e05a6260a5fbca5ebf866bf8612868c50691e0ff24be54f96f8192ca9b968", 
        "transactionIndex"=>"0x8c", 
      }
@q9f q9f added the bug Something isn't working label Oct 18, 2023
@wuminzhe
Copy link
Contributor Author

wuminzhe commented Dec 4, 2023

https://github.com/wuminzhe/abi_coder_rb

I have an abi coder gem which passes the web3.js tests. @q9f or someone might be able to use it for abi de/encoding.

@q9f
Copy link
Owner

q9f commented Jun 23, 2024

#278

@q9f q9f closed this as completed Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants