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

Support for Type Alias #103

Closed
pscott opened this issue May 5, 2022 · 2 comments · Fixed by #128
Closed

Support for Type Alias #103

pscott opened this issue May 5, 2022 · 2 comments · Fixed by #128
Assignees
Labels
bug Something isn't working

Comments

@pscott
Copy link
Contributor

pscott commented May 5, 2022

Cairo-lang 0.8.0 added Type Aliases but it looks like this plugin does not allow one to actually use them :(

Here's a code example that uses it. Try running it, you should have

HardhatPluginError: Expected address to be a tuple

https://gist.github.com/pscott/5ac165dd35cd0a4ef55cddf77dda4d05

The way I would expect to call a type alias is this way:

// Assuming we have `using Foo = (bar: felt, zoro: felt)`, then in ts I would expect
[{bar: 1}, {zoro: 2}]

But this is just an idea, might not be the best way to call use it :)

@FabijanC
Copy link
Collaborator

FabijanC commented May 6, 2022

You are right, it is not supported. However the error I'm getting is:

HardhatPluginError: Type address : felt not present in ABI.

@FabijanC FabijanC added the bug Something isn't working label May 6, 2022
@pscott
Copy link
Contributor Author

pscott commented May 6, 2022

You are right, it is not supported. However the error I'm getting is:

HardhatPluginError: Type address : felt not present in ABI.

Yeah I think it depends on what syntax you're using. I think the "expected address to be a tuple" happens whem I call it with

greeting.invoke(type_alias, {
  address: {1}
}

But I'm not sure exactly. I tried many different syntaxes because I thought maybe I was just using the wrong syntax :)
I think first we'd need to define which syntax we want to use! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants