Skip to content

Commit

Permalink
Added derive fns
Browse files Browse the repository at this point in the history
  • Loading branch information
Kayanski committed May 17, 2024
1 parent 003f87d commit f720001
Show file tree
Hide file tree
Showing 24 changed files with 51 additions and 23 deletions.
9 changes: 9 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ syn = { version = "1.0", features = ["derive"] }
test-context = "0.1"
thiserror = { version = "1.0" }
wynd-utils = "0.4"
cw-orch = "0.22.2"

# One commit ahead of version 0.3.0. Allows initialization with an
# optional owner.
Expand Down
2 changes: 1 addition & 1 deletion contracts/dao-dao-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract-cw-plus-interface = "2.0.1"
abstract-cw20 = "2.0.0"
abstract-cw20-base = "2.0.0"
cw-multi-test = { workspace = true, features = ["stargate"] }
cw-orch = "0.22.2"
cw-orch = {workspace = true}
cw20-base = { workspace = true }
cw721-base = { workspace = true }
dao-cw-orch = { path = "../../packages/cw-orch" }
Expand Down
3 changes: 2 additions & 1 deletion contracts/proposal/dao-proposal-condorcet/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name ="dao-proposal-condorcet"
name = "dao-proposal-condorcet"
authors = ["ekez <ekez@withoutdoing.com>"]
description = "A DAO DAO proposal module with ranked-choice, Condorcet voting."
edition = { workspace = true }
Expand All @@ -26,6 +26,7 @@ dao-voting = { workspace = true }
dao-dao-macros = { workspace = true }
dao-interface = { workspace = true }
thiserror = { workspace = true }
cw-orch = { workspace = true }

[dev-dependencies]
cosmwasm-schema = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion contracts/proposal/dao-proposal-condorcet/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub struct Choice {
}

