Skip to content

Commit

Permalink
πŸ™…πŸ»β€β™‚οΈ Hide instantiator behind feature flag (#389)
Browse files Browse the repository at this point in the history
## What?
When on-chain-release-build feature is used, don't compile the instantiator

## Why?
Makes the runtime smaller

## Testing
- Successfully ran pallet tests, integration tests, benchmark tests, dry-run-benches, and srtool wasm
  • Loading branch information
JuaniRios authored Sep 10, 2024
1 parent 4f579d9 commit 182b4f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions pallets/funding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,4 @@ try-runtime = [
"polimec-common/try-runtime",
"sp-runtime/try-runtime",
]
on-chain-release-build = []
3 changes: 1 addition & 2 deletions pallets/funding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ pub mod mock;
#[cfg(test)]
pub mod tests;

// TODO: This is used only in tests. Should we use #[cfg(test)]?
// If we do that the integration-tests will complain about the missing `use` statement :(
#[cfg(not(feature = "on-chain-release-build"))]
pub mod instantiator;

#[cfg(feature = "runtime-benchmarks")]
Expand Down
2 changes: 1 addition & 1 deletion runtimes/polimec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,6 @@ try-runtime = [
# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = [ "sp-api/disable-logging" ]
on-chain-release-build = [ "sp-api/disable-logging", "pallet-funding/on-chain-release-build" ]

development-settings = [ "shared-configuration/development-settings" ]

0 comments on commit 182b4f4

Please sign in to comment.