Skip to content

Commit

Permalink
conditionally enable xyk extrinscs
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszaaa committed Apr 19, 2022
1 parent 2d584d9 commit 5d84273
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ jobs:
uses: docker/build-push-action@v2
with:
file: "devops/dockerfiles/node/Dockerfile"
build-args:
- CARGO_FEATURES=enable-trading
push: false
tags: mangatasolutions/mangata-node:latest,mangatasolutions/mangata-node:${{ github.sha }}
outputs: type=docker,dest=/tmp/${{ github.sha }}.tar
Expand Down
3 changes: 2 additions & 1 deletion devops/dockerfiles/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ENV MEMORY_PROFILER_OUTPUT=profiling_%e_%t.dat
ENV MEMORY_PROFILER_CULL_TEMPORARY_ALLOCATIONS=1
ENV MEMORY_PROFILER_LOG=info
ENV MEMORY_PROFILER_LOGFILE=profiling_%e_%t.log
ARG CARGO_FEATURES=""


ENV ETH_APP_ID=0xdd514baa317bf095ddba2c0a847765feb389c6a0
Expand All @@ -29,7 +30,7 @@ RUN cp /mangata/memory_profiler/memory-profiler/target/release/libbytehound.so /
RUN cp /mangata/memory_profiler/memory-profiler/target/release/bytehound /mangata/


RUN cargo build --release
RUN cargo build --release --features=${CARGO_FEATURES}

FROM debian:stretch
ENV DOCKERIZE_VERSION v0.6.1
Expand Down
2 changes: 2 additions & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ disable-execution = [
"frame-executive/disable-execution",
]

enable-trading = []

runtime-benchmarks = [
"hex-literal",
"sp-runtime/runtime-benchmarks",
Expand Down
9 changes: 9 additions & 0 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ parameter_types! {
}

pub struct MangataCallFilter;

#[cfg(not(feature = "enable-trading"))]
impl Contains<Call> for MangataCallFilter {
fn contains(call: &Call) -> bool {
match call {
Expand All @@ -359,6 +361,13 @@ impl Contains<Call> for MangataCallFilter {
}
}

#[cfg(feature = "enable-trading")]
impl Contains<Call> for MangataCallFilter {
fn contains(_call: &Call) -> bool {
true
}
}

// Configure FRAME pallets to include in runtime.

impl frame_system::Config for Runtime {
Expand Down

0 comments on commit 5d84273

Please # to comment.