From 7fa10927e22fa5006fb5c4ef94bc15447e9e2a52 Mon Sep 17 00:00:00 2001 From: Christian Gorenflo Date: Wed, 21 Feb 2024 17:00:14 -0500 Subject: [PATCH] chore: remove unused batching contract --- .github/workflows/release.yaml | 2 -- Cargo.lock | 13 ------- README.md | 2 +- contracts/batching/Cargo.toml | 19 ---------- contracts/batching/src/bin/schema.rs | 11 ------ contracts/batching/src/contract.rs | 52 ---------------------------- contracts/batching/src/error.rs | 8 ----- contracts/batching/src/lib.rs | 3 -- contracts/batching/src/msg.rs | 20 ----------- 9 files changed, 1 insertion(+), 129 deletions(-) delete mode 100644 contracts/batching/Cargo.toml delete mode 100644 contracts/batching/src/bin/schema.rs delete mode 100644 contracts/batching/src/contract.rs delete mode 100644 contracts/batching/src/error.rs delete mode 100644 contracts/batching/src/lib.rs delete mode 100644 contracts/batching/src/msg.rs diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 995f8291f..56dd24f6d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,7 +9,6 @@ on: options: - ampd - agggregate-verifier - - batching - connection-router - gateway - multisig @@ -41,7 +40,6 @@ jobs: declare -A binaries_data=( ["ampd"]="ampd,major-ampd,minor-ampd," ["aggregate-verifier"]="aggregate-verifier,/(major-aggregate-verifier)|(major-contracts)/,/(minor-aggregate-verifier)|(minor-contracts)/,contracts/aggregate-verifier packages" - ["batching"]="batching,/(major-batching)|(major-contracts)/,/(minor-batching)|(minor-contracts)/,contracts/batching packages" ["connection-router"]="connection-router,/(major-connection-router)|(major-contracts)/,/(minor-connection-router)|(minor-contracts)/,contracts/connection-router packages" ["gateway"]="gateway,/(major-gateway)|(major-contracts)/,/(minor-gateway)|(minor-contracts)/,contracts/gateway packages" ["multisig"]="multisig,/(major-multisig)|(major-contracts)/,/(minor-multisig)|(minor-contracts)/,contracts/multisig packages" diff --git a/Cargo.lock b/Cargo.lock index 965657509..3317b09a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -793,19 +793,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "batching" -version = "0.1.0" -dependencies = [ - "axelar-wasm-std", - "axelar-wasm-std-derive", - "cosmwasm-schema", - "cosmwasm-std", - "error-stack", - "report", - "thiserror", -] - [[package]] name = "bcs" version = "0.1.5" diff --git a/README.md b/README.md index a070f39cc..5eadb3390 100644 --- a/README.md +++ b/README.md @@ -19,4 +19,4 @@ When developing contracts to integrate with amplifier, the `cw-multi-test` crate The semver for new releases is calculated automatically based on the commit messages and the folders where changes were made. The configuration for each piece of software released (e.g ampd, gateway...) can be seen in the release.yaml file. You can perform a dry-run using the release action to be sure that the next version is what you intend it to be. The basic rules are as follows: - a commit with a message that does not include any associated tag (e.g major-contracts) for release will be considered a patch release - a commit with a message with minor tag e.g `feat(minor-ampd):...` will be considered a minor release, and the same logic applies to major releases - - if no changes are detected in the watched directories, the release will not bump the version. e.g if since last release for the batching contract, no changes were made in the `contracts/major-batching` or `packages/` directory. A new release will not bump the version. + - if no changes are detected in the watched directories, the release will not bump the version. For example, if since last release for the gateway contract no changes were made in the `contracts/gateway` or `packages/` directory. A new release will not bump the version. diff --git a/contracts/batching/Cargo.toml b/contracts/batching/Cargo.toml deleted file mode 100644 index ee9043cc3..000000000 --- a/contracts/batching/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "batching" -version = "0.1.0" -rust-version = { workspace = true } -edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[[bin]] -name = "batching-schema" -path = "src/bin/schema.rs" - -[dependencies] -axelar-wasm-std = { workspace = true } -axelar-wasm-std-derive = { workspace = true } -cosmwasm-schema = { workspace = true } -cosmwasm-std = { workspace = true } -error-stack = { workspace = true } -report = { workspace = true } -thiserror = { workspace = true } diff --git a/contracts/batching/src/bin/schema.rs b/contracts/batching/src/bin/schema.rs deleted file mode 100644 index f9c27804b..000000000 --- a/contracts/batching/src/bin/schema.rs +++ /dev/null @@ -1,11 +0,0 @@ -use cosmwasm_schema::write_api; - -use batching::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; - -fn main() { - write_api! { - instantiate: InstantiateMsg, - execute: ExecuteMsg, - query: QueryMsg - } -} diff --git a/contracts/batching/src/contract.rs b/contracts/batching/src/contract.rs deleted file mode 100644 index 6db89236d..000000000 --- a/contracts/batching/src/contract.rs +++ /dev/null @@ -1,52 +0,0 @@ -use axelar_wasm_std::ContractError; -#[cfg(not(feature = "library"))] -use cosmwasm_std::DepsMut; -use cosmwasm_std::{ - entry_point, Env, Event, MessageInfo, Reply, Response, StdResult, SubMsg, SubMsgResult, -}; - -use crate::msg::{BatchMsg, ExecuteMsg, InstantiateMsg}; - -#[cfg_attr(not(feature = "library"), entry_point)] -pub fn instantiate( - _: DepsMut, - _: Env, - _: MessageInfo, - _: InstantiateMsg, -) -> Result { - Ok(Response::new()) -} - -#[cfg_attr(not(feature = "library"), entry_point)] -pub fn execute( - _: DepsMut, - _: Env, - _: MessageInfo, - msg: ExecuteMsg, -) -> Result { - match msg { - ExecuteMsg::Batch(msg) => Ok(dispatch(msg)), - } -} - -#[cfg_attr(not(feature = "library"), entry_point)] -pub fn reply(_: DepsMut, _: Env, msg: Reply) -> StdResult { - let response = match msg.result { - SubMsgResult::Ok(res) => Response::default().add_events(res.events), - SubMsgResult::Err(err) => Response::default() - .add_event(Event::new("failed_msg").add_attribute(msg.id.to_string(), err)), - }; - - Ok(response) -} - -fn dispatch(msg: BatchMsg) -> Response { - Response::new() - .add_messages(msg.must_succeed_msgs) - .add_submessages( - msg.can_fail_msgs - .into_iter() - .enumerate() - .map(|(i, msg)| SubMsg::reply_always(msg, i as u64)), - ) -} diff --git a/contracts/batching/src/error.rs b/contracts/batching/src/error.rs deleted file mode 100644 index 6f4e9e04e..000000000 --- a/contracts/batching/src/error.rs +++ /dev/null @@ -1,8 +0,0 @@ -use cosmwasm_std::StdError; -use thiserror::Error; - -#[derive(Error, Debug)] -pub enum ContractError { - #[error(transparent)] - Std(#[from] StdError), -} diff --git a/contracts/batching/src/lib.rs b/contracts/batching/src/lib.rs deleted file mode 100644 index a23a8d204..000000000 --- a/contracts/batching/src/lib.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod contract; -mod error; -pub mod msg; diff --git a/contracts/batching/src/msg.rs b/contracts/batching/src/msg.rs deleted file mode 100644 index 0d677dc2a..000000000 --- a/contracts/batching/src/msg.rs +++ /dev/null @@ -1,20 +0,0 @@ -use cosmwasm_schema::{cw_serde, QueryResponses}; -use cosmwasm_std::CosmosMsg; - -#[cw_serde] -pub struct InstantiateMsg {} - -#[cw_serde] -pub enum ExecuteMsg { - Batch(BatchMsg), -} - -#[cw_serde] -pub struct BatchMsg { - pub must_succeed_msgs: Vec, - pub can_fail_msgs: Vec, -} - -#[cw_serde] -#[derive(QueryResponses)] -pub enum QueryMsg {}