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

feat(ethabi, token): support nested tuples/arrays parsing #276

Merged
merged 3 commits into from
Aug 12, 2022

Conversation

shekhirin
Copy link
Contributor

@shekhirin shekhirin commented Aug 7, 2022

Before

ethabi git:(master) cargo run -- encode params -v '(bool,bool[])[]' '[(true,[false,true])]'
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/ethabi encode params -v '(bool,bool[])[]' '[(true,[false,true])]'`
Error: Invalid dataethabi git:(master) cargo run -- encode params -v '(bool,bool[])' '(true,[false,true])' 
    Finished dev [unoptimized + debuginfo] target(s) in 0.11s
     Running `target/debug/ethabi encode params -v '(bool,bool[])' '(true,[false,true])'`
Error: Invalid data

After

ethabi git:(parse-tuples-arrays) cargo run -- encode params -v '(bool,bool[])[]' '[(true,[false,true])]'
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/ethabi encode params -v '(bool,bool[])[]' '[(true,[false,true])]'`
00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ethabi git:(parse-tuples-arrays) cargo run -- encode params -v '(bool,bool[])' '(true,[false,true])'
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/ethabi encode params -v '(bool,bool[])' '(true,[false,true])'`
000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001

@vkgnosis
Copy link
Member

vkgnosis commented Aug 8, 2022

CI fails because of cargo-fmt. I'm not familiar with this code (and I don't think anyone of the maintainers still is) but the test case makes sense to me and the change looks fine at a glance.

@shekhirin
Copy link
Contributor Author

@nlordell hello sir, can I get your review on this PR?

@vkgnosis vkgnosis merged commit bb3f430 into rust-ethereum:master Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants