Updated ethkey to the latest version

This commit is contained in:
debris
2016-06-20 10:02:02 +02:00
parent bf6308312e
commit 074311d95b
7 changed files with 103 additions and 26 deletions

View File

@@ -154,7 +154,7 @@ impl SafeAccount {
#[cfg(test)]
mod tests {
use ethkey::{Generator, Random, verify, Message};
use ethkey::{Generator, Random, verify_public, Message};
use super::{Crypto, SafeAccount};
#[test]
@@ -174,13 +174,13 @@ mod tests {
}
#[test]
fn sign_and_verify() {
fn sign_and_verify_public() {
let keypair = Random.generate().unwrap();
let password = "hello world";
let message = Message::default();
let account = SafeAccount::create(&keypair, [0u8; 16], password, 10240);
let signature = account.sign(password, &message).unwrap();
assert!(verify(keypair.public(), &signature, &message).unwrap());
assert!(verify_public(keypair.public(), &signature, &message).unwrap());
}
#[test]

View File

@@ -1,5 +1,5 @@
//! ethkey reexport to make documentation look pretty.
pub use _ethkey::{Address, Message, Signature, Public, Secret, Generator, sign, verify, Error, KeyPair, Random, Prefix};
pub use _ethkey::*;
use json;
impl Into<json::H160> for Address {