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

Cannot use rust to invoke in3 because of an error "failed to resolve: use of undeclared type BlockNumber" #30

Closed
a3845 opened this issue Jan 17, 2021 · 3 comments

Comments

@a3845
Copy link

a3845 commented Jan 17, 2021

Steps to reproduce

I am trying to use the Ethereum contract call code here: https://in3.readthedocs.io/en/develop/api-rust.html#an-ethereum-contract-call

When I execute "cargo run" with the code above, I get an error.

Expected behavior

I expect cargo run to complete without an error.

Actual behavior

error[E0433]: failed to resolve: use of undeclared type BlockNumber
--> /home/foobar/rust/good.rs:22:42
|
22 | task::block_on(eth_api.call(txn, BlockNumber::Latest)).expect("ETH call failed");
| ^^^^^^^^^^^ use of undeclared type BlockNumber

I see no missing dependency error; I have seen Cargo throw errors for such things. I cannot use in3 0.0.2 instead of 0.1.7 because this unsolved bug: rust-lang/rust#80948
The problem is reproducible when I try to use in3 0.1.6.

System configuration

I have Rust 1.49 installed. I have Cargo 1.49 installed too.

Incubed version

0.1.7

Request

Incubed Configuration

Chain

@hu55a1n1
Copy link
Contributor

Thanks for the feedback! Can you try building the in3-example-rust project on your system? This way we can rule out the possibility of toolchain problems. Also, make sure to check out other requirements on in3-rs's crates.io page.

@a3845
Copy link
Author

a3845 commented Jan 17, 2021

in3-example-rust allowed me to run "cargo run".

@simon-jentzsch
Copy link
Contributor

I just updated the documentation and also 3 days ago the Version 0.1.8 was released. I think in your code you are just missing those imports:

use in3::eth1::*;

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

3 participants