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

compose_call function doesn't declare a return Type #363

Open
tjwilliams-bell-labs opened this issue Nov 17, 2023 · 1 comment
Open

compose_call function doesn't declare a return Type #363

tjwilliams-bell-labs opened this issue Nov 17, 2023 · 1 comment

Comments

@tjwilliams-bell-labs
Copy link

Following the example code in the "Quick Usage" section of the README.md to create a call using the "compose_call()" function then passing the result to the "call" parameter for "create_signed_extrinsic()" I get a warning from Pylance (Vs Code IDE) that the "call" parameter is expecting a type "GenericCall" and getting a type. of "ScaleType | Unknown". The "compose_call()" does not have a return type declared for the function, so it is using the "ScaleType | Unknown" which is what it appears to be getting internally from the "call.encode()" in the function.

The docstring for the function says the return for the "compose_call()" is a GenericCall (which I was expecting) but the actual function signature does not specify a return type.

@arjanz
Copy link
Member

arjanz commented Nov 20, 2023

I see the type hinting is indeed missing for that function, thanks for pointing this out.

The warning is probably because the inferred type hinting is not clear because of the factory method used here. If you would debug there, you would see that the type returned is indeed a sub-class of GenericCall.

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

No branches or pull requests

2 participants