commit
d3fda36ca6
|
@ -3,6 +3,7 @@ rust:
|
||||||
- stable
|
- stable
|
||||||
- beta
|
- beta
|
||||||
- nightly
|
- nightly
|
||||||
|
- 1.14.0
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- git clone https://github.com/bitcoin/secp256k1.git
|
- git clone https://github.com/bitcoin/secp256k1.git
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "bitcoin"
|
name = "bitcoin"
|
||||||
version = "0.11.1"
|
version = "0.11.2"
|
||||||
authors = ["Andrew Poelstra <apoelstra@wpsoftware.net>"]
|
authors = ["Andrew Poelstra <apoelstra@wpsoftware.net>"]
|
||||||
license = "CC0-1.0"
|
license = "CC0-1.0"
|
||||||
homepage = "https://github.com/rust-bitcoin/rust-bitcoin/"
|
homepage = "https://github.com/rust-bitcoin/rust-bitcoin/"
|
||||||
|
|
|
@ -277,10 +277,10 @@ macro_rules! display_from_debug {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
macro_rules! hex_script (($s:expr) => (Script::from($s.from_hex().unwrap())));
|
macro_rules! hex_script (($s:expr) => (::blockdata::script::Script::from($s.from_hex().unwrap())));
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
macro_rules! hex_hash (($s:expr) => (Sha256dHash::from(&$s.from_hex().unwrap()[..])));
|
macro_rules! hex_hash (($s:expr) => (::util::hash::Sha256dHash::from(&$s.from_hex().unwrap()[..])));
|
||||||
|
|
||||||
|
|
||||||
// Macros to replace serde's codegen while that is not stable
|
// Macros to replace serde's codegen while that is not stable
|
||||||
|
|
|
@ -285,7 +285,10 @@ impl FromStr for Address {
|
||||||
x => return Err(Error::Base58(base58::Error::InvalidVersion(vec![x])))
|
x => return Err(Error::Base58(base58::Error::InvalidVersion(vec![x])))
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(Address { network, payload })
|
Ok(Address {
|
||||||
|
network: network,
|
||||||
|
payload: payload,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,6 +101,7 @@ impl SighashComponents {
|
||||||
mod tests {
|
mod tests {
|
||||||
use serialize::hex::FromHex;
|
use serialize::hex::FromHex;
|
||||||
|
|
||||||
|
use blockdata::transaction::Transaction;
|
||||||
use network::serialize::deserialize;
|
use network::serialize::deserialize;
|
||||||
use util::misc::hex_bytes;
|
use util::misc::hex_bytes;
|
||||||
|
|
||||||
|
|
|
@ -454,7 +454,7 @@ impl <T: BitcoinHash> MerkleRoot for Vec<T> {
|
||||||
mod tests {
|
mod tests {
|
||||||
use strason;
|
use strason;
|
||||||
|
|
||||||
use network::encodable::VarInt;
|
use network::encodable::{ConsensusEncodable, VarInt};
|
||||||
use network::serialize::{serialize, deserialize};
|
use network::serialize::{serialize, deserialize};
|
||||||
use util::uint::{Uint128, Uint256};
|
use util::uint::{Uint128, Uint256};
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
|
@ -37,7 +37,11 @@ impl Privkey {
|
||||||
/// Creates an address from a public key
|
/// Creates an address from a public key
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn from_secret_key(key: SecretKey, compressed: bool, network: Network) -> Privkey {
|
pub fn from_secret_key(key: SecretKey, compressed: bool, network: Network) -> Privkey {
|
||||||
Privkey { compressed, network, key }
|
Privkey {
|
||||||
|
compressed: compressed,
|
||||||
|
network: network,
|
||||||
|
key: key,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Computes the public key as supposed to be used with this secret
|
/// Computes the public key as supposed to be used with this secret
|
||||||
|
@ -164,4 +168,4 @@ mod tests {
|
||||||
let pk = sk.to_legacy_address(&secp).unwrap();
|
let pk = sk.to_legacy_address(&secp).unwrap();
|
||||||
assert_eq!(&pk.to_string(), "1GhQvF6dL8xa6wBxLnWmHcQsurx9RxiMc8");
|
assert_eq!(&pk.to_string(), "1GhQvF6dL8xa6wBxLnWmHcQsurx9RxiMc8");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue