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

Compilation errors #77

Open
jo-es opened this issue Dec 19, 2024 · 7 comments
Open

Compilation errors #77

jo-es opened this issue Dec 19, 2024 · 7 comments

Comments

@jo-es
Copy link

jo-es commented Dec 19, 2024

I'm getting the following compilation errors after generating bindings with Cainome.
Cainome: v0.4.2

error[E0277]: the trait bound `<A as ConnectedAccount>::Provider: starknet_providers::provider::Provider` is not satisfied
    --> src/bindings/x.rs:1373:56
     |
1373 |         cainome::cairo_serde::call::FCall::new(__call, self.provider())
     |         --------------------------------------         ^^^^^^^^^^^^^^^ the trait `starknet_providers::provider::Provider` is not implemented for `<A as ConnectedAccount>::Provider`
     |         |
     |         required by a bound introduced by this call
     |
note: required by a bound in `FCall::<'p, P, T>::new`
    --> /Users/johannes/.cargo/git/checkouts/cainome-971a2d0b3a80c185/4e3924f/crates/cairo-serde/src/call.rs:17:8
     |
17   |     P: starknet::providers::Provider + Sync,
     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `FCall::<'p, P, T>::new`
...
20   |     pub fn new(call_raw: FunctionCall, provider: &'p P) -> Self {
     |            --- required by a bound in this associated function
help: consider further restricting the associated type
     |
1365 |     ) -> cainome::cairo_serde::call::FCall<A::Provider, bool> where <A as ConnectedAccount>::Provider: starknet_providers::provider::Provider {
     |                                                               +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0308]: mismatched types
    --> src/bindings/x.rs:1373:48
     |
1373 |         cainome::cairo_serde::call::FCall::new(__call, self.provider())
     |         -------------------------------------- ^^^^^^ expected `starknet_core::types::codegen::FunctionCall`, found `FunctionCall`
     |         |
     |         arguments to this function are incorrect
     |
     = note: `FunctionCall` and `starknet_core::types::codegen::FunctionCall` have similar names, but are actually distinct types
@glihm
Copy link
Collaborator

glihm commented Dec 23, 2024

I'm getting the following compilation errors after generating bindings with Cainome.

Cainome: v0.4.2


error[E0277]: the trait bound `<A as ConnectedAccount>::Provider: starknet_providers::provider::Provider` is not satisfied

    --> src/bindings/x.rs:1373:56

     |

1373 |         cainome::cairo_serde::call::FCall::new(__call, self.provider())

     |         --------------------------------------         ^^^^^^^^^^^^^^^ the trait `starknet_providers::provider::Provider` is not implemented for `<A as ConnectedAccount>::Provider`

     |         |

     |         required by a bound introduced by this call

     |

note: required by a bound in `FCall::<'p, P, T>::new`

    --> /Users/johannes/.cargo/git/checkouts/cainome-971a2d0b3a80c185/4e3924f/crates/cairo-serde/src/call.rs:17:8

     |

17   |     P: starknet::providers::Provider + Sync,

     |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `FCall::<'p, P, T>::new`

...

20   |     pub fn new(call_raw: FunctionCall, provider: &'p P) -> Self {

     |            --- required by a bound in this associated function

help: consider further restricting the associated type

     |

1365 |     ) -> cainome::cairo_serde::call::FCall<A::Provider, bool> where <A as ConnectedAccount>::Provider: starknet_providers::provider::Provider {

     |                                                               +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



error[E0308]: mismatched types

    --> src/bindings/x.rs:1373:48

     |

1373 |         cainome::cairo_serde::call::FCall::new(__call, self.provider())

     |         -------------------------------------- ^^^^^^ expected `starknet_core::types::codegen::FunctionCall`, found `FunctionCall`

     |         |

     |         arguments to this function are incorrect

     |

     = note: `FunctionCall` and `starknet_core::types::codegen::FunctionCall` have similar names, but are actually distinct types

Thank you for the issue @jo-es! Would you have the ABI used to generate this error? Could be helpful to reproduce.

@glihm
Copy link
Collaborator

glihm commented Dec 23, 2024

Or if you are using cainome in an other program in rust, could you share a bit more? Thanks!

@jo-es
Copy link
Author

jo-es commented Dec 24, 2024

Hey! This is the contract.
contract class: https://gist.github.com/jo-es/cf921c162f8dc1748851e52e450a2cbd
compiled contract class: https://gist.github.com/jo-es/3b3faac2333657075e22ba010ae94394
It was compiled with Cairo v2.6.3

@glihm
Copy link
Collaborator

glihm commented Jan 1, 2025

@jo-es would you have some rust code you're using, or it's simply using the abigen! macro?

@glihm
Copy link
Collaborator

glihm commented Jan 1, 2025

Seems to have other issues I'll check on the cainome side. In the meantime, using Abigen seems to work on your class, would you mind give it a try? Or it's already what you are doing?

@glihm
Copy link
Collaborator

glihm commented Jan 28, 2025

@jo-es I didn't get back to this lately, did you have any update on using Abigen instead?

@jo-es
Copy link
Author

jo-es commented Jan 29, 2025

Hey! We are running it like this.

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