Skip to content

Commit

Permalink
Rename methods, cleanup unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeHartnell committed Nov 17, 2023
1 parent ae7e73b commit 3ab6cc4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions contracts/external/cw-abc/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ fn assert_allowlisted(storage: &dyn Storage, hatcher: &Addr) -> Result<(), Contr

/// Set the maxiumum supply (only callable by owner)
/// If `max_supply` is set to None there will be no limit.`
pub fn set_max_supply(
pub fn update_max_supply(
deps: DepsMut<TokenFactoryQuery>,
info: MessageInfo,
max_supply: Option<Uint128>,
Expand All @@ -296,7 +296,7 @@ pub fn set_max_supply(
}

Ok(Response::new()
.add_attribute("action", "set_max_supply")
.add_attribute("action", "update_max_supply")
.add_attribute("value", max_supply.unwrap_or(Uint128::MAX).to_string()))
}

Expand Down
6 changes: 4 additions & 2 deletions contracts/external/cw-abc/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,12 @@ pub fn execute(
) -> CwAbcResult {
match msg {
ExecuteMsg::Buy {} => commands::execute_buy(deps, env, info),
ExecuteMsg::Burn {} => commands::execute_sell(deps, env, info),
ExecuteMsg::Sell {} => commands::execute_sell(deps, env, info),
ExecuteMsg::Close {} => commands::execute_close(deps, info),
ExecuteMsg::Donate {} => commands::execute_donate(deps, env, info),
ExecuteMsg::SetMaxSupply { max_supply } => commands::set_max_supply(deps, info, max_supply),
ExecuteMsg::UpdateMaxSupply { max_supply } => {
commands::update_max_supply(deps, info, max_supply)
}
ExecuteMsg::UpdateCurve { curve_type } => commands::update_curve(deps, info, curve_type),
ExecuteMsg::UpdateHatchAllowlist { to_add, to_remove } => {
commands::update_hatch_allowlist(deps, info, to_add, to_remove)
Expand Down
9 changes: 5 additions & 4 deletions contracts/external/cw-abc/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ pub enum UpdatePhaseConfigMsg {
#[cw_serde]
pub enum ExecuteMsg {
/// Buy will attempt to purchase as many supply tokens as possible.
/// You must send only reserve tokens in that message
/// You must send only reserve tokens.
Buy {},
/// Burn is a base message to destroy tokens forever
Burn {},
/// Sell burns supply tokens in return for the reserve token.
/// You must send only supply tokens.
Sell {},
/// Donate will add reserve tokens to the funding pool
Donate {},
/// Sets (or unsets if set to None) the maximum supply
SetMaxSupply {
UpdateMaxSupply {
/// The maximum supply able to be minted.
max_supply: Option<Uint128>,
},
Expand Down
15 changes: 5 additions & 10 deletions contracts/external/cw-abc/src/test_tube/integration_tests.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
use crate::{
abc::{ClosedConfig, CommonsPhase, CommonsPhaseConfig, HatchConfig, MinMax, OpenConfig},
msg::{
CommonsPhaseConfigResponse, CurveInfoResponse, DenomResponse, ExecuteMsg, InstantiateMsg,
QueryMsg,
},
msg::{CommonsPhaseConfigResponse, CurveInfoResponse, DenomResponse, ExecuteMsg, QueryMsg},
ContractError,
};

use super::test_env::{TestEnv, TestEnvBuilder, DENOM, RESERVE};
use super::test_env::{TestEnv, TestEnvBuilder, RESERVE};

use cosmwasm_std::{coins, Decimal, Uint128};
use cw_tokenfactory_issuer::msg::QueryMsg as IssuerQueryMsg;
use osmosis_std::types::cosmos::bank::v1beta1::QueryBalanceRequest;
use osmosis_test_tube::{
osmosis_std::types::cosmos::base::v1beta1::Coin, Account, OsmosisTestApp, RunnerError,
};
use osmosis_test_tube::{osmosis_std::types::cosmos::base::v1beta1::Coin, Account, OsmosisTestApp};

#[test]
fn test_happy_path() {
Expand Down Expand Up @@ -109,9 +104,9 @@ fn test_happy_path() {
}
);

// Burn
// Sell
abc.execute(
&ExecuteMsg::Burn {},
&ExecuteMsg::Sell {},
&coins(100, denom.clone()),
&accounts[0],
)
Expand Down

0 comments on commit 3ab6cc4

Please sign in to comment.