Skip to content

Commit

Permalink
Merge branch 'main' into permission-start-time
Browse files Browse the repository at this point in the history
  • Loading branch information
joemonem committed Jan 10, 2025
2 parents 6549e6d + 106b2fc commit 16893d3
Show file tree
Hide file tree
Showing 24 changed files with 81 additions and 75 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Address Validation: Cross-chain recipients don't need to be registered in VFS [(#725)](https://github.com/andromedaprotocol/andromeda-core/pull/725)
- Weighted Splitter: Replace Recipient with AndrAddr in RemoveRecipient and GetUserWeight [(#739)](https://github.com/andromedaprotocol/andromeda-core/pull/739)
- feat: IBC packet tracking adjustments [#748](https://github.com/andromedaprotocol/andromeda-core/pull/748)
- ref: Rename Set Amount Splitter to Fixed Amount Splitter [(#754)](https://github.com/andromedaprotocol/andromeda-core/pull/754)

### Fixed

Expand Down
38 changes: 19 additions & 19 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "andromeda-set-amount-splitter"
name = "andromeda-fixed-amount-splitter"
version = "1.2.0-b.1"
edition = "2021"
rust-version = "1.75.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use andromeda_finance::splitter::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_finance::fixed_amount_splitter::{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 std::collections::HashSet;

use crate::state::SPLITTER;
use andromeda_finance::{
set_amount_splitter::{
fixed_amount_splitter::{
validate_recipient_list, AddressAmount, Cw20HookMsg, ExecuteMsg, GetSplitterConfigResponse,
InstantiateMsg, QueryMsg, Splitter,
},
Expand All @@ -23,7 +23,7 @@ use cw20::{Cw20Coin, Cw20ReceiveMsg};
use cw_utils::nonpayable;

// version info for migration info
const CONTRACT_NAME: &str = "crates.io:andromeda-set-amount-splitter";
const CONTRACT_NAME: &str = "crates.io:andromeda-fixed-amount-splitter";
const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");
// 1 day in seconds
const ONE_DAY: u64 = 86_400;
Expand Down
10 changes: 10 additions & 0 deletions contracts/finance/andromeda-fixed-amount-splitter/src/interface.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use andromeda_finance::fixed_amount_splitter::{ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata};

pub const CONTRACT_ID: &str = "fixed-amount-splitter";

contract_interface!(
FixedAmountSplitterContract,
CONTRACT_ID,
"andromeda_fixed_amount_splitter.wasm"
);
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ mod testing;
#[cfg(not(target_arch = "wasm32"))]
mod interface;
#[cfg(not(target_arch = "wasm32"))]
pub use crate::interface::SetAmountSplitterContract;
pub use crate::interface::FixedAmountSplitterContract;
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
#![cfg(all(not(target_arch = "wasm32"), feature = "testing"))]

use crate::contract::{execute, instantiate, query, reply};
use andromeda_finance::set_amount_splitter::{AddressAmount, ExecuteMsg, InstantiateMsg, QueryMsg};
use andromeda_finance::fixed_amount_splitter::{
AddressAmount, ExecuteMsg, InstantiateMsg, QueryMsg,
};
use andromeda_std::{amp::Recipient, common::expiration::Expiry};
use andromeda_testing::{
mock::MockApp, mock_ado, mock_contract::ExecuteResult, MockADO, MockContract,
};
use cosmwasm_std::{Addr, Coin, Empty};
use cw_multi_test::{Contract, ContractWrapper, Executor};

pub struct MockSetAmountSplitter(Addr);
mock_ado!(MockSetAmountSplitter, ExecuteMsg, QueryMsg);
pub struct MockFixedAmountSplitter(Addr);
mock_ado!(MockFixedAmountSplitter, ExecuteMsg, QueryMsg);

impl MockSetAmountSplitter {
impl MockFixedAmountSplitter {
#[allow(clippy::too_many_arguments)]
pub fn instantiate(
app: &mut MockApp,
Expand All @@ -24,7 +26,7 @@ impl MockSetAmountSplitter {
owner: Option<String>,
default_recipient: Option<Recipient>,
) -> Self {
let msg = mock_set_amount_splitter_instantiate_msg(
let msg = mock_fixed_amount_splitter_instantiate_msg(
recipients,
kernel_address,
lock_time,
Expand All @@ -43,7 +45,7 @@ impl MockSetAmountSplitter {
funds: &[Coin],
config: Option<Vec<AddressAmount>>,
) -> ExecuteResult {
let msg = mock_set_amount_splitter_send_msg(config);
let msg = mock_fixed_amount_splitter_send_msg(config);

self.execute(app, &msg, sender, funds)
}
Expand All @@ -55,18 +57,18 @@ impl MockSetAmountSplitter {
funds: &[Coin],
recipients: Vec<AddressAmount>,
) -> ExecuteResult {
let msg = mock_set_amount_splitter_update_recipients_msg(recipients);
let msg = mock_fixed_amount_splitter_update_recipients_msg(recipients);

self.execute(app, &msg, sender, funds)
}
}

pub fn mock_andromeda_set_amount_splitter() -> Box<dyn Contract<Empty>> {
pub fn mock_andromeda_fixed_amount_splitter() -> Box<dyn Contract<Empty>> {
let contract = ContractWrapper::new_with_empty(execute, instantiate, query).with_reply(reply);
Box::new(contract)
}

pub fn mock_set_amount_splitter_instantiate_msg(
pub fn mock_fixed_amount_splitter_instantiate_msg(
recipients: Vec<AddressAmount>,
kernel_address: impl Into<String>,
lock_time: Option<Expiry>,
Expand All @@ -82,11 +84,11 @@ pub fn mock_set_amount_splitter_instantiate_msg(
}
}

pub fn mock_set_amount_splitter_send_msg(config: Option<Vec<AddressAmount>>) -> ExecuteMsg {
pub fn mock_fixed_amount_splitter_send_msg(config: Option<Vec<AddressAmount>>) -> ExecuteMsg {
ExecuteMsg::Send { config }
}

pub fn mock_set_amount_splitter_update_recipients_msg(
pub fn mock_fixed_amount_splitter_update_recipients_msg(
recipients: Vec<AddressAmount>,
) -> ExecuteMsg {
ExecuteMsg::UpdateRecipients { recipients }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
use andromeda_finance::fixed_amount_splitter::Splitter;
use cw_storage_plus::Item;

pub const SPLITTER: Item<Splitter> = Item::new("fixed-amount-splitter");
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::{
state::SPLITTER,
testing::mock_querier::mock_dependencies_custom,
};
use andromeda_finance::set_amount_splitter::{
use andromeda_finance::fixed_amount_splitter::{
AddressAmount, ExecuteMsg, GetSplitterConfigResponse, InstantiateMsg, QueryMsg, Splitter,
};

Expand Down
10 changes: 0 additions & 10 deletions contracts/finance/andromeda-set-amount-splitter/src/interface.rs

This file was deleted.

4 changes: 0 additions & 4 deletions contracts/finance/andromeda-set-amount-splitter/src/state.rs

This file was deleted.

2 changes: 1 addition & 1 deletion packages/andromeda-finance/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pub mod conditional_splitter;
pub mod cross_chain_swap;
pub mod fixed_amount_splitter;
pub mod rate_limiting_withdrawals;
pub mod set_amount_splitter;
pub mod splitter;
pub mod timelock;
pub mod validator_staking;
Expand Down
2 changes: 1 addition & 1 deletion packages/deploy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ andromeda-vesting = { path = "../../contracts/finance/andromeda-vesting" }
andromeda-timelock = { path = "../../contracts/finance/andromeda-timelock" }
andromeda-conditional-splitter = { path = "../../contracts/finance/andromeda-conditional-splitter" }
andromeda-rate-limiting-withdrawals = { path = "../../contracts/finance/andromeda-rate-limiting-withdrawals" }
andromeda-set-amount-splitter = { path = "../../contracts/finance/andromeda-set-amount-splitter" }
andromeda-fixed-amount-splitter = { path = "../../contracts/finance/andromeda-fixed-amount-splitter" }
andromeda-weighted-distribution-splitter = { path = "../../contracts/finance/andromeda-weighted-distribution-splitter" }

# Data Storage Contracts
Expand Down
6 changes: 3 additions & 3 deletions packages/deploy/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ use andromeda_cw20_staking::CW20StakingContract;
use andromeda_cw721::CW721Contract;
use andromeda_distance::DistanceContract;
use andromeda_economics::EconomicsContract;
use andromeda_fixed_amount_splitter::FixedAmountSplitterContract;
use andromeda_graph::GraphContract;
use andromeda_ibc_registry::IBCRegistryContract;
use andromeda_kernel::KernelContract;
use andromeda_lockdrop::LockdropContract;
use andromeda_marketplace::MarketplaceContract;
use andromeda_merkle_airdrop::MerkleAirdropContract;
use andromeda_point::PointContract;
use andromeda_primitive::PrimitiveContract;
use andromeda_rate_limiting_withdrawals::RateLimitingWithdrawalsContract;
use andromeda_rates::RatesContract;
use andromeda_set_amount_splitter::SetAmountSplitterContract;
use andromeda_shunting::ShuntingContract;
use andromeda_splitter::SplitterContract;
use andromeda_std::deploy::ADOMetadata;
Expand All @@ -32,7 +33,6 @@ use andromeda_validator_staking::ValidatorStakingContract;
use andromeda_vesting::VestingContract;
use andromeda_vfs::VFSContract;
use andromeda_weighted_distribution_splitter::WeightedDistributionSplitterContract;
use andromeda_point::PointContract;

use cw_orch::prelude::*;
use cw_orch_daemon::{DaemonBase, Wallet};
Expand Down Expand Up @@ -71,7 +71,7 @@ pub fn all_contracts() -> Vec<DeployableContract> {
deployable!(StringStorageContract),
deployable!(ConditionalSplitterContract),
deployable!(RateLimitingWithdrawalsContract),
deployable!(SetAmountSplitterContract),
deployable!(FixedAmountSplitterContract),
deployable!(WeightedDistributionSplitterContract),
deployable!(Cw20ExchangeContract),
deployable!(LockdropContract),
Expand Down
4 changes: 2 additions & 2 deletions tests-integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ andromeda-finance = { workspace = true }
andromeda-splitter = { path = "../contracts/finance/andromeda-splitter", features = [
"testing",
] }
andromeda-set-amount-splitter = { path = "../contracts/finance/andromeda-set-amount-splitter", features = [
andromeda-fixed-amount-splitter = { path = "../contracts/finance/andromeda-fixed-amount-splitter", features = [
"testing",
] }
andromeda-conditional-splitter = { path = "../contracts/finance/andromeda-conditional-splitter", features = [
Expand Down Expand Up @@ -177,7 +177,7 @@ rstest = { workspace = true }
# name = "kernel"

[[test]]
name = "set_amount_splitter"
name = "fixed_amount_splitter"

[[test]]
name = "cw20_staking"
Expand Down
Loading

0 comments on commit 16893d3

Please sign in to comment.