From 5d456e329c2554600fcb3854246f94382449b0de Mon Sep 17 00:00:00 2001 From: Adel Golghalyani <48685760+Ad96el@users.noreply.github.com> Date: Thu, 22 Feb 2024 14:04:17 +0100 Subject: [PATCH] cargo toml (#15) --- Cargo.toml | 5 +++-- Dockerfile | 3 ++- src/kilt/mod.rs | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 33ccd92..3aed716 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,14 +49,15 @@ tokio = {version = "1", features = ["full"]} uuid = {version = "1.4.1", features = ["v4", "serde"]} [features] -default = [] +peregrine = [] spiritnet = [] [[bin]] -features = ["spiritnet"] name = "attester_spiritnet" path = "src/main.rs" +required-features = ["spiritnet"] [[bin]] name = "attester_peregrine" path = "src/main.rs" +required-features = ["peregrine"] diff --git a/Dockerfile b/Dockerfile index 605caa4..86a565c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,8 @@ WORKDIR /app COPY . /app/ # Build backend -RUN cargo build --release --bins +RUN cargo build --release --features=peregrine --bin=attester_peregrine +RUN cargo build --release --features=spiritnet --bin=attester_spiritnet # Final Stage FROM rust:slim-buster diff --git a/src/kilt/mod.rs b/src/kilt/mod.rs index 6ae0569..439ab26 100644 --- a/src/kilt/mod.rs +++ b/src/kilt/mod.rs @@ -23,11 +23,11 @@ pub mod runtime {} #[cfg(feature = "spiritnet")] pub type RuntimeCall = runtime::runtime_types::spiritnet_runtime::RuntimeCall; -#[cfg(not(feature = "spiritnet"))] +#[cfg(feature = "peregrine")] #[subxt::subxt(runtime_metadata_path = "metadata_peregrine_11210.scale")] pub mod runtime {} -#[cfg(not(feature = "spiritnet"))] +#[cfg(feature = "peregrine")] pub type RuntimeCall = runtime::runtime_types::peregrine_runtime::RuntimeCall; #[derive(Clone, Debug, Default, Eq, PartialEq)]