Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

json-tests: Fix compile error #11384

Merged
merged 1 commit into from
Jan 16, 2020
Merged

Conversation

ackintosh
Copy link
Contributor

I got the compile error when I run the tests:

$ pwd
/Users/akihito1/src/github.com/ackintosh/parity-ethereum/ethcore

$ cargo test --features=json-tests
   Compiling ethcore v1.12.0 (/Users/akihito1/src/github.com/ackintosh/parity-ethereum/ethcore)
error[E0277]: the trait bound `types::transaction::SignedTransaction: std::convert::From<ethjson::transaction::Transaction>` is not satisfied
  --> ethcore/src/json_tests/state.rs:78:83
   |
78 |                     let transaction: SignedTransaction = multitransaction.select(&state.indexes).into();
   |                                                                                                  ^^^^ the trait `std::convert::From<ethjson::transaction::Transaction>` is not implemented for `types::transaction::SignedTransaction`
   |
   = note: required because of the requirements on the impl of `std::convert::Into<types::transaction::SignedTransaction>` for `ethjson::transaction::Transaction`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `ethcore`.
warning: build failed, waiting for other jobs to finish...
error[E0277]: the trait bound `types::transaction::SignedTransaction: std::convert::From<ethjson::transaction::Transaction>` is not satisfied
  --> ethcore/src/json_tests/state.rs:78:83
   |
78 |                     let transaction: SignedTransaction = multitransaction.select(&state.indexes).into();
   |                                                                                                  ^^^^ the trait `std::convert::From<ethjson::transaction::Transaction>` is not implemented for `types::transaction::SignedTransaction`
   |
   = note: required because of the requirements on the impl of `std::convert::Into<types::transaction::SignedTransaction>` for `ethjson::transaction::Transaction`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `ethcore`.

To learn more, run the command again with --verbose.

The error is due to the PR that adding cfg to the From trait.
#11335

@parity-cla-bot
Copy link

It looks like @ackintosh signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

Copy link
Collaborator

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much! :)

@dvdplm dvdplm requested a review from s3krit January 16, 2020 07:43
@dvdplm dvdplm added B0-patch-stable 🕷 Pull request should also be back-ported to the stable branch. B1-patch-beta 🕷🕷 F4-tests 💻 Tests need fixing, improving or augmenting. labels Jan 16, 2020
@dvdplm dvdplm merged commit d3b4898 into openethereum:master Jan 16, 2020
@niklasad1
Copy link
Collaborator

niklasad1 commented Jan 16, 2020

@dvdplm @s3krit

Has this not been detected because we run cargo test --features json-tests --all in the CI?

(I think all default features gets enabled by --all and that's why it has worked in the CI)

@dvdplm
Copy link
Collaborator

dvdplm commented Jan 16, 2020

Has this not been detected because we run cargo test --features json-tests --all in the CI?

Yes, must be that. Cargo features are sneaky.

@dvdplm
Copy link
Collaborator

dvdplm commented Jan 16, 2020

(I think all default features gets enabled by --all and that's why it has worked in the CI)

Hmm, I think it's because features are additive and so if one crate in the tree enables the feature, it's enabled for all.

@ordian ordian added this to the 2.7 milestone Jan 16, 2020
@ordian ordian added the A8-looksgood 🦄 Pull request is reviewed well. label Jan 16, 2020
@ordian
Copy link
Collaborator

ordian commented Jan 16, 2020

@ackintosh thanks!

@dvdplm I don't think it warrants a backport though?

@ackintosh ackintosh deleted the fix-compile-error branch January 17, 2020 01:35
s3krit pushed a commit that referenced this pull request Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. B0-patch-stable 🕷 Pull request should also be back-ported to the stable branch. F4-tests 💻 Tests need fixing, improving or augmenting.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants