Skip to content

Commit

Permalink
proposal single testcases implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek-1857 committed Apr 9, 2024
1 parent 1afdd4a commit 69312b1
Show file tree
Hide file tree
Showing 33 changed files with 3,611 additions and 6,040 deletions.
35 changes: 35 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ dao-voting-cw4 = { path = "./contracts/voting/dao-voting-cw4", version = "2.4.0"
dao-voting-snip721-roles = { path = "./contracts/voting/dao-voting-snip721-roles", version = "2.4.0" ,default-features = false}
dao-voting-snip721-staked = { path = "./contracts/voting/dao-voting-snip721-staked", version = "2.4.0",default-features = false }
dao-voting-token-staked = { path = "./contracts/voting/dao-voting-token-staked", version = "2.4.0",default-features = false }

dao-testing ={ path = "./packages/dao-testing/"}
# v1 dependencies. used for state migrations.
cw-core-v1 = { package = "cw-core", version = "0.1.0" ,default-features = false}
cw-proposal-single-v1 = { package = "cw-proposal-single", version = "0.1.0",default-features = false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub fn execute(
msg: ExecuteMsg,
) -> Result<Response, PreProposeError> {
match msg {
ExecuteMsg::Propose { msg, key } => execute_propose(deps, env, info, msg, key),
ExecuteMsg::Propose { msg, auth } => execute_propose(deps, env, info, msg, auth),

ExecuteMsg::AddProposalSubmittedHook { address, code_hash } => {
execute_add_approver_hook(deps, info, address, code_hash)
Expand All @@ -73,17 +73,12 @@ pub fn execute_propose(
env: Env,
info: MessageInfo,
msg: ProposeMessage,
key: String,
auth: Auth,
) -> Result<Response, PreProposeError> {
let pre_propose_base = PrePropose::default();
let config = pre_propose_base.config.load(deps.storage)?;

let auth = Auth::ViewingKey {
key: key.clone(),
address: info.sender.clone().to_string(),
};

pre_propose_base.check_can_submit(deps.as_ref(), auth)?;
pre_propose_base.check_can_submit(deps.as_ref(), auth.clone())?;

// Take deposit, if configured.
let deposit_messages = if let Some(ref deposit_info) = config.deposit_info {
Expand Down Expand Up @@ -123,7 +118,7 @@ pub fn execute_propose(
description: propose_msg_internal.description.clone(),
approval_id,
},
key: key.clone(),
auth: auth.clone(),
})?,
funds: vec![],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ pub fn execute(
description,
choices,
},
key,
auth,
} => ExecuteInternal::Propose {
msg: ProposeMessageInternal::Propose {
proposer: Some(info.sender.to_string()),
title,
description,
choices,
},
key,
auth,
},
ExecuteMsg::Extension { msg } => ExecuteInternal::Extension { msg },
ExecuteMsg::Withdraw { denom, key } => ExecuteInternal::Withdraw { denom, key },
Expand Down
4 changes: 2 additions & 2 deletions contracts/pre-propose/dao-pre-propose-single/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ pub fn execute(
description,
msgs,
},
key,
auth,
} => ExecuteInternal::Propose {
msg: ProposeMessageInternal::Propose(ProposeMsg {
proposer: Some(info.sender.to_string()),
title,
description,
msgs,
}),
key,
auth,
},
ExecuteMsg::Extension { msg } => ExecuteInternal::Extension { msg },
ExecuteMsg::Withdraw { denom, key } => ExecuteInternal::Withdraw { denom, key },
Expand Down
12 changes: 5 additions & 7 deletions contracts/proposal/dao-proposal-single/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,25 @@ dao-hooks = { workspace = true }
serde ={ workspace=true }
schemars ={ workspace = true }
secret-cw-controllers ={ workspace = true }
# cw-utils-v1 = { workspace = true}
# voting-v1 = { workspace = true }
# cw-proposal-single-v1 = { workspace = true, features = ["library"] }
shade-protocol ={ workspace = true }
query_auth ={ workspace = true }
dao-pre-propose-single = { workspace = true }
dao-testing ={ workspace = true }


[dev-dependencies]
anyhow = { workspace = true }
cosmwasm-schema = { workspace = true }
secret-multi-test = { workspace = true }
dao-dao-core = { workspace = true }
dao-voting-cw4 = { workspace = true }
# dao-voting-snip20-balance = { workspace = true }
dao-voting-snip20-staked = { workspace = true }
dao-voting-token-staked = { workspace = true }
dao-voting-snip721-staked = { workspace = true }
dao-pre-propose-single = { workspace = true }
cw-denom = { workspace = true }
# dao-testing = { workspace = true }
snip20-stake = { workspace = true }
snip20-reference-impl = { workspace = true }
# cw721-base = { workspace = true }
snip721-reference-impl = { workspace = true }
cw4 = { workspace = true }
cw4-group = { workspace = true }
# cw-core-v1 = { workspace = true, features = ["library"] }
Loading

0 comments on commit 69312b1

Please sign in to comment.