-
-
Notifications
You must be signed in to change notification settings - Fork 793
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 interface fixes #1842
ABI interface fixes #1842
Conversation
dbf189b
to
c1b191d
Compare
c1b191d
to
186efc0
Compare
Excellent, does it also fix the same issue with structs which contain |
E.g. this: Z256: constant(uint256) = 0
struct A:
many: uint256[3]
one: uint256
@private
@constant
def foo(_many: uint256[3], _one: uint256) -> A:
a: A = A({many: [Z256, Z256, Z256], one: 0})
a.many = _many
a.one = _one
return a
@public
def bar():
m: uint256[3] = [Z256, Z256, Z256]
m[0] = 42
m[1] = 2020
m[2] = 21000000
out: A = foo(m, 33)
assert out.many[0] == m[0]
assert out.many[1] == m[1]
assert out.many[2] == m[2]
assert out.one == 33 |
@michwill good call, I'll have a look at that as well |
As far as I can tell, this PR doesn't fix it for structs, and probably the solution would be suitable for this PR, too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, not really a big fan of this approach, but if there's no better way to solve the problem, the least we can do is add more notes to the code about it.
note to self, need to open another issue re: structs in json interfaces |
What I did
Fix issues with
bytes
,string
andfixed168x10
when importing an ABI as an interface. Fixes #1832How I did it
bytes
andstring
.fixed168x10
fordecimal
when converting ABI to AST.bytes
andstring
arrays, use a length of1024*1024
in inputs,1
in outputs. The compiler does not implicitly truncate values so this does not create an issue when a limit is exceeded.How to verify it
Run the tests. I expanded the cases around ABIs as interfaces to check each type as an input and output.
Cute Animal Picture