Skip to content

Commit

Permalink
fix: revert only allowing compilation when features enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
apollo-sturdy committed Mar 7, 2024
1 parent a48c257 commit 7a8373d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Bump `locked-astroport-vault` and `locked-astroport-vault-test-helpers` to `0.4.2`.
- Bump `cw-vault-standard-test-helpers` to `0.4.1`.

### Added

- Added check that either `astroport` or `osmosis` features, or both, are enabled.

## [0.2.0] - 2023-11-06

### Changed
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ osmosis = ["cw-dex-osmosis"]
astroport = ["cw-dex-astroport"]
osmosis-test-tube = ["cw-it/osmosis-test-tube", "locked-astroport-vault-test-helpers/osmosis-test-tube"]


[package.metadata.optimizer]
builds = [
{ name = "astroport", features = ["astroport"] },
Expand Down
2 changes: 2 additions & 0 deletions src/deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ pub fn callback_provide_liquidity(
Pool::Astroport(pool) => to_json_binary(&pool)?,
#[cfg(feature = "osmosis")]
Pool::Osmosis(pool) => to_json_binary(&pool)?,
#[allow(unreachable_patterns)]
_ => panic!("Unsupported pool type"),
};

let provide_liquidity_msgs = liquidity_helper.balancing_provide_liquidity(
Expand Down
4 changes: 0 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@ pub mod state;
pub mod withdraw;

pub use crate::error::ContractError;

// Force selecting either `astroport` or `osmosis` features, or both.
#[cfg(not(any(feature = "astroport", feature = "osmosis")))]
compile_error!("Must select either `astroport` or `osmosis` feature, or both");
2 changes: 2 additions & 0 deletions src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ impl Deref for Pool {
Pool::Osmosis(pool) => pool as &dyn PoolTrait,
#[cfg(feature = "astroport")]
Pool::Astroport(pool) => pool as &dyn PoolTrait,
#[allow(unreachable_patterns)]
_ => unimplemented!("No pool implementation available"),
}
}
}
Expand Down

0 comments on commit 7a8373d

Please sign in to comment.