Run formatter on examples/
Remove "examples" from the rustfmt ignore list.
This commit is contained in:
parent
fd1c6589ba
commit
6461e2db8d
|
@ -1,17 +1,14 @@
|
|||
extern crate bitcoin;
|
||||
|
||||
use std::{env, process};
|
||||
use std::str::FromStr;
|
||||
use std::{env, process};
|
||||
|
||||
use bitcoin::secp256k1::Secp256k1;
|
||||
use bitcoin::PublicKey;
|
||||
use bitcoin::util::bip32::ExtendedPrivKey;
|
||||
use bitcoin::util::bip32::ExtendedPubKey;
|
||||
use bitcoin::util::bip32::DerivationPath;
|
||||
use bitcoin::util::bip32::ChildNumber;
|
||||
use bitcoin::util::address::Address;
|
||||
use bitcoin::secp256k1::ffi::types::AlignedType;
|
||||
use bitcoin::hashes::hex::FromHex;
|
||||
use bitcoin::secp256k1::ffi::types::AlignedType;
|
||||
use bitcoin::secp256k1::Secp256k1;
|
||||
use bitcoin::util::address::Address;
|
||||
use bitcoin::util::bip32::{ChildNumber, DerivationPath, ExtendedPrivKey, ExtendedPubKey};
|
||||
use bitcoin::PublicKey;
|
||||
|
||||
fn main() {
|
||||
// This example derives root xprv from a 32-byte seed,
|
||||
|
@ -55,10 +52,7 @@ fn main() {
|
|||
// generate first receiving address at m/0/0
|
||||
// manually creating indexes this time
|
||||
let zero = ChildNumber::from_normal_idx(0).unwrap();
|
||||
let public_key = xpub.derive_pub(&secp, &vec![zero, zero])
|
||||
.unwrap()
|
||||
.public_key;
|
||||
let public_key = xpub.derive_pub(&secp, &vec![zero, zero]).unwrap().public_key;
|
||||
let address = Address::p2wpkh(&PublicKey::new(public_key), network).unwrap();
|
||||
println!("First receiving address: {}", address);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
extern crate bitcoin;
|
||||
|
||||
use std::io::{BufReader, Write};
|
||||
use std::net::{IpAddr, Ipv4Addr, Shutdown, SocketAddr, TcpStream};
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
use std::{env, process};
|
||||
use std::io::{Write, BufReader};
|
||||
|
||||
use bitcoin::consensus::{encode, Decodable};
|
||||
use bitcoin::network::{address, constants, message, message_network};
|
||||
|
@ -80,10 +80,7 @@ fn build_version_message(address: SocketAddr) -> message::NetworkMessage {
|
|||
let services = constants::ServiceFlags::NONE;
|
||||
|
||||
// "standard UNIX timestamp in seconds"
|
||||
let timestamp = SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.expect("Time error")
|
||||
.as_secs();
|
||||
let timestamp = SystemTime::now().duration_since(UNIX_EPOCH).expect("Time error").as_secs();
|
||||
|
||||
// "The network address of the node receiving this message"
|
||||
let addr_recv = address::Address::new(&address, constants::ServiceFlags::NONE);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# Eventually this shoud be: ignore = []
|
||||
ignore = [
|
||||
"examples",
|
||||
"src",
|
||||
"src/blockdata",
|
||||
"src/consensus",
|
||||
|
|
Loading…
Reference in New Issue