Skip to content

Commit

Permalink
Split up contracts (#672)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjakovic0920 authored Dec 2, 2024
1 parent 1f3b0d4 commit 5834145
Show file tree
Hide file tree
Showing 100 changed files with 193 additions and 127 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added MultiSig ADO [(#619)](https://github.com/andromedaprotocol/andromeda-core/pull/619)
- Added Validator Staking ADO [(#330)](https://github.com/andromedaprotocol/andromeda-core/pull/330)
- Added Restake and Redelegate to Validator Staking [(#622)](https://github.com/andromedaprotocol/andromeda-core/pull/622)
- Added andromeda-math and andromeda-account packages[(#672)](https://github.com/andromedaprotocol/andromeda-core/pull/672)


### Changed

- Removed staking from vesting contract [(#554)](https://github.com/andromedaprotocol/andromeda-core/pull/554)
- Vesting: Changed to use Milliseconds instead of seconds and removed unnecessary is_multi_batch_enabled flag [(#578)](https://github.com/andromedaprotocol/andromeda-core/pull/578)
- Splits up ADOs: moved Counter, Curve, Date-Time, Graph, Point, Shunting ADOs to math package and Fixed Multisig ADO to accounts package[(#672)](https://github.com/andromedaprotocol/andromeda-core/pull/672)

### Fixed

Expand Down
37 changes: 29 additions & 8 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ members = [
# "contracts/automation/*",
"contracts/modules/*",
"contracts/os/*",
"contracts/accounts/*",
"contracts/math/*",

#Internal
"tests-integration",
Expand Down Expand Up @@ -40,6 +42,8 @@ andromeda-data-storage = { path = "./packages/andromeda-data-storage", version =
andromeda-modules = { path = "./packages/andromeda-modules", version = "2.0.0" }
andromeda-app = { path = "./packages/andromeda-app", version = "1.0.0" }
andromeda-ecosystem = { path = "./packages/andromeda-ecosystem", version = "1.0.0" }
andromeda-accounts = { path = "./packages/andromeda-accounts", version = "1.0.0" }
andromeda-math = { path = "./packages/andromeda-math", version = "1.0.0" }
andromeda-testing = { path = "./packages/andromeda-testing", version = "1.0.0" }
andromeda-testing-e2e = { path = "./packages/andromeda-testing-e2e", version = "1.0.0" }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cw4 = { workspace = true }
cw3-fixed-multisig = { git = "https://github.com/CosmWasm/cw-plus" }

andromeda-std = { workspace = true }
andromeda-finance = { workspace = true }
andromeda-accounts = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
cw-orch = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use andromeda_finance::fixed_multisig::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_accounts::fixed_multisig::{ExecuteMsg, InstantiateMsg, QueryMsg};
use cosmwasm_schema::write_api;

fn main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use cosmwasm_std::entry_point;
use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError};

use andromeda_finance::fixed_multisig::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_accounts::fixed_multisig::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_std::{
ado_base::{InstantiateMsg as BaseInstantiateMsg, MigrateMsg},
ado_contract::ADOContract,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use andromeda_finance::fixed_multisig::ExecuteMsg;
use andromeda_accounts::fixed_multisig::ExecuteMsg;
use andromeda_std::{
ado_contract::ADOContract,
common::{actions::call_action, context::ExecuteContext},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use andromeda_finance::fixed_multisig::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_accounts::fixed_multisig::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata};

pub const CONTRACT_ID: &str = "fixed-multisig";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use cw2::{get_contract_version, ContractVersion};
use cw3::{ProposalResponse, Status, Vote, VoteListResponse};
use cw_utils::{Duration, Expiration, Threshold};

use andromeda_finance::fixed_multisig::Voter;
use andromeda_finance::fixed_multisig::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_accounts::fixed_multisig::Voter;
use andromeda_accounts::fixed_multisig::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_std::{
amp::AndrAddr,
error::ContractError,
Expand Down
10 changes: 0 additions & 10 deletions contracts/data-storage/andromeda-counter/examples/schema.rs

This file was deleted.

10 changes: 0 additions & 10 deletions contracts/data-storage/andromeda-point/examples/schema.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ cosmwasm-std = { workspace = true }
cosmwasm-schema = { workspace = true }
cw-storage-plus = { workspace = true }
cw-utils = { workspace = true }
cw20 = { workspace = true }

andromeda-std = { workspace = true, features = ["rates"] }
andromeda-data-storage = { workspace = true }
andromeda-math = { workspace = true }


[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use andromeda_modules::shunting::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_math::counter::{ExecuteMsg, InstantiateMsg, QueryMsg};
use cosmwasm_schema::write_api;
fn main() {
write_api! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use cosmwasm_std::{
attr, ensure, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError, Storage,
};

use andromeda_data_storage::counter::{CounterRestriction, ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_data_storage::counter::{
use andromeda_math::counter::{CounterRestriction, ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_math::counter::{
GetCurrentAmountResponse, GetDecreaseAmountResponse, GetIncreaseAmountResponse,
GetInitialAmountResponse, GetRestrictionResponse,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use andromeda_data_storage::counter::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_math::counter::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata};

pub const CONTRACT_ID: &str = "counter";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#![cfg(all(not(target_arch = "wasm32"), feature = "testing"))]
use crate::contract::{execute, instantiate, query};
use andromeda_data_storage::counter::{
CounterRestriction, ExecuteMsg, InstantiateMsg, QueryMsg, State,
};
use andromeda_data_storage::counter::{
use andromeda_math::counter::{CounterRestriction, ExecuteMsg, InstantiateMsg, QueryMsg, State};
use andromeda_math::counter::{
GetCurrentAmountResponse, GetDecreaseAmountResponse, GetIncreaseAmountResponse,
GetInitialAmountResponse, GetRestrictionResponse,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use andromeda_data_storage::counter::CounterRestriction;
use andromeda_math::counter::CounterRestriction;
use cw_storage_plus::Item;

pub const INITIAL_AMOUNT: Item<u64> = Item::new("initial_amount");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use andromeda_data_storage::counter::{CounterRestriction, ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_data_storage::counter::{
use andromeda_math::counter::{CounterRestriction, ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_math::counter::{
GetCurrentAmountResponse, GetDecreaseAmountResponse, GetIncreaseAmountResponse,
GetInitialAmountResponse, GetRestrictionResponse, State,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use super::mock::{
query_increase_amount, query_initial_amount, query_restriction, reset, set_decrease_amount,
set_increase_amount, update_restriction,
};
use andromeda_data_storage::counter::{CounterRestriction, State};
use andromeda_math::counter::{CounterRestriction, State};
use andromeda_std::error::ContractError;
use cosmwasm_std::Attribute;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cw-utils = { workspace = true }
test-case = { workspace = true }

andromeda-std = { workspace = true, features = [] }
andromeda-modules = { workspace = true }
andromeda-math = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
cw-multi-test = { workspace = true, optional = true }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use andromeda_modules::date_time::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_math::curve::{ExecuteMsg, InstantiateMsg, QueryMsg};
use cosmwasm_schema::write_api;
fn main() {
write_api! {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(not(feature = "library"))]
use crate::state::{CURVE_CONFIG, DEFAULT_CONSTANT_VALUE, DEFAULT_MULTIPLE_VARIABLE_VALUE};
use andromeda_modules::curve::{
use andromeda_math::curve::{
CurveConfig, CurveType, ExecuteMsg, GetCurveConfigResponse, GetPlotYFromXResponse,
InstantiateMsg, QueryMsg,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use andromeda_modules::curve::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_math::curve::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata};

pub const CONTRACT_ID: &str = "curve";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![cfg(all(not(target_arch = "wasm32"), feature = "testing"))]
use crate::contract::{execute, instantiate, query};
use andromeda_modules::curve::{
use andromeda_math::curve::{
CurveConfig, ExecuteMsg, GetCurveConfigResponse, GetPlotYFromXResponse, InstantiateMsg,
QueryMsg,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use andromeda_modules::curve::CurveConfig;
use andromeda_math::curve::CurveConfig;
use cw_storage_plus::Item;

pub const CURVE_CONFIG: Item<CurveConfig> = Item::new("curve_config");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use andromeda_modules::curve::{
use andromeda_math::curve::{
CurveConfig, ExecuteMsg, GetCurveConfigResponse, GetPlotYFromXResponse, InstantiateMsg,
QueryMsg,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::mock::{
error_initialization, proper_initialization, query_curve_config, query_plot_y_from_x, reset,
update_curve_config,
};
use andromeda_modules::curve::{CurveConfig, CurveType};
use andromeda_math::curve::{CurveConfig, CurveType};
use andromeda_std::{amp::AndrAddr, error::ContractError};
use cosmwasm_std::StdError;
use test_case::test_case;
Expand Down Expand Up @@ -38,7 +38,7 @@ fn test_reset() {
reset(deps.as_mut(), "user1").unwrap();

let err_res = query_curve_config(deps.as_ref()).unwrap_err();
assert_eq!(err_res, ContractError::Std(StdError::NotFound { kind: "type: andromeda_modules::curve::CurveConfig; key: [63, 75, 72, 76, 65, 5F, 63, 6F, 6E, 66, 69, 67]".to_string() }));
assert_eq!(err_res, ContractError::Std(StdError::NotFound { kind: "type: andromeda_math::curve::CurveConfig; key: [63, 75, 72, 76, 65, 5F, 63, 6F, 6E, 66, 69, 67]".to_string() }));
}

#[test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cw-storage-plus = { workspace = true }
cw-utils = { workspace = true }

andromeda-std = { workspace = true }
andromeda-modules = { workspace = true }
andromeda-math = { workspace = true }

chrono = "0.4.38"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use andromeda_data_storage::graph::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_math::date_time::{ExecuteMsg, InstantiateMsg, QueryMsg};
use cosmwasm_schema::write_api;
fn main() {
write_api! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
use cosmwasm_std::entry_point;
use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError};

use andromeda_modules::date_time::GetDateTimeResponse;
use andromeda_modules::date_time::{ExecuteMsg, InstantiateMsg, QueryMsg, Timezone};
use andromeda_math::date_time::GetDateTimeResponse;
use andromeda_math::date_time::{ExecuteMsg, InstantiateMsg, QueryMsg, Timezone};
use andromeda_std::{
ado_base::{InstantiateMsg as BaseInstantiateMsg, MigrateMsg},
ado_contract::ADOContract,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use andromeda_modules::date_time::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_math::date_time::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata};

pub const CONTRACT_ID: &str = "date-time";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![cfg(all(not(target_arch = "wasm32"), feature = "testing"))]
use crate::contract::{execute, instantiate, query};
use andromeda_modules::date_time::GetDateTimeResponse;
use andromeda_modules::date_time::{InstantiateMsg, QueryMsg, Timezone};
use andromeda_math::date_time::GetDateTimeResponse;
use andromeda_math::date_time::{InstantiateMsg, QueryMsg, Timezone};
use andromeda_testing::mock::MockApp;
use andromeda_testing::{
mock_ado,
Expand Down
Loading

0 comments on commit 5834145

Please sign in to comment.