Skip to content

Commit

Permalink
chore: added deployable interfaces to all ADOs (#620)
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
crnbarr93 and coderabbitai[bot] authored Nov 18, 2024
1 parent c7b020b commit e8d7176
Show file tree
Hide file tree
Showing 75 changed files with 546 additions and 25 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
sudo make version-map
make build
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: contracts
path: ./artifacts/
Expand All @@ -44,7 +44,7 @@ jobs:
- name: Build Deploy Script
run: cargo build -p andromeda-deploy --release
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: deploy
path: ./target/release/andromeda-deploy
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
chmod +x ./andromeda-deploy
./andromeda-deploy
- name: Upload Deployment Report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: deployment-report
path: ./deployment-reports/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
chmod +x "${GITHUB_WORKSPACE}/.github/file-size.sh"
"${GITHUB_WORKSPACE}/.github/file-size.sh"
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: contracts
path: ./artifacts/
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
chmod +x "${GITHUB_WORKSPACE}/scripts/build_schema.sh"
"${GITHUB_WORKSPACE}/scripts/build_schema.sh"
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: schema
path: ./schemas/
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added Kernel ICS20 Transfer with Optional ExecuteMsg [(#577)](https://github.com/andromedaprotocol/andromeda-core/pull/577)
- Added IBC Denom Wrap/Unwrap [(#579)](https://github.com/andromedaprotocol/andromeda-core/pull/579)
- Added deployment script/CI workflow for OS [(#616)](https://github.com/andromedaprotocol/andromeda-core/pull/616)
- Added deployable interfaces to all ADOs [(#620)](https://github.com/andromedaprotocol/andromeda-core/pull/620)

### Changed

Expand Down
36 changes: 36 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions contracts/app/andromeda-app-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum-repr = { workspace = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
cw-multi-test = { workspace = true, optional = true }
andromeda-testing = { workspace = true, optional = true }
cw-orch = { workspace = true }


[features]
Expand Down
6 changes: 6 additions & 0 deletions contracts/app/andromeda-app-contract/src/interface.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use andromeda_app::app::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata};

pub const CONTRACT_ID: &str = "app-contract";

contract_interface!(AppContract, CONTRACT_ID, "andromeda_app_contract.wasm");
5 changes: 5 additions & 0 deletions contracts/app/andromeda-app-contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ pub mod testing;
mod execute;
mod query;
mod reply;

#[cfg(not(target_arch = "wasm32"))]
mod interface;
#[cfg(not(target_arch = "wasm32"))]
pub use crate::interface::AppContract;
1 change: 1 addition & 0 deletions contracts/data-storage/andromeda-boolean/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ andromeda-data-storage = { workspace = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
cw-multi-test = { workspace = true, optional = true }
andromeda-testing = { workspace = true, optional = true }
cw-orch = { workspace = true }
13 changes: 12 additions & 1 deletion contracts/data-storage/andromeda-boolean/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{Addr, Binary, Deps, DepsMut, Env, MessageInfo, Response};
use cosmwasm_std::{Addr, Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError};

use crate::{
execute::handle_execute,
Expand Down Expand Up @@ -92,3 +92,14 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> Result<Binary, ContractErro
pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result<Response, ContractError> {
ADOContract::default().migrate(deps, CONTRACT_NAME, CONTRACT_VERSION)
}

#[cfg_attr(not(feature = "library"), entry_point)]
pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result<Response, ContractError> {
if msg.result.is_err() {
return Err(ContractError::Std(StdError::generic_err(
msg.result.unwrap_err(),
)));
}

Ok(Response::default())
}
6 changes: 6 additions & 0 deletions contracts/data-storage/andromeda-boolean/src/interface.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use andromeda_data_storage::boolean::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata};

pub const CONTRACT_ID: &str = "boolean";

contract_interface!(BooleanContract, CONTRACT_ID, "andromeda_boolean.wasm");
5 changes: 5 additions & 0 deletions contracts/data-storage/andromeda-boolean/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ mod state;

#[cfg(test)]
mod testing;

#[cfg(not(target_arch = "wasm32"))]
mod interface;
#[cfg(not(target_arch = "wasm32"))]
pub use crate::interface::BooleanContract;
1 change: 1 addition & 0 deletions contracts/data-storage/andromeda-string-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ andromeda-data-storage = { workspace = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
cw-multi-test = { workspace = true, optional = true }
andromeda-testing = { workspace = true, optional = true }
cw-orch = { workspace = true }
13 changes: 12 additions & 1 deletion contracts/data-storage/andromeda-string-storage/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Response};
use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError};

use crate::{
execute::handle_execute,
Expand Down Expand Up @@ -72,3 +72,14 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> Result<Binary, ContractErro
pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result<Response, ContractError> {
ADOContract::default().migrate(deps, CONTRACT_NAME, CONTRACT_VERSION)
}

#[cfg_attr(not(feature = "library"), entry_point)]
pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result<Response, ContractError> {
if msg.result.is_err() {
return Err(ContractError::Std(StdError::generic_err(
msg.result.unwrap_err(),
)));
}

Ok(Response::default())
}
10 changes: 10 additions & 0 deletions contracts/data-storage/andromeda-string-storage/src/interface.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use andromeda_data_storage::string_storage::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata};

pub const CONTRACT_ID: &str = "string-storage";

contract_interface!(
StringStorageContract,
CONTRACT_ID,
"andromeda_string_storage.wasm"
);
5 changes: 5 additions & 0 deletions contracts/data-storage/andromeda-string-storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ mod state;

#[cfg(test)]
mod testing;

#[cfg(not(target_arch = "wasm32"))]
mod interface;
#[cfg(not(target_arch = "wasm32"))]
pub use crate::interface::StringStorageContract;
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ andromeda-finance = { workspace = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
cw-multi-test = { workspace = true, optional = true }
andromeda-testing = { workspace = true, optional = true }
cw-orch = { workspace = true }

[dev-dependencies]
andromeda-app = { workspace = true }
10 changes: 10 additions & 0 deletions contracts/finance/andromeda-conditional-splitter/src/interface.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use andromeda_finance::conditional_splitter::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata};

pub const CONTRACT_ID: &str = "conditional-splitter";

contract_interface!(
ConditionalSplitterContract,
CONTRACT_ID,
"andromeda_conditional_splitter.wasm"
);
5 changes: 5 additions & 0 deletions contracts/finance/andromeda-conditional-splitter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ pub mod mock;

#[cfg(test)]
mod testing;

#[cfg(not(target_arch = "wasm32"))]
mod interface;
#[cfg(not(target_arch = "wasm32"))]
pub use crate::interface::ConditionalSplitterContract;
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ andromeda-finance = { workspace = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
cw-multi-test = { workspace = true, optional = true }
andromeda-testing = { workspace = true, optional = true }
cw-orch = { workspace = true }

[dev-dependencies]
andromeda-app = { workspace = true }
Loading

0 comments on commit e8d7176

Please sign in to comment.