Skip to content
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

Tok 424 Additional wallet tests #23

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tests/did.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ use indy::ErrorCode;
use std::sync::mpsc::channel;
use std::time::Duration;
use utils::b58::{FromBase58, IntoBase58};
use utils::constants::{DID_1, SEED_1, VERKEY_1, METADATA, VERKEY_ABV_1};
use utils::constants::{
DID_1,
SEED_1,
VERKEY_1,
METADATA,
VERKEY_ABV_1,
INVALID_HANDLE
};
use utils::setup::{Setup, SetupConfig};
use utils::wallet::Wallet;

const VALID_TIMEOUT: Duration = Duration::from_secs(5);
const INVALID_TIMEOUT: Duration = Duration::from_micros(1);
const INVALID_HANDLE: i32 = 583741;

#[inline]
fn assert_verkey_len(verkey: &str) {
Expand Down
8 changes: 4 additions & 4 deletions tests/utils/constants.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
pub const DEFAULT_CREDENTIALS: &str = r#"{"key":""}"#;
pub const DID_1: &str = "VsKV7grR1BUE29mG2Fm2kX";
pub const EXPORT_KEY: &str = "export_key";
pub const DID: &str = "8wZcEriaNLNKtteJvx7f8i";
pub const DID_TRUSTEE: &str = "V4SGRU86Z58d6TV7PBUe6f";
pub const INVALID_HANDLE: i32 = 583741;
pub const METADATA: &str = "some_metadata";
pub const MY1_SEED: &str = "00000000000000000000000000000My1";
pub const PROTOCOL_VERSION: i32 = 2;
pub const SEED_1: &str = "00000000000000000000000000000My1";
pub const TRUSTEE_SEED: &str = "000000000000000000000000Trustee1";
pub const VERKEY_1: &str = "GjZWsBLgZCR18aL468JAT7w9CZRiBnpxUPPgyQxh4voa";
pub const VERKEY_ABV_1: &str = "~HYwqs2vrTc8Tn4uBV7NBTe";
pub const DID: &str = "8wZcEriaNLNKtteJvx7f8i";
pub const DID_TRUSTEE: &str = "V4SGRU86Z58d6TV7PBUe6f";
pub const VERKEY_TRUSTEE: &str = "GJ1SzoWzavQYfNL9XkaJdrQejfztN4XqdsiV4ct3LXKL";
pub const METADATA: &str = "some_metadata";
13 changes: 0 additions & 13 deletions tests/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,6 @@ pub fn tails_writer_config() -> String {
serde_json::to_string(&c).unwrap()
}

pub fn export_path(wallet_name: &str) -> String {
tmp_file_path(wallet_name).to_str().unwrap().to_string()
}

pub fn export_config_json(wallet_name: &str) -> String {
let e = hashmap![
"key".to_string() => constants::EXPORT_KEY.to_string(),
"path".to_string() => export_path(wallet_name)
];

serde_json::to_string(&e).unwrap()
}

pub fn indy_home_path() -> PathBuf {
let mut path = env::home_dir().unwrap_or(PathBuf::from("/home/indy"));
let mut indy_client_dir = ".indy_client";
Expand Down
Loading