ABI interface fixes#1842
Merged
fubuloubu merged 5 commits intoFeb 10, 2020
Merged
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 |
Contributor
Author
|
@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 |
fubuloubu
reviewed
Feb 6, 2020
fubuloubu
left a comment
Contributor
There was a problem hiding this comment.
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.
fubuloubu
approved these changes
Feb 6, 2020
Contributor
Author
|
note to self, need to open another issue re: structs in json interfaces |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Fix issues with
bytes,stringandfixed168x10when importing an ABI as an interface. Fixes #1832How I did it
bytesandstring.fixed168x10fordecimalwhen converting ABI to AST.bytesandstringarrays, use a length of1024*1024in inputs,1in 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