-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proposal condorcet testcases implemented
- Loading branch information
1 parent
bcd06eb
commit 87d4d2e
Showing
13 changed files
with
411 additions
and
349 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
contracts/proposal/dao-proposal-condorcet/src/testing/contracts.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
use cosmwasm_std::{from_binary, ContractInfo, Empty, MessageInfo}; | ||
use secret_multi_test::{App, Contract, ContractWrapper, Executor}; | ||
|
||
pub fn _cw4_group_contract() -> Box<dyn Contract<Empty>> { | ||
let contract = ContractWrapper::new( | ||
cw4_group::contract::execute, | ||
cw4_group::contract::instantiate, | ||
cw4_group::contract::query, | ||
); | ||
Box::new(contract) | ||
} | ||
|
||
pub fn proposal_condorcet_contract() -> Box<dyn Contract<Empty>> { | ||
let contract = ContractWrapper::new( | ||
crate::contract::execute, | ||
crate::contract::instantiate, | ||
crate::contract::query, | ||
) | ||
.with_reply(crate::contract::reply); | ||
Box::new(contract) | ||
} | ||
|
||
pub fn _dao_dao_contract() -> Box<dyn Contract<Empty>> { | ||
let contract = ContractWrapper::new( | ||
dao_dao_core::contract::execute, | ||
dao_dao_core::contract::instantiate, | ||
dao_dao_core::contract::query, | ||
) | ||
.with_reply(dao_dao_core::contract::reply) | ||
.with_migrate(dao_dao_core::contract::migrate); | ||
Box::new(contract) | ||
} | ||
|
||
pub fn _dao_voting_cw4_contract() -> Box<dyn Contract<Empty>> { | ||
let contract = ContractWrapper::new( | ||
dao_voting_cw4::contract::execute, | ||
dao_voting_cw4::contract::instantiate, | ||
dao_voting_cw4::contract::query, | ||
) | ||
.with_reply(dao_voting_cw4::contract::reply); | ||
Box::new(contract) | ||
} | ||
|
||
pub fn query_auth_contract() -> Box<dyn Contract<Empty>> { | ||
let contract = ContractWrapper::new( | ||
query_auth::contract::execute, | ||
query_auth::contract::instantiate, | ||
query_auth::contract::query, | ||
); | ||
Box::new(contract) | ||
} | ||
|
||
pub(crate) fn create_viewing_key( | ||
app: &mut App, | ||
contract_info: ContractInfo, | ||
info: MessageInfo, | ||
) -> String { | ||
let msg = shade_protocol::contract_interfaces::query_auth::ExecuteMsg::CreateViewingKey { | ||
entropy: "entropy".to_string(), | ||
padding: None, | ||
}; | ||
let res = app | ||
.execute_contract(info.sender, &contract_info, &msg, &[]) | ||
.unwrap(); | ||
let mut viewing_key = String::new(); | ||
let data: shade_protocol::contract_interfaces::query_auth::ExecuteAnswer = | ||
from_binary(&res.data.unwrap()).unwrap(); | ||
if let shade_protocol::contract_interfaces::query_auth::ExecuteAnswer::CreateViewingKey { | ||
key, | ||
} = data | ||
{ | ||
viewing_key = key; | ||
}; | ||
viewing_key | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod contracts; | ||
mod instantiation; | ||
mod proposals; | ||
mod suite; | ||
|
Oops, something went wrong.