Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Handle type aliases #5

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

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants