-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: overrule pre-proposal module #NTRN-303 #22
Conversation
# Conflicts: # Cargo.lock # artifacts/cwd_subdao_pre_propose_single.wasm
contracts/dao/pre-propose/cwd-pre-propose-single-overrule/README.md
Outdated
Show resolved
Hide resolved
contracts/dao/pre-propose/cwd-pre-propose-single-overrule/src/contract.rs
Outdated
Show resolved
Hide resolved
} => { | ||
let overrule_msg = CosmosMsg::Wasm(WasmMsg::Execute { | ||
contract_addr: timelock_contract.to_string(), | ||
msg: to_binary(&TimelockExecuteMsg::OverruleProposal { proposal_id }).unwrap(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it costs nothing in terms of code complexity to change unwrap()
with ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
}, | ||
} | ||
} | ||
_ => panic!("Overrule proposal wrapper doesn't allow anything but overrule proposals"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And again, why a panic and not a error. As far as i know a panic error text is not being passed into the transaction response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, fixed
msg: ProposeMessageInternal::Propose { | ||
// Fill in proposer based on message sender. | ||
proposer: Some(info.sender.to_string()), | ||
title: "Overrule proposal".to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about to add proposal_id in a title or description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a great idea! I'm to address it in my next PR since I believe the proposal id itself without the address/name of the subDAO might make more confusion rather than clarity (and the timelock contract address doesn't help there). I think in the next PR I'm to add queries to the timelock contract to get the subDAO address/name.
} | ||
|
||
#[test] | ||
fn test_query_deposit() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's more about of config, then just deposit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do cargo fmt
please
contracts/dao/pre-propose/cwd-pre-propose-single-overrule/Cargo.toml
Outdated
Show resolved
Hide resolved
contracts/dao/pre-propose/cwd-pre-propose-single-overrule/src/contract.rs
Outdated
Show resolved
Hide resolved
pub(crate) const CONTRACT_NAME: &str = "crates.io:cwd-pre-propose-single-overrule"; | ||
pub(crate) const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); | ||
|
||
#[derive(Serialize, JsonSchema, Deserialize, Debug, Clone)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's no biggie, but usually messages are moved to a separate msg.rs
file; wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will move it to the separate file in the next PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested ACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested. Looks great
}, | ||
}; | ||
|
||
let result = PrePropose::default().execute(deps, env, info, internal_msg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PrePropose::default() .execute(deps, env, info, internal_msg) .map_err(|e| PreProposeOverruleError::PreProposeBase(e))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will make refactoring in the next PR
# Conflicts: # artifacts/checksums.txt # artifacts/checksums_intermediate.txt # artifacts/cwd_subdao_core.wasm # artifacts/cwd_subdao_proposal_single.wasm
# Conflicts: # Cargo.lock # artifacts/checksums.txt # artifacts/checksums_intermediate.txt # artifacts/cwd_core.wasm # artifacts/cwd_pre_propose_single.wasm # artifacts/cwd_proposal_single.wasm # artifacts/cwd_subdao_core.wasm # artifacts/cwd_subdao_pre_propose_single.wasm # artifacts/cwd_subdao_proposal_single.wasm # artifacts/cwd_subdao_timelock_single.wasm # contracts/dao/cwd-core/Cargo.toml # contracts/dao/pre-propose/cwd-pre-propose-single/Cargo.toml # contracts/dao/proposal/cwd-proposal-single/Cargo.toml # contracts/subdaos/cwd-subdao-core/Cargo.toml # contracts/subdaos/cwd-subdao-timelock-single/Cargo.toml # contracts/subdaos/pre-propose/cwd-subdao-pre-propose-single/Cargo.toml # contracts/subdaos/proposal/cwd-subdao-proposal-single/Cargo.toml # packages/cwd-voting/Cargo.toml # packages/neutron-subdao-timelock-single/Cargo.toml
Tests passed, nothing broken |
This PR is to add
How to test:
make kill-dev && make install && make init
inneutron
dir./test_subdao_proposal.sh
inneutron-dao
(also check if the version of
cwd_pre_propose_overrule.wasm
inneutron/contracts
corresponds to the current repo code by building the release version and checking the hash)