Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
test: keystore_common_exists interface adds test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoguang1010 committed Sep 1, 2022
1 parent 46ce705 commit 10625e4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tcx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1567,6 +1567,19 @@ mod tests {
assert!(result.is_exists);
assert_eq!(result.id, wallet.id);

let wallet = import_default_wallet();
let param: KeystoreCommonExistsParam = KeystoreCommonExistsParam {
r#type: KeyType::Mnemonic as i32,
value: format!("{}", " inject kidney empty canal shadow pact comfort wife crush horse wife sketch ").to_string(),//Badly formatted mnemonic
encoding: "".to_string(),
};

let ret_bytes = call_api("keystore_common_exists", param).unwrap();
let result: KeystoreCommonExistsResult =
KeystoreCommonExistsResult::decode(ret_bytes.as_slice()).unwrap();
assert!(result.is_exists);
assert_eq!(result.id, wallet.id);

remove_created_wallet(&wallet.id);
})
}
Expand Down

0 comments on commit 10625e4

Please sign in to comment.