exthereum / abi

The Ethereum ABI Interface
MIT License
20 stars 22 forks source link

Unable to decode int #25

Open hswick opened 6 years ago

hswick commented 6 years ago

Receiving this error when I try to output an int from a contract method:

** (RuntimeError) Unsupported decoding type: {:int, 256}
    lib/abi/type_decoder.ex:241: ABI.TypeDecoder.decode_type/2
    lib/abi/type_decoder.ex:219: anonymous fn/2 in ABI.TypeDecoder.decode_type/2

Here is a contract method that I'm failing on:

    function getInt() public pure returns (int) {                                                                                                                      
        return (40 - 100);                                                                                                                                             
    }
hayesgm commented 6 years ago

@hswick We don't currently support signed integers. I'm sure it'd be easy to add, let me know how important this is for you. Also note: we're slowly deprecating this library in favor of https://github.com/exthereum/ethereum, which contains the ABI library in it.

hswick commented 6 years ago

Hi @hayesgm thanks for the reply! My goal with ExW3 is to make it feature parity with web3.js, so thats my main desire for integers. Was working on a side project and noticed this feature was missing.

Happy to move to the ethereum repo. Should I be raising issues there from now on? Also, is the abi package going to be available from hex separately from the ethereum package?

dingpl716 commented 6 years ago

@hayesgm I would be nice if you add this feature, I also depend on it.

ghbutton commented 5 years ago

@hayesgm The project you linked to is being deprecated in favor of this one which doesn't seem to have an abi library. Does that mean that this one will continue to move forward?

hayesgm commented 5 years ago

I guess you're right that ABI didn't get included in the Exthereum/Mana merge. Sure thing, I'll get these PRs reviewed and mainlined. Sorry for the delay!

ghbutton commented 5 years ago

It is alright, just trying to understand the state of things

ghbutton commented 5 years ago

Thank you for maintaining this library