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

Minor refactors in e2e crate #1830

Merged
merged 8 commits into from
Jul 3, 2023

Conversation

pmikolajczyk41
Copy link
Member

@pmikolajczyk41 pmikolajczyk41 commented Jun 30, 2023

  1. E2EConfig doesn't need whitelisted_attributes (copied from another macro config)
  2. We can reuse subxt Polkadot configuration

@pmikolajczyk41 pmikolajczyk41 marked this pull request as ready for review June 30, 2023 13:17
@pmikolajczyk41
Copy link
Member Author

I'm getting:

error: cannot find macro `assert_eq` in this scope
 --> tests/ui/trait_def/pass/no-implicit-prelude.rs:4:1
  |
4 | pub trait TraitDefinition {
  | ^^^ help: a macro with a similar name exists: `assert`
  |
 ::: $RUST/core/src/macros/mod.rs
  |
  |     macro_rules! assert {
  |     ------------------- similarly named macro `assert` defined here
  |
  = help: consider importing one of these items:
          std::assert_eq
          core::assert_eq
  = note: this error originates in the derive macro `::scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0425]: cannot find function, tuple struct or tuple variant `Ok` in this scope
 --> tests/ui/trait_def/pass/no-implicit-prelude.rs:4:1
  |
4 | pub trait TraitDefinition {
  | ^^^ not found in this scope
  |
  = note: this error originates in the derive macro `::scale::Decode` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
  |
3 | use core::result::Result::Ok;
  |
3 | use std::result::Result::Ok;

on tests/ui/trait_def/pass/no-implicit-prelude.rs which should compile nicely...

@pmikolajczyk41
Copy link
Member Author

the same error is for the master build: https://gitlab.parity.io/parity/mirrors/ink/-/jobs/3105158

@ascjones
Copy link
Collaborator

ascjones commented Jul 3, 2023

the same error is for the master build: https://gitlab.parity.io/parity/mirrors/ink/-/jobs/3105158

It must be in the codegen of the new parity-scale-codec

crates/e2e/src/lib.rs Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

The building of the contracts at the codegen stage is a legacy of when we required the metadata to generate the contract API. So I wonder whether we should just move the code which builds the contracts to be invoked at runtime rather than in the macro code, which is confusing.

for manifest_path in contracts_to_build_and_import {
already_built_contracts
.entry(manifest_path.clone())
.or_insert_with(|| build_contract(&manifest_path));
Copy link
Collaborator

Choose a reason for hiding this comment

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

For tests running all in parallel, this might now result in all tests initially attempting to build the root contract simultaneously. I assume they would all just block on the lockfile while the first one builds, which is okay but negates the point of having the already_built_contracts. This mechanism itself might now be unnecessary since the build now is very fast when there have been no changes so we might even be able to remove this entirely.

@ascjones ascjones merged commit 9fcfc46 into use-ink:master Jul 3, 2023
@pmikolajczyk41 pmikolajczyk41 deleted the pmikolajczyk41/clean-up-e2e branch July 3, 2023 12:35
@SkymanOne SkymanOne mentioned this pull request Mar 4, 2024
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

Successfully merging this pull request may close these issues.

2 participants