Skip to content

Commit

Permalink
Add batch module to wallet (ordinals#3359)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored and harutyunaraci committed Mar 30, 2024
1 parent 04fe988 commit 12396c7
Show file tree
Hide file tree
Showing 22 changed files with 194 additions and 198 deletions.
2 changes: 1 addition & 1 deletion src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ impl Index {
}

pub(crate) fn export(&self, filename: &String, include_addresses: bool) -> Result {
let mut writer = BufWriter::new(File::create(filename)?);
let mut writer = BufWriter::new(fs::File::create(filename)?);
let rtx = self.database.begin_read()?;

let blocks_indexed = rtx
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use {
},
into_usize::IntoUsize,
representation::Representation,
runes::Etching,
settings::Settings,
subcommand::{Subcommand, SubcommandResult},
tally::Tally,
Expand Down Expand Up @@ -63,7 +62,7 @@ use {
collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque},
env,
fmt::{self, Display, Formatter},
fs::{self, File},
fs,
io::{self, Cursor, Read},
mem,
net::ToSocketAddrs,
Expand Down
4 changes: 2 additions & 2 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl Settings {
};

let config = if let Some(config_path) = config_path {
serde_yaml::from_reader(File::open(&config_path).context(anyhow!(
serde_yaml::from_reader(fs::File::open(&config_path).context(anyhow!(
"failed to open config file `{}`",
config_path.display()
))?)
Expand Down Expand Up @@ -973,7 +973,7 @@ mod tests {

#[test]
fn example_config_file_is_valid() {
let _: Settings = serde_yaml::from_reader(File::open("ord.yaml").unwrap()).unwrap();
let _: Settings = serde_yaml::from_reader(fs::File::open("ord.yaml").unwrap()).unwrap();
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/subcommand/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl Decode {
.bitcoin_rpc_client(None)?
.get_raw_transaction(&txid, None)?
} else if let Some(file) = self.file {
Transaction::consensus_decode(&mut File::open(file)?)?
Transaction::consensus_decode(&mut fs::File::open(file)?)?
} else {
Transaction::consensus_decode(&mut io::stdin())?
};
Expand Down
2 changes: 1 addition & 1 deletion src/subcommand/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ rpcport={bitcoind_port}
}

serde_json::to_writer_pretty(
File::create(self.directory.join("env.json"))?,
fs::File::create(self.directory.join("env.json"))?,
&Info {
bitcoind_port,
ord_port,
Expand Down
5 changes: 1 addition & 4 deletions src/subcommand/wallet.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use {
super::*,
crate::wallet::{
inscribe::{Batch, Batchfile, Mode},
Wallet,
},
crate::wallet::{batch, Wallet},
bitcoincore_rpc::bitcoincore_rpc_json::ListDescriptorsResult,
reqwest::Url,
};
Expand Down
Loading

0 comments on commit 12396c7

Please sign in to comment.