Git Product home page Git Product logo

Comments (4)

dvdplm avatar dvdplm commented on August 15, 2024

Can you point me to a specific place and I'll sleuth further?

from parity-common.

kavu avatar kavu commented on August 15, 2024

Sorry for jumping in.

I tried to run cargo test on current master branch (bbe809d) and could not. After that I fixed one failing test:

diff --git a/fixed-hash/src/hash.rs b/fixed-hash/src/hash.rs
index da7bdc7..c8aa06a 100644
--- a/fixed-hash/src/hash.rs
+++ b/fixed-hash/src/hash.rs
@@ -677,6 +677,7 @@ mod tests {
                assert!(r == u)
        }

+ #[cfg(feature = "uint_conversions")]
        #[test]
        #[should_panic]
        fn converting_differently_sized_types_panics() {
@@ -684,4 +685,4 @@ mod tests {

                impl_hash_uint_conversions!(H256, U512);
        }
-}
\ No newline at end of file
+}

After that I tests can run again, but as @debris stated there are a lot of errors, e.g in fixed-hash:

   Compiling fixed-hash v0.2.3 (file:///Users/kavu/Work/parity-common/fixed-hash)
error[E0277]: the trait bound `hash::tests::H160: core::convert::From<&str>` is not satisfied
   --> fixed-hash/src/hash.rs:640:66
    |
640 |         let address: H160 = "ef2d6d194084c2de36e0dabfce45d046b37d1106".into();
    |                                                                        ^^^^ the trait `core::convert::From<&str>` is not implemented for `hash::tests::H160`
    |
    = help: the following implementations were found:
              <hash::tests::H160 as core::convert::From<&'a [u8]>>
              <hash::tests::H160 as core::convert::From<[u8; 20]>>
              <hash::tests::H160 as core::convert::From<hash::tests::H256>>
              <hash::tests::H160 as core::convert::From<u64>>
    = note: required because of the requirements on the impl of `core::convert::Into<hash::tests::H160>` for `&str`

error[E0599]: no function or associated item named `from_str` found for type `hash::tests::H128` in the current scope
   --> fixed-hash/src/hash.rs:650:46
    |
28  |         pub struct $from (pub [u8; $size]);
    |         ----------------------------------- function or associated item `from_str` not found for this
...
650 |         assert_eq!(H128::from(0x1234567890abcdef), H128::from_str("00000000000000001234567890abcdef").unwrap());
    |                                                    ^^^^^^^^^^^^^^ function or associated item not found in `hash::tests::H128`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following trait defines an item `from_str`, perhaps you need to implement it:
            candidate #1: `core::str::FromStr`

Or uint:

error[E0277]: `uint::U256` doesn't implement `std::fmt::Debug`
   --> uint/tests/uint_tests.rs:826:2
    |
826 |     assert_eq!(U256([0, 0, 0, u64::max_value()]), result);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `uint::U256` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
    |
    = help: the trait `std::fmt::Debug` is not implemented for `uint::U256`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&uint::U256`
    = note: required by `std::fmt::Debug::fmt`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0277]: the trait bound `uint::U256: std::convert::From<&str>` is not satisfied
   --> uint/tests/uint_tests.rs:828:84
    |
828 |     let x1: U256 = "0000000000000000000000000000000000000000000000000000012365124623".into();
    |                                                                                       ^^^^ the trait `std::convert::From<&str>` is not implemented for `uint::U256`
    |
    = help: the following implementations were found:
              <uint::U256 as std::convert::From<[u8; 32]>>
              <uint::U256 as std::convert::From<u32>>
              <uint::U256 as std::convert::From<u64>>
              <uint::U256 as std::convert::From<usize>>
            and 10 others
    = note: required because of the requirements on the impl of `std::convert::Into<uint::U256>` for `&str`

Hope that helps!

from parity-common.

dvdplm avatar dvdplm commented on August 15, 2024

@kavu you need to run the fixed-hash tests like so: cargo test --features=std,heapsizeof,uint_conversions (see .travis.yml for the uint tests).

That said, I noticed the missing #[cfg(feature = "uint_conversions")] too. Will fix.

UPDATE: what @debris is referring to is most probably something else than the tests here, likely he's compiling code that uses different versions of ethereum-types.

from parity-common.

debris avatar debris commented on August 15, 2024

UPDATE: what @debris is referring to is most probably something else than the tests here, likely he's compiling code that uses different versions of ethereum-types.

Yes, this were just different versions. Closing now

from parity-common.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.