hashgraph / hedera-sdk-rust

The Hedera™ Rust SDK
Apache License 2.0
43 stars 14 forks source link

Tests completed successfully without proper configuration #746

Closed Neurone closed 11 months ago

Neurone commented 11 months ago

Description

I set this as a bug because it's an unexpected behavior.

I'm able to complete all the tests without errors, even if I run those without a proper environment configuration - that is, I'm simply not following the instruction about setting all the TEST_* env variables, I just clone and run the tests.

❯ cargo test
warning: `&` without an explicit lifetime name cannot be used here
  --> src/ledger_id.rs:30:31
   |
30 |     pub(crate) const MAINNET: &Self = Self::new(&[0]);
   |                               ^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #115010 <https://github.com/rust-lang/rust/issues/115010>
note: the lint level is defined here
  --> src/lib.rs:28:5
   |
28 |     future_incompatible,
   |     ^^^^^^^^^^^^^^^^^^^
   = note: `#[warn(elided_lifetimes_in_associated_constant)]` implied by `#[warn(future_incompatible)]`
help: use the `'static` lifetime
   |
30 |     pub(crate) const MAINNET: &'static Self = Self::new(&[0]);
   |                                +++++++

warning: `&` without an explicit lifetime name cannot be used here
  --> src/ledger_id.rs:31:31
   |
31 |     pub(crate) const TESTNET: &Self = Self::new(&[1]);
   |                               ^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #115010 <https://github.com/rust-lang/rust/issues/115010>
help: use the `'static` lifetime
   |
31 |     pub(crate) const TESTNET: &'static Self = Self::new(&[1]);
   |                                +++++++

warning: `&` without an explicit lifetime name cannot be used here
  --> src/ledger_id.rs:32:34
   |
32 |     pub(crate) const PREVIEWNET: &Self = Self::new(&[2]);
   |                                  ^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #115010 <https://github.com/rust-lang/rust/issues/115010>
help: use the `'static` lifetime
   |
32 |     pub(crate) const PREVIEWNET: &'static Self = Self::new(&[2]);
   |                                   +++++++

warning: `hedera` (lib) generated 3 warnings (run `cargo fix --lib -p hedera` to apply 3 suggestions)
warning: `hedera` (lib test) generated 3 warnings (3 duplicates)
    Finished test [unoptimized + debuginfo] target(s) in 0.07s
     Running unittests src/lib.rs (target/debug/deps/hedera-b2a9b842a228b07a)

running 735 tests
[...]

test result: ok. 735 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.14s

     Running tests/e2e/main.rs (target/debug/deps/e2e-dd223305682e6984)

running 219 tests
[...]

test result: ok. 215 passed; 0 failed; 4 ignored; 0 measured; 0 filtered out; finished in 0.51s

   Doc-tests hedera

running 15 tests
[...]

test result: ok. 15 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.90s

Steps to reproduce

  1. clone the repo with --recursive option
  2. run cargo test
  3. all tests pass

Additional context

No response

Hedera network

other

Version

0.23.0

Operating system

None

Neurone commented 11 months ago

I just discovered a bug related to this. I sent a couple of PRs (#747, #750) to update the code and the docs.

RickyLB commented 11 months ago

@Neurone Thanks for catching these inconsistencies. Will give this a fix.