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

undefined method `decode_tuple' #141

Closed
rjurado01 opened this issue Mar 10, 2020 · 2 comments
Closed

undefined method `decode_tuple' #141

rjurado01 opened this issue Mar 10, 2020 · 2 comments
Assignees
Labels

Comments

@rjurado01
Copy link
Contributor

rjurado01 commented Mar 10, 2020

Steps to reproduce

I have this contract:

pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;

contract Tickets {
  struct Ticket {
    uint id;
    int val;
  }

  Ticket[] tickets;

  function addTicket(uint id, int val) public returns(bool success) {
    Ticket memory newTicket;
    newTicket.id = id;
    newTicket.val = val;
    tickets.push(newTicket);

    return true;
  }

  function getTicket(uint id) public view returns(Ticket memory) {
    uint index;

    for(uint i = 0; i<tickets.length; i++){
      if (tickets[i].id == id) {
        index = i;
        break;
      }
    }

    Ticket memory t = tickets[index];

    return t;
  }

When I call getTicket method using this gem:

contract.call.get_ticket(1)

It throw this error:

/ruby/2.5.0/lib/ruby/gems/2.5.0/gems/ethereum.rb-2.4/lib/ethereum/decoder.rb:14:in `decode': undefined method `decode_tuple' for #<Ethereum::Decoder:0x00000000023f78a0> (NoMethodError)

Then same happens when try to send a tuple:

/ruby/2.5.0/lib/ruby/gems/2.5.0/gems/ethereum.rb-2.4/lib/ethereum/encoder.rb:14:in `encode': undefined method `encode_tuple' for #<Ethereum::Encoder:0x000000000402ad38> (NoMethodError)

System configuration

Ruby version: 2.5.0
Solc version: 0.6.2
OS: ubuntu 18.04

@anonymousplz
Copy link

@kurotaky
Copy link
Collaborator

@rjurado01
Thanks for the issue. Please migrate as we will maintain the eth.rb library here. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants