Merge pull request #1 from steveklabnik/master

Fix unused imports and add a gitignore
This commit is contained in:
Dawid Ciężarkiewicz 2014-08-04 17:04:33 -07:00
commit 2c2a98a153
2 changed files with 125 additions and 118 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
target/
Cargo.lock

View File

@ -4,14 +4,12 @@
#![crate_name = "bitcoin-secp256k1-rs"] #![crate_name = "bitcoin-secp256k1-rs"]
#![comment = "Bindings and wrapper functions for bitcoin secp256k1 library."] #![comment = "Bindings and wrapper functions for bitcoin secp256k1 library."]
#![feature(phase)] #![feature(phase)]
#![feature(globs)] // for tests only
extern crate libc; extern crate libc;
extern crate sync; extern crate sync;
use std::rand;
use std::rand::Rng;
use libc::{c_int, c_uchar}; use libc::{c_int, c_uchar};
use sync::one::{Once, ONCE_INIT}; use sync::one::{Once, ONCE_INIT};
@ -252,6 +250,14 @@ impl Secp256k1 {
} }
} }
#[cfg(test)]
mod test {
use std::rand;
use std::rand::Rng;
use super::*;
#[test] #[test]
fn invalid_pubkey() { fn invalid_pubkey() {
let s = Secp256k1::new(); let s = Secp256k1::new();
@ -369,5 +375,4 @@ fn sign_compact_with_recovery() {
assert_eq!(s.recover_compact(msg.as_slice(), sig.as_slice(), &mut pubkey, recid), Ok(())); assert_eq!(s.recover_compact(msg.as_slice(), sig.as_slice(), &mut pubkey, recid), Ok(()));
} }
}