Skip to content

Commit

Permalink
removed all slow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raphjaph committed Sep 29, 2022
1 parent ab879fc commit c7da5f0
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 745 deletions.
401 changes: 22 additions & 379 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ tower = "0.4.13"
tower-http = { version = "0.3.3", features = ["cors"] }

[dev-dependencies]
bdk = { version = "0.22.0", features = ["rpc", "keys-bip39", "sqlite"] }
executable-path = "1.0.0"
nix = "0.24.1"
pretty_assertions = "1.2.1"
reqwest = { version = "0.11.10", features = ["blocking"] }
tempfile = "3.2.0"
Expand Down
22 changes: 22 additions & 0 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,4 +868,26 @@ mod tests {
let context = Context::new();
assert_eq!(context.index.find(50 * COIN_VALUE).unwrap(), None);
}

#[test]
fn find_first_satoshi_spent_in_second_block() {
let context = Context::new();
context.rpc_server.mine_blocks(1);
let spend_txid = context
.rpc_server
.broadcast_tx(test_bitcoincore_rpc::TransactionTemplate {
input_slots: &[(1, 0, 0)],
output_count: 1,
fee: 0,
});
context.rpc_server.mine_blocks(1);
context.index.index().unwrap();
assert_eq!(
context.index.find(50 * COIN_VALUE).unwrap().unwrap(),
SatPoint {
outpoint: OutPoint::new(spend_txid, 0),
offset: 0,
}
)
}
}
2 changes: 0 additions & 2 deletions tests/expected.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use super::*;
pub(crate) enum Expected {
String(String),
Regex(Regex),
Ignore,
}

impl Expected {
Expand All @@ -21,7 +20,6 @@ impl Expected {
regex,
output
),
Self::Ignore => {}
}
}
}
16 changes: 0 additions & 16 deletions tests/find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,3 @@ fn unmined_ordinal() {
.expected_status(1)
.run();
}

#[test]
fn first_satoshi_spent_in_second_block() {
SlowTest::new()
.command("find 0")
.blocks(101)
.transaction(TransactionOptions {
slots: &[(1, 0, 0)],
output_count: 1,
fee: 0,
recipient: None,
})
.blocks(1)
.expected_stdout("4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b:0:0\n")
.run();
}
28 changes: 2 additions & 26 deletions tests/lib.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,13 @@
#![allow(clippy::type_complexity)]

use {
self::{
command_builder::CommandBuilder, expected::Expected, slow_test::SlowTest, state::State,
transaction_options::TransactionOptions,
},
bdk::{
blockchain::{
rpc::{RpcBlockchain, RpcConfig},
ConfigurableBlockchain,
},
database::MemoryDatabase,
keys::bip39::Mnemonic,
template::Bip84,
wallet::{signer::SignOptions, AddressIndex, SyncOptions, Wallet},
KeychainKind,
},
bitcoin::{hash_types::Txid, network::constants::Network, Block, OutPoint, Script, Transaction},
bitcoincore_rpc::{Client, RawTx, RpcApi},
self::{command_builder::CommandBuilder, expected::Expected},
executable_path::executable_path,
log::LevelFilter,
regex::Regex,
std::{
fs,
net::TcpListener,
process::{Child, Command, Stdio},
process::{Command, Stdio},
str,
sync::Once,
thread::sleep,
time::Duration,
},
tempfile::TempDir,
unindent::Unindent,
Expand All @@ -43,9 +22,6 @@ mod info;
mod list;
mod parse;
mod range;
mod slow_test;
mod state;
mod supply;
mod traits;
mod transaction_options;
mod version;
101 changes: 0 additions & 101 deletions tests/slow_test.rs

This file was deleted.

Loading

0 comments on commit c7da5f0

Please sign in to comment.