Skip to content

Commit be6f3af

Browse files
committed
Use spaces :(
1 parent f416448 commit be6f3af

File tree

7 files changed

+921
-917
lines changed

7 files changed

+921
-917
lines changed

Diff for: .editorconfig

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# see https://editorconfig.org for more options, and setup instructions for yours editor
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4

Diff for: .rustfmt.toml

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
hard_tabs = true
21
use_small_heuristics = "Off"

Diff for: examples/test_against_node.rs

+19-19
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,30 @@ use bitcoincore_rpc::Client;
1010
type Result<T> = std::result::Result<T, failure::Error>;
1111

1212
fn main() -> Result<()> {
13-
let mut args = std::env::args();
13+
let mut args = std::env::args();
1414

15-
let _exe_name = args.next().unwrap();
15+
let _exe_name = args.next().unwrap();
1616

17-
let url = args.next().ok_or_else(|| format_err!("Usage: <rpc_url> [username] [password]"))?;
18-
let user = args.next();
19-
let pass = args.next();
17+
let url = args.next().ok_or_else(|| format_err!("Usage: <rpc_url> [username] [password]"))?;
18+
let user = args.next();
19+
let pass = args.next();
2020

21-
let mut rpc = Client::new(url, user, pass);
21+
let mut rpc = Client::new(url, user, pass);
2222

23-
let _blockchain_info = rpc.getblockchaininfo()?;
23+
let _blockchain_info = rpc.getblockchaininfo()?;
2424

25-
let best_block_hash = rpc.getbestblockhash()?;
26-
println!("best block hash: {}", best_block_hash);
27-
let bestblockcount = rpc.getblockcount()?;
28-
println!("best block height: {}", bestblockcount);
29-
let best_block_hash_by_height = rpc.getblockhash(bestblockcount)?;
30-
println!("best block hash by height: {}", best_block_hash_by_height);
31-
assert_eq!(best_block_hash_by_height, best_block_hash);
25+
let best_block_hash = rpc.getbestblockhash()?;
26+
println!("best block hash: {}", best_block_hash);
27+
let bestblockcount = rpc.getblockcount()?;
28+
println!("best block height: {}", bestblockcount);
29+
let best_block_hash_by_height = rpc.getblockhash(bestblockcount)?;
30+
println!("best block hash by height: {}", best_block_hash_by_height);
31+
assert_eq!(best_block_hash_by_height, best_block_hash);
3232

33-
let bitcoin_block: bitcoin::Block = rpc.get_by_id(&best_block_hash)?;
34-
println!("best block hash by `get`: {}", bitcoin_block.header.prev_blockhash);
35-
let bitcoin_tx: bitcoin::Transaction = rpc.get_by_id(&bitcoin_block.txdata[0].txid())?;
36-
println!("tx by `get`: {}", bitcoin_tx.txid());
33+
let bitcoin_block: bitcoin::Block = rpc.get_by_id(&best_block_hash)?;
34+
println!("best block hash by `get`: {}", bitcoin_block.header.prev_blockhash);
35+
let bitcoin_tx: bitcoin::Transaction = rpc.get_by_id(&bitcoin_block.txdata[0].txid())?;
36+
println!("tx by `get`: {}", bitcoin_tx.txid());
3737

38-
Ok(())
38+
Ok(())
3939
}

0 commit comments

Comments
 (0)