Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 140 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions bobtimus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ edition = "2018"
[dependencies]
anyhow = "1"
async-trait = "0.1"
baru = "0.1"
baru = { git = "https://github.com/da-kami/baru", branch = "lender-decides-timelock" }
bitcoin_hashes = "0.9.0"
diesel = { version = "1.4", features = ["sqlite"] }
diesel_migrations = "1.4"
directories = "3.0"
elements = { version = "0.17", features = ["serde-feature"] }
elements = { version = "0.18", features = ["serde-feature"] }
elements-harness = { git = "https://github.com/comit-network/elements-harness" }
futures = { version = "0.3", default-features = false }
hex = "0.4"
Expand All @@ -21,6 +21,7 @@ http-api-problem = { version = "0.21", features = ["warp"] }
jsonrpc_client = { version = "0.6", features = ["reqwest"] }
log = "0.4"
mime_guess = "2.0.3"
proptest = "1"
reqwest = "0.11"
rust-embed = "5.7.0"
rust_decimal = { version = "1.15", features = ["serde-float"] }
Expand Down
7 changes: 7 additions & 0 deletions bobtimus/proptest-regressions/lib.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Seeds for failure cases proptest has generated in the past. It is
# automatically read and these particular cases re-run before any
# novel cases are generated.
#
# It is recommended to check this file in to source control so that
# everyone who runs the test benefits from these saved cases.
cc 9bb7f1b54a4968641948d278e51a05ed2930034b95de73641862e33bfcdcea4d # shrinks to term_in_days = 30868
4 changes: 2 additions & 2 deletions bobtimus/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ pub mod queries {

pub fn get_publishable_liquidations_txs(
conn: &SqliteConnection,
blockcount: u32,
secs_since_epoch: u64,
) -> Result<Vec<Transaction>> {
let txs = liquidations::table
.filter(liquidations::locktime.le(blockcount as i64))
.filter(liquidations::locktime.le(secs_since_epoch as i64))
.get_results::<Liquidation>(conn)?;

let txs = txs
Expand Down
14 changes: 6 additions & 8 deletions bobtimus/src/elements_rpc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::{bail, Context, Result};
use bitcoin_hashes::hex::FromHex;
use elements::{
bitcoin::{Amount, PrivateKey},
bitcoin::Amount,
confidential::{Asset, Nonce, Value},
encode::serialize_hex,
secp256k1_zkp::{SecretKey, Signature},
Expand Down Expand Up @@ -338,18 +338,16 @@ impl Client {
Ok(sig)
}

pub async fn dump_private_key(&self, address: &Address) -> Result<SecretKey> {
let privkey = self.dumpprivkey(address).await?;
let privkey = PrivateKey::from_wif(&privkey)?;

Ok(privkey.key)
}

pub async fn get_blockcount(&self) -> Result<u32> {
let blockcount = self.getblockcount().await?;

Ok(blockcount)
}

pub async fn get_address_blinding_key(&self, address: &Address) -> Result<SecretKey> {
let key = self.dumpblindingkey(address).await?;
Ok(key)
}
}

#[derive(Debug, Deserialize)]
Expand Down
Loading