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

Add precise information about mismatch in struct constructor to data transformer #2549

Open
integraledelebesgue opened this issue Oct 2, 2024 · 0 comments

Comments

@integraledelebesgue
Copy link
Member

Component the issue is related to

Cast - data transformer

Issue

At the moment, data transformer returns quite undescriptive error message when processing struct constructor invocation.
Suppose we have a struct:

struct MyStruct { a: felt252, b: felt252 }

When we pass wrong invocation to data transformer, for example:

sncast [...] --calldata "MyStruct { a: 0x2137 }"

or

sncast [...] --calldata "MyStruct { some_other_field: 0x2137, b: 0x420 }"

We get an error:

Error: Arguments in constructor invocation for struct MyStruct do not match struct arguments in ABI

A nice quality-of-life feature would be to display an exact mismatch.

Exaple output:

Error: Arguments in constructor invocation for struct MyStruct do not match struct arguments in ABI:
- a: felt252
+ some_other_field: felt252
| b: felt252
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

1 participant