-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from dspicher/bump-clap
bump clap dependency to 4.x
- Loading branch information
Showing
10 changed files
with
545 additions
and
170 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ use std::fs::{self, File}; | |
use std::io::{BufWriter, Write}; | ||
use std::path::PathBuf; | ||
|
||
use clap::{App, Arg, ArgMatches, SubCommand}; | ||
use clap::{Arg, ArgMatches, Command}; | ||
|
||
use crate::blockchain::proto::block::Block; | ||
use crate::callbacks::{common, Callback}; | ||
|
@@ -28,16 +28,16 @@ impl Balances { | |
} | ||
|
||
impl Callback for Balances { | ||
fn build_subcommand<'a, 'b>() -> App<'a, 'b> | ||
fn build_subcommand() -> Command | ||
where | ||
Self: Sized, | ||
{ | ||
SubCommand::with_name("balances") | ||
Command::new("balances") | ||
.about("Dumps all addresses with non-zero balance to CSV file") | ||
.version("0.1") | ||
.author("gcarq <[email protected]>") | ||
.arg( | ||
Arg::with_name("dump-folder") | ||
Arg::new("dump-folder") | ||
.help("Folder to store csv file") | ||
.index(1) | ||
.required(true), | ||
|
@@ -48,7 +48,7 @@ impl Callback for Balances { | |
where | ||
Self: Sized, | ||
{ | ||
let dump_folder = &PathBuf::from(matches.value_of("dump-folder").unwrap()); | ||
let dump_folder = &PathBuf::from(matches.get_one::<String>("dump-folder").unwrap()); | ||
let cb = Balances { | ||
dump_folder: PathBuf::from(dump_folder), | ||
writer: Balances::create_writer(4000000, dump_folder.join("balances.csv.tmp"))?, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ use std::fs::{self, File}; | |
use std::io::{BufWriter, Write}; | ||
use std::path::PathBuf; | ||
|
||
use clap::{App, Arg, ArgMatches, SubCommand}; | ||
use clap::{Arg, ArgMatches, Command}; | ||
|
||
use crate::blockchain::proto::block::Block; | ||
use crate::blockchain::proto::tx::{EvaluatedTx, EvaluatedTxOut, TxInput}; | ||
|
@@ -33,16 +33,16 @@ impl CsvDump { | |
} | ||
|
||
impl Callback for CsvDump { | ||
fn build_subcommand<'a, 'b>() -> App<'a, 'b> | ||
fn build_subcommand() -> Command | ||
where | ||
Self: Sized, | ||
{ | ||
SubCommand::with_name("csvdump") | ||
Command::new("csvdump") | ||
.about("Dumps the whole blockchain into CSV files") | ||
.version("0.1") | ||
.author("gcarq <[email protected]>") | ||
.arg( | ||
Arg::with_name("dump-folder") | ||
Arg::new("dump-folder") | ||
.help("Folder to store csv files") | ||
.index(1) | ||
.required(true), | ||
|
@@ -53,7 +53,7 @@ impl Callback for CsvDump { | |
where | ||
Self: Sized, | ||
{ | ||
let dump_folder = &PathBuf::from(matches.value_of("dump-folder").unwrap()); | ||
let dump_folder = &PathBuf::from(matches.get_one::<String>("dump-folder").unwrap()); | ||
let cap = 4000000; | ||
let cb = CsvDump { | ||
dump_folder: PathBuf::from(dump_folder), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use clap::{App, ArgMatches, SubCommand}; | ||
use clap::{ArgMatches, Command}; | ||
|
||
use crate::blockchain::proto::block::Block; | ||
use crate::blockchain::proto::script::ScriptPattern; | ||
|
@@ -9,11 +9,11 @@ use crate::errors::OpResult; | |
pub struct OpReturn; | ||
|
||
impl Callback for OpReturn { | ||
fn build_subcommand<'a, 'b>() -> App<'a, 'b> | ||
fn build_subcommand() -> Command | ||
where | ||
Self: Sized, | ||
{ | ||
SubCommand::with_name("opreturn") | ||
Command::new("opreturn") | ||
.about("Shows embedded OP_RETURN data that is representable as UTF8") | ||
.version("0.1") | ||
.author("gcarq <[email protected]>") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ use bitcoin::hashes::{sha256d, Hash}; | |
use std::collections::HashMap; | ||
use std::io::{self, Write}; | ||
|
||
use clap::{App, ArgMatches, SubCommand}; | ||
use clap::{ArgMatches, Command}; | ||
|
||
use crate::blockchain::proto::block::{self, Block}; | ||
use crate::blockchain::proto::script::ScriptPattern; | ||
|
@@ -182,11 +182,11 @@ impl SimpleStats { | |
} | ||
|
||
impl Callback for SimpleStats { | ||
fn build_subcommand<'a, 'b>() -> App<'a, 'b> | ||
fn build_subcommand() -> Command | ||
where | ||
Self: Sized, | ||
{ | ||
SubCommand::with_name("simplestats") | ||
Command::new("simplestats") | ||
.about("Shows various Blockchain stats") | ||
.version("0.1") | ||
.author("gcarq <[email protected]>") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ use std::io::{BufWriter, Write}; | |
use std::path::PathBuf; | ||
|
||
use byteorder::{LittleEndian, ReadBytesExt}; | ||
use clap::{App, Arg, ArgMatches, SubCommand}; | ||
use clap::{Arg, ArgMatches, Command}; | ||
|
||
use crate::blockchain::proto::block::Block; | ||
use crate::callbacks::{common, Callback}; | ||
|
@@ -32,16 +32,16 @@ impl UnspentCsvDump { | |
} | ||
|
||
impl Callback for UnspentCsvDump { | ||
fn build_subcommand<'a, 'b>() -> App<'a, 'b> | ||
fn build_subcommand() -> Command | ||
where | ||
Self: Sized, | ||
{ | ||
SubCommand::with_name("unspentcsvdump") | ||
Command::new("unspentcsvdump") | ||
.about("Dumps the unspent outputs to CSV file") | ||
.version("0.1") | ||
.author("fsvm88 <[email protected]>") | ||
.arg( | ||
Arg::with_name("dump-folder") | ||
Arg::new("dump-folder") | ||
.help("Folder to store csv file") | ||
.index(1) | ||
.required(true), | ||
|
@@ -52,7 +52,7 @@ impl Callback for UnspentCsvDump { | |
where | ||
Self: Sized, | ||
{ | ||
let dump_folder = &PathBuf::from(matches.value_of("dump-folder").unwrap()); | ||
let dump_folder = &PathBuf::from(matches.get_one::<String>("dump-folder").unwrap()); | ||
let cb = UnspentCsvDump { | ||
dump_folder: PathBuf::from(dump_folder), | ||
writer: UnspentCsvDump::create_writer(4000000, dump_folder.join("unspent.csv.tmp"))?, | ||
|
Oops, something went wrong.