Skip to content

Commit

Permalink
clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blue-note committed Mar 20, 2023
1 parent 895f7fa commit 9c4269f
Show file tree
Hide file tree
Showing 17 changed files with 471 additions and 139 deletions.
25 changes: 25 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ bip32 = "0.4.0"
hex = "0.4.3"
ripemd = "0.1.3"
bech32 = "0.9.1"
bincode = "1.3"

# One commit ahead of version 0.3.0. Allows initialization with an
# optional owner.
Expand Down Expand Up @@ -100,6 +101,7 @@ cw-paginate = { path = "./packages/cw-paginate", version = "*" }
dao-interface = { path = "./packages/dao-interface", version = "*" }
dao-voting = { path = "./packages/dao-voting", version = "*" }


# v1 dependencies. used for state migrations.
cw-core-v1 = { package = "cw-core", version = "0.1.0", git = "https://github.com/DA0-DA0/dao-contracts.git", tag = "v1.0.0" }
cw-proposal-single-v1 = { package = "cw-proposal-single", version = "0.1.0", git = "https://github.com/DA0-DA0/dao-contracts.git", tag = "v1.0.0" }
Expand Down
1 change: 1 addition & 0 deletions contracts/external/cw-verifier-middleware/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ripemd = { workspace = true }
bech32 = { workspace = true }
serde_json = { workspace = true}


[dev-dependencies]

secp256k1 = { workspace = true, features = ["rand-std", "bitcoin-hashes-std"] }
15 changes: 8 additions & 7 deletions contracts/external/cw-verifier-middleware/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use bech32::Error as Bech32Error;

use cosmwasm_std::OverflowError;
use cosmwasm_std::{StdError, VerificationError};
use hex::FromHexError;
use secp256k1::Error as Secp256k1Error;
use serde_json::Error as SerdeError;
use thiserror::Error;

#[derive(Error, Debug, PartialEq)]
#[derive(Error, Debug)]
pub enum ContractError {
#[error("{0}")]
Std(#[from] StdError),
Expand All @@ -27,7 +28,7 @@ pub enum ContractError {
OverflowError(#[from] OverflowError),

#[error("{0}")]
SerdeError(String),
SerdeError(#[from] SerdeError),

#[error("Invalid nonce")]
InvalidNonce,
Expand All @@ -42,8 +43,8 @@ pub enum ContractError {
InvalidPublicKeyLength { length: usize },
}

impl From<SerdeError> for ContractError {
fn from(error: SerdeError) -> Self {
ContractError::SerdeError(error.to_string())
}
}
// impl From<SerdeError> for ContractError {
// fn from(error: SerdeError) -> Self {
// ContractError::SerdeError(error.to_string())
// }
// }
6 changes: 3 additions & 3 deletions contracts/external/cw-verifier-middleware/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/README.md"))]

pub mod verify;
pub mod error;
pub mod msg;
pub mod state;

pub mod utils;
pub mod verify;

#[cfg(test)]
mod testing;
mod testing;
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mod adversarial_tests;
mod tests;
mod adversarial_tests;
Loading

0 comments on commit 9c4269f

Please sign in to comment.