Skip to content

Commit

Permalink
Merge pull request #7 from CyberHoward/howard_member_tests
Browse files Browse the repository at this point in the history
add member tests
  • Loading branch information
CyberHoward authored May 30, 2024
2 parents 082950d + d527fec commit 9a0f7e4
Show file tree
Hide file tree
Showing 23 changed files with 769 additions and 349 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ neutron-query = { path = "packages/neutron-query" }


#cw-orch = { version = "0.22.2" }
cw-orch = { package = "cw-orch-interchain", git = "ssh://[email protected]/AbstractSDK/cw-orch-interchain.git", tag = "v0.22.0" }
#cw-orch-interchain = { version = "0.1.0" }
cw-orch = "0.22"
cw-orch-interchain = { version = "0.1.0" }
const_format = "0.2.32"

interchain-gov = { path = "contracts/interchain-gov" }
Expand Down
7 changes: 4 additions & 3 deletions contracts/interchain-gov/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ interchain-gov = { workspace = true }
abstract-client = { workspace = true }
abstract-adapter = { workspace = true, features = ["test-utils"] }
speculoos = { workspace = true }
#cw-orch-interchain = { workspace = true }

cw-orch-interchain = { workspace = true }
env_logger = { workspace = true }
dotenv = { workspace = true }
abstract-cw-orch-polytone = "2.0.0"
abstract-interface = { workspace = true }
abstract-interchain-tests = { git = "https://github.com/AbstractSDK/abstract", version = "0.22.1", branch = "removemm" }
abstract-interchain-tests = "0.22"
18 changes: 11 additions & 7 deletions contracts/interchain-gov/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
use crate::{error::InterchainGovError, handlers, msg::{InterchainGovExecuteMsg, InterchainGovInstantiateMsg, InterchainGovQueryMsg}, ADAPTER_VERSION, MY_ADAPTER_ID, ibc_callbacks, replies};
use crate::{
error::InterchainGovError,
handlers, ibc_callbacks,
msg::{InterchainGovExecuteMsg, InterchainGovInstantiateMsg, InterchainGovQueryMsg},
replies, ADAPTER_VERSION, MY_ADAPTER_ID,
};

use abstract_adapter::AdapterContract;
use cosmwasm_std::{Empty, Response};
use crate::dependencies::IBC_CLIENT_DEP;
use crate::ibc_callbacks::{REGISTER_VOTE_ID, PROPOSE_CALLBACK_ID, FINALIZE_CALLBACK_ID};
use crate::ibc_callbacks::{FINALIZE_CALLBACK_ID, PROPOSE_CALLBACK_ID, REGISTER_VOTE_ID};
use crate::msg::InterchainGovSudoMsg;

use abstract_adapter::AdapterContract;
use cosmwasm_std::{Empty, Response};

/// The type of the adapter that is used to build your Adapter and access the Abstract SDK features.
pub type InterchainGov = AdapterContract<
Expand All @@ -14,7 +18,7 @@ pub type InterchainGov = AdapterContract<
InterchainGovExecuteMsg,
InterchainGovQueryMsg,
Empty,
InterchainGovSudoMsg
InterchainGovSudoMsg,
>;
/// The type of the result returned by your Adapter's entry points.
pub type AdapterResult<T = Response> = Result<T, InterchainGovError>;
Expand All @@ -27,7 +31,7 @@ const INTERCHAIN_GOV: InterchainGov = InterchainGov::new(MY_ADAPTER_ID, ADAPTER_
.with_ibc_callbacks(&[
(PROPOSE_CALLBACK_ID, ibc_callbacks::proposal_callback),
(FINALIZE_CALLBACK_ID, ibc_callbacks::finalize_callback),
(REGISTER_VOTE_ID, ibc_callbacks::vote_result_callback)
(REGISTER_VOTE_ID, ibc_callbacks::vote_result_callback),
])
// WE need a reply for every member
.with_replies(&[
Expand Down
12 changes: 5 additions & 7 deletions contracts/interchain-gov/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,17 @@ pub enum InterchainGovError {
#[error("Votes still pending for {prop_id} on {chains:?}")]
VotesStillPending {
prop_id: ProposalId,
chains: Vec<ChainName>
chains: Vec<ChainName>,
},

#[error("Gov Votes still pending for {prop_id} on {chains:?}")]
GovVotesStillPending {
prop_id: ProposalId,
chains: Vec<ChainName>
chains: Vec<ChainName>,
},

#[error("Missing vote results for {prop_id}, should call RequestVoteResults first")]
MissingVoteResults {
prop_id: ProposalId,
},
MissingVoteResults { prop_id: ProposalId },

#[error("Votes already finalized {0}")]
VotesAlreadyFinalized(String),
Expand All @@ -117,11 +115,11 @@ pub enum InterchainGovError {
#[error("Unrequested vote result for {chain:?}, {prop_id}")]
UnrequestedVote {
chain: ChainName,
prop_id: ProposalId
prop_id: ProposalId,
},
#[error("Existing vote result for {chain:?}, {prop_id}")]
ExistingVoteResult {
chain: ChainName,
prop_id: ProposalId
prop_id: ProposalId,
},
}
Loading

0 comments on commit 9a0f7e4

Please sign in to comment.