Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unnecessary configs
  • Loading branch information
pmikolajczyk41 committed Jun 30, 2023
commit eeeb7f1ef340737ec66c0ca74a3c80d218885efc
4 changes: 2 additions & 2 deletions crates/e2e/macro/src/codegen.rs
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.

Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl InkE2ETest {

let run = async {
// spawn a contracts node process just for this test
let node_proc = ::ink_e2e::TestNodeProcess::<::ink_e2e::PolkadotConfig>
let node_proc = ::ink_e2e::TestNodeProcess::<::subxt::PolkadotConfig>
::build(#contracts_node)
.spawn()
.await
Expand All @@ -160,7 +160,7 @@ impl InkE2ETest {
);

let mut client = ::ink_e2e::Client::<
::ink_e2e::PolkadotConfig,
::subxt::PolkadotConfig,
#environment
>::new(
node_proc.client(),
Expand Down
26 changes: 0 additions & 26 deletions crates/e2e/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,32 +61,6 @@ use std::{
};
use xts::ContractsApi;

/// Default set of commonly used types by Substrate runtimes.
#[cfg(feature = "std")]
pub enum SubstrateConfig {}

#[cfg(feature = "std")]
impl subxt::Config for SubstrateConfig {
type Index = u32;
type Hash = sp_core::H256;
type Hasher = subxt::config::substrate::BlakeTwo256;
type AccountId = subxt::config::substrate::AccountId32;
type Address = sp_runtime::MultiAddress<Self::AccountId, u32>;
type Header = subxt::config::substrate::SubstrateHeader<
u32,
subxt::config::substrate::BlakeTwo256,
>;
type Signature = sp_runtime::MultiSignature;
type ExtrinsicParams = subxt::config::substrate::SubstrateExtrinsicParams<Self>;
}

/// Default set of commonly used types by Polkadot nodes.
#[cfg(feature = "std")]
pub type PolkadotConfig = subxt::config::WithExtrinsicParams<
SubstrateConfig,
subxt::config::polkadot::PolkadotExtrinsicParams<SubstrateConfig>,
>;

/// Signer that is used throughout the E2E testing.
///
/// The E2E testing can only be used with nodes that support `sr25519`
Expand Down