#[cw_serde]
#[derive(cw_orch::ExecuteFns)]
pub enum ExecuteMsg {
Propose { choices: Vec<Choice> },
Vote { proposal_id: u32, vote: Vec<u32> },
Expand All @@ -23,7 +24,7 @@ pub enum ExecuteMsg {

#[proposal_module_query]
#[cw_serde]
#[derive(QueryResponses)]
#[derive(QueryResponses, cw_orch::QueryFns)]
pub enum QueryMsg {
#[returns(crate::proposal::ProposalResponse)]
Proposal { id: u32 },
Expand Down
1 change: 1 addition & 0 deletions contracts/proposal/dao-proposal-multiple/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ cw-hooks = { workspace = true }
dao-hooks = { workspace = true }
dao-pre-propose-multiple = { workspace = true }
voting-v1 = { workspace = true }
cw-orch = { workspace = true }

[dev-dependencies]
anyhow = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion contracts/proposal/dao-proposal-multiple/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub struct InstantiateMsg {
}

#[cw_serde]
#[derive(cw_orch::ExecuteFns)]
pub enum ExecuteMsg {
/// Creates a proposal in the governance module.
Propose(MultipleChoiceProposeMsg),
Expand Down Expand Up @@ -147,7 +148,7 @@ pub enum ExecuteMsg {

#[proposal_module_query]
#[cw_serde]
#[derive(QueryResponses)]
#[derive(QueryResponses, cw_orch::QueryFns)]
pub enum QueryMsg {
/// Gets the governance module's config.
#[returns(crate::state::Config)]
Expand Down
1 change: 1 addition & 0 deletions contracts/proposal/dao-proposal-single/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ thiserror = { workspace = true }
cw-utils-v1 = { workspace = true}
voting-v1 = { workspace = true }
cw-proposal-single-v1 = { workspace = true, features = ["library"] }
cw-orch = {workspace = true}

[dev-dependencies]
anyhow = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion contracts/proposal/dao-proposal-single/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ pub struct InstantiateMsg {
}

#[cw_serde]
#[derive(cw_orch::ExecuteFns)]
pub enum ExecuteMsg {
/// Creates a proposal in the module.
Propose(SingleChoiceProposeMsg),
Expand Down Expand Up @@ -147,7 +148,7 @@ pub enum ExecuteMsg {

#[proposal_module_query]
#[cw_serde]
#[derive(QueryResponses)]
#[derive(QueryResponses, cw_orch::QueryFns)]
pub enum QueryMsg {
/// Gets the proposal module's config.
#[returns(crate::state::Config)]
Expand Down
5 changes: 3 additions & 2 deletions contracts/staking/cw20-stake-external-rewards/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ cw-storage-plus = { workspace = true }
cw-controllers = { workspace = true }
cw20 = { workspace = true }
cw-utils = { workspace = true }
cw20-base = { workspace = true, features = ["library"] }
cw20-base = { workspace = true, features = ["library"] }
cw2 = { workspace = true }
thiserror = { workspace = true }
cw20-stake = { workspace = true, features = ["library"]}
cw20-stake = { workspace = true, features = ["library"] }
cw-ownable = { workspace = true }
dao-hooks = { workspace = true }

cw20-stake-external-rewards-v1 = { workspace = true }
cw20-013 = { package = "cw20", version = "0.13" }
cw-orch = { workspace = true }

[dev-dependencies]
cw-multi-test = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion contracts/staking/cw20-stake-external-rewards/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub struct InstantiateMsg {

#[cw_ownable_execute]
#[cw_serde]
#[derive(cw_orch::ExecuteFns)]
pub enum ExecuteMsg {
StakeChangeHook(StakeChangedHookMsg),
Claim {},
Expand All @@ -45,7 +46,7 @@ pub enum ReceiveMsg {
}

#[cw_serde]
#[derive(QueryResponses)]
#[derive(QueryResponses, cw_orch::QueryFns)]
pub enum QueryMsg {
#[returns(InfoResponse)]
Info {},
Expand Down
9 changes: 6 additions & 3 deletions contracts/staking/cw20-stake-reward-distributor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[package]
name = "cw20-stake-reward-distributor"
edition = "2018"
authors = ["Vernon Johnson <vtj2105@columbia.edu>, ekez <ekez@withoutdoing.com>"]
authors = [
"Vernon Johnson <vtj2105@columbia.edu>, ekez <ekez@withoutdoing.com>",
]
description = "Distributes cw20 staking rewards."
license = { workspace = true }
repository = { workspace = true }
Expand All @@ -24,11 +26,12 @@ cw-storage-plus = { workspace = true }
cw2 = { workspace = true }
cw20 = { workspace = true }
cw-utils = { workspace = true }
cw20-base = { workspace = true, features = ["library"] }
cw20-stake = { workspace = true, features = ["library"]}
cw20-base = { workspace = true, features = ["library"] }
cw20-stake = { workspace = true, features = ["library"] }
thiserror = { workspace = true }
cw-ownable = { workspace = true }
cw20-stake-reward-distributor-v1 = { workspace = true, features = ["library"] }
cw-orch = { workspace = true }

[dev-dependencies]
cw-multi-test = { workspace = true }
3 changes: 2 additions & 1 deletion contracts/staking/cw20-stake-reward-distributor/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub struct InstantiateMsg {

#[cw_ownable_execute]
#[cw_serde]
#[derive(cw_orch::ExecuteFns)]
pub enum ExecuteMsg {
UpdateConfig {
staking_addr: String,
Expand All @@ -29,7 +30,7 @@ pub enum ExecuteMsg {
}

#[cw_serde]
#[derive(QueryResponses)]
#[derive(QueryResponses, cw_orch::QueryFns)]
pub enum QueryMsg {
#[returns(InfoResponse)]
Info {},
Expand Down
3 changes: 2 additions & 1 deletion contracts/staking/cw20-stake/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cw-controllers = { workspace = true }
cw-hooks = { workspace = true }
cw20 = { workspace = true }
cw-utils = { workspace = true }
cw20-base = { workspace = true, features = ["library"] }
cw20-base = { workspace = true, features = ["library"] }
cw2 = { workspace = true }
thiserror = { workspace = true }
cw-paginate-storage = { workspace = true }
Expand All @@ -33,6 +33,7 @@ dao-voting = { workspace = true }

cw20-stake-v1 = { workspace = true, features = ["library"] }
cw-utils-v1 = { workspace = true }
cw-orch = { workspace = true }

[dev-dependencies]
cw-multi-test = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion contracts/staking/cw20-stake/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub struct InstantiateMsg {

#[cw_ownable_execute]
#[cw_serde]
#[derive(cw_orch::ExecuteFns)]
pub enum ExecuteMsg {
Receive(Cw20ReceiveMsg),
Unstake { amount: Uint128 },
Expand All @@ -37,7 +38,7 @@ pub enum ReceiveMsg {
}

#[cw_serde]
#[derive(QueryResponses)]
#[derive(QueryResponses, cw_orch::QueryFns)]
pub enum QueryMsg {
#[returns(StakedBalanceAtHeightResponse)]
StakedBalanceAtHeight {
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/dao-proposal-hook-counter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cw-storage-plus = { workspace = true }
cw2 = { workspace = true }
thiserror = { workspace = true }
dao-hooks = { workspace = true }

cw-orch = { workspace = true }
[dev-dependencies]
cw-hooks = { workspace = true }
cw20 = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion contracts/test/dao-proposal-hook-counter/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ pub struct InstantiateMsg {
}

#[cw_serde]
#[derive(cw_orch::ExecuteFns)]
pub enum ExecuteMsg {
ProposalHook(ProposalHookMsg),
StakeChangeHook(StakeChangedHookMsg),
VoteHook(VoteHookMsg),
}

#[cw_serde]
#[derive(QueryResponses)]
#[derive(QueryResponses, cw_orch::QueryFns)]
pub enum QueryMsg {
#[returns(Uint128)]
StakeCounter {},
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/dao-proposal-sudo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cw2 = { workspace = true }
thiserror = { workspace = true }
dao-dao-macros = { workspace = true }
dao-interface = { workspace = true }
cw-orch = "0.22.2"
cw-orch = { workspace = true }

[dev-dependencies]
cw-multi-test = { workspace = true }
2 changes: 1 addition & 1 deletion contracts/test/dao-test-custom-factory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ cw-tokenfactory-issuer = { workspace = true, features = [
"library",
"osmosis_tokenfactory",
] }

cw-orch = { workspace = true }
[dev-dependencies]
cw-multi-test = { workspace = true }
3 changes: 2 additions & 1 deletion contracts/test/dao-test-custom-factory/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use dao_interface::token::NewTokenInfo;
pub struct InstantiateMsg {}

#[cw_serde]
#[derive(cw_orch::ExecuteFns)]
pub enum ExecuteMsg {
/// Example NFT factory implementation
NftFactory {
Expand Down Expand Up @@ -37,7 +38,7 @@ pub enum ExecuteMsg {
}

#[cw_serde]
#[derive(QueryResponses)]
#[derive(QueryResponses, cw_orch::QueryFns)]
pub enum QueryMsg {
#[returns(dao_interface::voting::InfoResponse)]
Info {},
Expand Down
4 changes: 2 additions & 2 deletions contracts/test/dao-voting-cw20-balance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ cw-utils = { workspace = true }
thiserror = { workspace = true }
dao-dao-macros = { workspace = true }
dao-interface = { workspace = true }
cw20-base = { workspace = true, features = ["library"] }
cw-orch = "0.22.2"
cw20-base = { workspace = true, features = ["library"] }
cw-orch = { workspace = true }

[dev-dependencies]
cw-multi-test = { workspace = true }
2 changes: 1 addition & 1 deletion packages/dao-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cw20 = { workspace = true }
cw721 = { workspace = true }
cw-utils = { workspace = true }
osmosis-std = { workspace = true }
cw-orch = "0.22.2"
cw-orch = {workspace = true}

[dev-dependencies]
cosmwasm-schema = { workspace = true }
1 change: 1 addition & 0 deletions packages/dao-pre-propose-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dao-interface = { workspace = true }
dao-voting = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
cw-orch = {workspace = true}

[dev-dependencies]
cw-multi-test = { workspace = true }
3 changes: 2 additions & 1 deletion packages/dao-pre-propose-base/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub struct InstantiateMsg<InstantiateExt> {
}

#[cw_serde]
#[derive(cw_orch::ExecuteFns)]
pub enum ExecuteMsg<ProposalMessage, ExecuteExt> {
/// Creates a new proposal in the pre-propose module. MSG will be
/// serialized and used as the proposal creation message.
Expand Down Expand Up @@ -89,7 +90,7 @@ pub enum ExecuteMsg<ProposalMessage, ExecuteExt> {
}

#[cw_serde]
#[derive(QueryResponses)]
#[derive(QueryResponses, cw_orch::QueryFns)]
pub enum QueryMsg<QueryExt>
where
QueryExt: JsonSchema,
Expand Down

0 comments on commit f720001

Please sign in to comment.