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

Handle type aliases #5

Open
niran opened this issue Jan 19, 2016 · 7 comments
Open

Handle type aliases #5

niran opened this issue Jan 19, 2016 · 7 comments

Comments

@niran
Copy link

niran commented Jan 19, 2016

I copied types over from my contract and ran into an error when it tried to parse lengths that were missing. The workaround is easy, but it'd be nice if it were safe to copy the types from the contract.

@axic
Copy link
Member

axic commented Jan 19, 2016

Sorry @niran I am not sure exactly which types this is an issue with? Would you mind posting some examples?

@niran
Copy link
Author

niran commented Jan 21, 2016

uint and int are aliases for uint256 and int256. byte is an alias for bytes1.

https://solidity.readthedocs.org/en/latest/types.html

@axic
Copy link
Member

axic commented Jan 21, 2016

@niran those aliases are implemented. Where are you getting an error?

@axic
Copy link
Member

axic commented Jan 21, 2016

@niran apparently byte is a new addition as hence it is not included. It needs to go into the ABI first, but happy to support it after.

@niran
Copy link
Author

niran commented Jan 21, 2016

uint failed for me here if I recall correctly: https://github.com/axic/ethereumjs-abi/blob/master/lib/index.js#L78

It tries to parse the size, but there isn't one.

@axic
Copy link
Member

axic commented Jan 22, 2016

@niran the translation is done earlier: https://github.com/axic/ethereumjs-abi/blob/master/lib/index.js#L178 and https://github.com/axic/ethereumjs-abi/blob/master/lib/index.js#L217

It should be (u)int256 by the time it gets into the single item encoding

@holgerd77
Copy link
Member

What's the status of this, is this a bug or was this wrong use of the API?

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

No branches or pull requests

3 participants