summaryrefslogtreecommitdiff
path: root/btc-wire
diff options
context:
space:
mode:
authorAntoine A <>2022-07-30 17:47:53 +0200
committerAntoine A <>2022-07-30 20:36:52 +0200
commit4afbaca386c7591ac4a9bb657ec375bf7cb153e6 (patch)
treec84e85579cccbea583cdefec3e180de2a37147c3 /btc-wire
parent6efc2a939ab2b37f8e08678e168c9bf805afdeca (diff)
downloaddepolymerization-4afbaca386c7591ac4a9bb657ec375bf7cb153e6.tar.gz
depolymerization-4afbaca386c7591ac4a9bb657ec375bf7cb153e6.tar.bz2
depolymerization-4afbaca386c7591ac4a9bb657ec375bf7cb153e6.zip
Improve tests
Diffstat (limited to 'btc-wire')
-rw-r--r--btc-wire/src/main.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/btc-wire/src/main.rs b/btc-wire/src/main.rs
index 53ec673..c0afd0c 100644
--- a/btc-wire/src/main.rs
+++ b/btc-wire/src/main.rs
@@ -30,10 +30,7 @@ use common::{
use loops::LoopResult;
use std::path::PathBuf;
-use crate::{
- loops::{analysis::analysis, watcher::watcher, worker::worker},
- sql::sql_addr,
-};
+use crate::loops::{analysis::analysis, watcher::watcher, worker::worker};
mod fail_point;
mod loops;
@@ -113,7 +110,7 @@ fn init(config: Option<PathBuf>, init: Init) -> LoopResult<()> {
// TODO Use address label instead of the database ?
let prev_addr = db.query_opt("SELECT value FROM state WHERE name = 'addr'", &[])?;
let addr = if let Some(row) = prev_addr {
- sql_addr(&row, 0)
+ String::from_utf8(row.get(0)).unwrap()
} else {
// Or generate a new one
let new = Rpc::wallet(&btc_conf, WIRE_WALLET_NAME)
@@ -123,7 +120,7 @@ fn init(config: Option<PathBuf>, init: Init) -> LoopResult<()> {
"INSERT INTO state (name, value) VALUES ('addr', $1)",
&[&new.to_string().as_bytes()],
)?;
- new
+ new.to_string()
};
if created {