launchbadge / hedera-sdk-rust-archived

Hedera SDK for Rust
https://www.hedera.com
Apache License 2.0
41 stars 14 forks source link

Errors compiling create_account.rs #59

Closed atozen closed 5 years ago

atozen commented 5 years ago

Hi, again this may be my lack of experience with Rust but I am stuck on these 2 errors.

error[E0433]: failed to resolve: use of undeclared type or module pretty_env_logger --> src/main.rs:9:5 | 9 | pretty_env_logger::try_init()?; | ^^^^^^^^^^^^^^^^^ use of undeclared type or module pretty_env_logger

error[E0277]: the trait bound failure::error::Error: std::error::Error is not satisfied --> src/main.rs:19:20 19 let operator = "0:0:1002".parse()?; ^^^^^^^^^^^^^^^^^^^ the trait std::error::Error is not implemented for failure::error::Error

= note: required because of the requirements on the impl of failure::Fail for failure::error::Error = note: required because of the requirements on the impl of std::convert::From<failure::error::Error> for failure::error::Error = note: required by std::convert::From::from

error: aborting due to 2 previous errors

Some errors occurred: E0277, E0433. For more information about an error, try rustc --explain E0277. error: Could not compile createaccount.

atozen commented 5 years ago

Solved? the first error had to add the following to lines to toml file

log = "0.4" pretty_env_logger = "0.3"

I think the second error error[E0277]: the trait bound failure::error::Error: std::error::Error is not satisfied may have a solution involving another function from failure?

fn compat(self) -> Compat where Self: Sized, [−] Wraps this failure in a compatibility wrapper that implements std::error::Error. This allows failures to be compatible with older crates that expect types that implement the Error trait from std::error.

Will investigate further later

QuestofIranon commented 5 years ago

What version of rust are you using?

rustc --version

atozen commented 5 years ago

rustc 1.33.0-nightly (d22fa2d87 2019-01-08)

QuestofIranon commented 5 years ago

How are you trying to build the example?

You can build examples from the root of the sdk using

cargo build --example create_account

alternatively replace build with run to run it.

Check the cargo guide for more information https://doc.rust-lang.org/cargo/index.html

atozen commented 5 years ago

Thanks compiled and run using that method.

Returned public and private keys as well as following error message error: environment variable not found

Will investigate later have house repair work to do now - I have realised what some issues are. Will report back later

atozen commented 5 years ago

All working fine - creating accounts :)

My understanding of cargo and rust seems to be on a gradual increase.

Thanks for the assistance.