Skip to content

Commit

Permalink
697 (DA0-DA0#702)
Browse files Browse the repository at this point in the history
* update cw-orch dependency

* add getrandom dependency to .toml

---------

Co-authored-by: Jake Hartnell <Jake.Hartnell@gmail.com>
  • Loading branch information
2 people authored and Jake Hartnell committed Mar 26, 2024
1 parent 0f390c3 commit 6097ea4
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
11 changes: 8 additions & 3 deletions contracts/external/cw-abc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[package]
name = "cw-abc"
version = "0.0.1"
authors = ["Ethan Frey <ethanfrey@users.noreply.github.com>", "Jake Hartnell", "Adair <adairrr@users.noreply.github.com>"]
authors = [
"Ethan Frey <ethanfrey@users.noreply.github.com>",
"Jake Hartnell",
"Adair <adairrr@users.noreply.github.com>",
]
edition = { workspace = true }
description = "Implements an Augmented Bonding Curve"
license = "Apache-2.0"
Expand All @@ -16,7 +20,7 @@ crate-type = ["cdylib", "rlib"]
backtraces = ["cosmwasm-std/backtraces"]
# use library feature to disable all instantiate/execute/query exports
library = []
boot = ["dep:boot-core"]
boot = ["dep:cw-orch"]

[dependencies]
cw-utils = { workspace = true }
Expand All @@ -30,11 +34,12 @@ cw-address-like = "1.0.4"
rust_decimal = "1.14.3"
integer-sqrt = "0.1.5"
integer-cbrt = "0.1.2"
getrandom = { version = "0.2", features = ["js"] }
# TODO publish this
token-bindings = { git = "https://github.com/CosmosContracts/token-bindings", rev = "1412b94" }
cw-ownable = { workspace = true }
cw-paginate-storage = { workspace = true }
boot-core = { version = "0.10.0", optional = true, git = "https://github.com/AbstractSDK/BOOT", branch = "fix/custom_binding_contract_wrapper" }
cw-orch = { version = "0.13.3", optional = true, git = "https://github.com/AbstractSDK/cw-orchestrator", branch = "main" }

[dev-dependencies]
# TODO move to workspace
Expand Down
10 changes: 5 additions & 5 deletions contracts/external/cw-abc/src/boot.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::msg::*;
use boot_core::{contract, Contract, CwEnv};
#[cfg(feature = "daemon")]
use boot_core::{ArtifactsDir, Daemon, WasmPath};
use boot_core::{ContractWrapper, Mock, MockState, TxHandler, Uploadable};
use cosmwasm_std::Empty;
use cw_orch::{contract, Contract, CwEnv};
#[cfg(feature = "daemon")]
use cw_orch::{ArtifactsDir, Daemon, WasmPath};
use cw_orch::{ContractWrapper, Mock, MockState, TxHandler, Uploadable};
use token_bindings::{TokenFactoryMsg, TokenFactoryQuery};

#[contract(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)]
Expand All @@ -18,7 +18,7 @@ impl<Chain: CwEnv> CwAbc<Chain> {

/// Basic app for the token factory contract
/// TODO: should be in the bindings, along with custom handler for multi-test
pub(crate) type TokenFactoryBasicApp = boot_core::BasicApp<TokenFactoryMsg, TokenFactoryQuery>;
pub(crate) type TokenFactoryBasicApp = cw_orch::BasicApp<TokenFactoryMsg, TokenFactoryQuery>;

type TokenFactoryMock = Mock<MockState, TokenFactoryMsg, TokenFactoryQuery>;

Expand Down
2 changes: 1 addition & 1 deletion contracts/external/cw-abc/src/integration.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{abc::CurveType, boot::CwAbc};
use boot_core::{BootUpload, Mock};
use cosmwasm_std::{Addr, Uint128};
use cw_orch::{CwOrcUpload, Mock};

use crate::testing::prelude::*;

Expand Down
8 changes: 4 additions & 4 deletions contracts/external/cw-abc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ pub(crate) mod testing {

pub(crate) mod prelude {
pub use super::{
default_instantiate_msg, default_supply_metadata, mock_tf_dependencies, TEST_BUYER,
TEST_CREATOR, TEST_INVESTOR, TEST_RESERVE_DENOM, TEST_SUPPLY_DENOM,
default_instantiate_msg, default_supply_metadata, mock_tf_dependencies, TEST_CREATOR,
TEST_RESERVE_DENOM, TEST_SUPPLY_DENOM, _TEST_BUYER, _TEST_INVESTOR,
};
pub use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};
pub use speculoos::prelude::*;
}

pub const TEST_RESERVE_DENOM: &str = "satoshi";
pub const TEST_CREATOR: &str = "creator";
pub const TEST_INVESTOR: &str = "investor";
pub const TEST_BUYER: &str = "buyer";
pub const _TEST_INVESTOR: &str = "investor";
pub const _TEST_BUYER: &str = "buyer";

pub const TEST_SUPPLY_DENOM: &str = "subdenom";

Expand Down
4 changes: 2 additions & 2 deletions contracts/external/cw-abc/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub enum UpdatePhaseConfigMsg {

#[cw_ownable::cw_ownable_execute]
#[cw_serde]
#[cfg_attr(feature = "boot", derive(boot_core::ExecuteFns))]
#[cfg_attr(feature = "boot", derive(cw_orch::ExecuteFns))]
pub enum ExecuteMsg {
/// Buy will attempt to purchase as many supply tokens as possible.
/// You must send only reserve tokens in that message
Expand All @@ -66,7 +66,7 @@ pub enum ExecuteMsg {
#[cw_ownable::cw_ownable_query]
#[cw_serde]
#[derive(QueryResponses)]
#[cfg_attr(feature = "boot", derive(boot_core::QueryFns))]
#[cfg_attr(feature = "boot", derive(cw_orch::QueryFns))]
pub enum QueryMsg {
/// Returns the reserve and supply quantities, as well as the spot price to buy 1 token
/// Returns [`CurveInfoResponse`]
Expand Down

0 comments on commit 6097ea4

Please sign in to comment.