Simplified bitcoin keys module name
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::{ utils, bitcoin};
|
||||
use crate::{bitcoin, utils};
|
||||
use bdk::bitcoin::psbt::PartiallySignedTransaction;
|
||||
use bdk::bitcoin::Network;
|
||||
use bdk::database::MemoryDatabase;
|
||||
@@ -21,8 +21,8 @@ use bdk::{FeeRate, KeychainKind, SignOptions, TransactionDetails, Wallet};
|
||||
pub async fn run() -> Result<(), anyhow::Error> {
|
||||
let dave = utils::home(&"dave".to_string());
|
||||
let sammy = utils::home(&"sammy".to_string());
|
||||
let dave_key = bitcoin::bitcoin_keys::load_from_file(&dave).unwrap();
|
||||
let sammy_key = bitcoin::bitcoin_keys::load_from_file(&sammy).unwrap();
|
||||
let dave_key = bitcoin::keys::load_from_file(&dave).unwrap();
|
||||
let sammy_key = bitcoin::keys::load_from_file(&sammy).unwrap();
|
||||
|
||||
let dave_wallet = create_wallet(dave_key)?;
|
||||
let sammy_wallet = create_wallet(sammy_key)?;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
pub mod clients;
|
||||
pub mod bitcoin_keys;
|
||||
pub mod keys;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::path::PathBuf;
|
||||
|
||||
use config::SideNodeConfig;
|
||||
|
||||
use crate::{keys, utils, bitcoin};
|
||||
use crate::{bitcoin, keys, utils};
|
||||
|
||||
pub(crate) mod config;
|
||||
|
||||
@@ -14,7 +14,7 @@ pub(crate) fn init(home: PathBuf, config: SideNodeConfig) -> Result<(), std::io:
|
||||
keys::bft_crdt::write(&bft_crdt_key_path)?;
|
||||
|
||||
println!("Writing bitcoin key to: {:?}", bitcoin_key_path);
|
||||
bitcoin::bitcoin_keys::write(&bitcoin_key_path)?;
|
||||
bitcoin::keys::write(&bitcoin_key_path)?;
|
||||
|
||||
println!("Writing config to: {:?}", config_path);
|
||||
config::write_toml(&config, &config_path).expect("unable to write config file");
|
||||
|
||||
@@ -5,7 +5,7 @@ use crdt::TransactionList;
|
||||
use node::SideNode;
|
||||
use tokio::{sync::mpsc, task};
|
||||
|
||||
pub(crate) mod bitcoin;
|
||||
pub mod bitcoin;
|
||||
pub(crate) mod cli;
|
||||
pub mod clients;
|
||||
pub mod crdt;
|
||||
@@ -43,8 +43,8 @@ async fn setup(name: &String) -> SideNode {
|
||||
// First, load up the keys and create a bft-crdt
|
||||
let side_dir = utils::home(name);
|
||||
let bft_crdt_keys = keys::bft_crdt::load_from_file(&side_dir);
|
||||
let bitcoin_keys = bitcoin::bitcoin_keys::load_from_file(&side_dir).unwrap();
|
||||
let bitcoin_wallet = bitcoin::clients::btc_electrum_client::create_wallet(bitcoin_keys).unwrap();
|
||||
let keys = bitcoin::keys::load_from_file(&side_dir).unwrap();
|
||||
let bitcoin_wallet = bitcoin::clients::btc_electrum_client::create_wallet(keys).unwrap();
|
||||
let crdt = BaseCrdt::<TransactionList>::new(&bft_crdt_keys);
|
||||
|
||||
// Channels for internal communication, and a tokio task for stdin input
|
||||
|
||||
@@ -2,7 +2,9 @@ use bft_json_crdt::{
|
||||
json_crdt::{BaseCrdt, SignedOp},
|
||||
keypair::make_keypair,
|
||||
};
|
||||
use side_node::{clients::websocket::Client, crdt::TransactionList, keys, node::SideNode, utils};
|
||||
use side_node::{
|
||||
bitcoin, clients::websocket::Client, crdt::TransactionList, node::SideNode, utils,
|
||||
};
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
#[tokio::test]
|
||||
@@ -35,9 +37,9 @@ async fn test_distribute_via_websockets() {
|
||||
async fn setup(_: &str) -> SideNode {
|
||||
// First, load up the keys and create a bft-crdt
|
||||
let bft_crdt_keys = make_keypair();
|
||||
let mnemonic_words = bitcoin::bitcoin_keys::make_mnemonic();
|
||||
let bitcoin_keys = bitcoin::bitcoin_keys::get(mnemonic_words).unwrap();
|
||||
let bitcoin_wallet = btc_electrum_client::create_wallet(bitcoin_keys).unwrap();
|
||||
let mnemonic_words = bitcoin::keys::make_mnemonic();
|
||||
let keys = bitcoin::keys::get(mnemonic_words).unwrap();
|
||||
let bitcoin_wallet = bitcoin::clients::btc_electrum_client::create_wallet(keys).unwrap();
|
||||
let crdt = BaseCrdt::<TransactionList>::new(&bft_crdt_keys);
|
||||
|
||||
// Channels for internal communication, and a tokio task for stdin input
|
||||
|
||||
Reference in New Issue
Block a user