Skip to content

Commit

Permalink
Fix tests (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-yu committed Mar 12, 2024
1 parent 4f32c05 commit 1cecb7b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 18 deletions.
8 changes: 0 additions & 8 deletions crates/ordinals/src/rarity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ mod tests {

assert_eq!(
Sat(50 * COIN_VALUE * u64::from(DIFFCHANGE_INTERVAL) - 1).rarity(),
Rarity::Common
);
assert_eq!(
Sat(50 * COIN_VALUE * DIFFCHANGE_INTERVAL - 1).rarity(),
Rarity::BlackRare
);
assert_eq!(
Expand All @@ -164,10 +160,6 @@ mod tests {

assert_eq!(
Sat(50 * COIN_VALUE * u64::from(SUBSIDY_HALVING_INTERVAL) - 1).rarity(),
Rarity::Common
);
assert_eq!(
Sat(50 * COIN_VALUE * SUBSIDY_HALVING_INTERVAL - 1).rarity(),
Rarity::BlackEpic
);
assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion src/index/updater/inscription_updater/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ impl StreamEvent {
.and_then(|txout| {
Address::from_script(&txout.script_pubkey, StreamEvent::get_network())
.map_err(|e| {
error!(
warn!(
"StreamEvent::with_transfer could not parse old_owner address: {}",
e
);
Expand Down
11 changes: 5 additions & 6 deletions src/subcommand/server/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ use opentelemetry::{
pub(crate) async fn tracing_layer<B>(request: Request<B>, next: Next<B>) -> Response {
let tracer = global::tracer("ord-kafka");
let cx = opentelemetry::Context::current();
let route = request
.extensions()
.get::<MatchedPath>()
.unwrap()
.as_str()
.to_string();
let route = if let Some(matched) = request.extensions().get::<MatchedPath>() {
matched.as_str().to_string()
} else {
"unknown_path".to_string()
};
let uri = request.uri();
let host = uri.host().unwrap_or_default();
let path = uri.path();
Expand Down
6 changes: 3 additions & 3 deletions src/subcommand/wallet/sats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@ mod tests {
rare_sats(vec![(
outpoint(1),
vec![(
50 * COIN_VALUE * DIFFCHANGE_INTERVAL - 1,
50 * COIN_VALUE * DIFFCHANGE_INTERVAL
50 * COIN_VALUE * u64::from(DIFFCHANGE_INTERVAL) - 1,
50 * COIN_VALUE * u64::from(DIFFCHANGE_INTERVAL)
)],
)]),
vec![(
outpoint(1),
Sat(50 * COIN_VALUE * DIFFCHANGE_INTERVAL - 1),
Sat(50 * COIN_VALUE * u64::from(DIFFCHANGE_INTERVAL) - 1),
0,
Rarity::BlackRare
)]
Expand Down

0 comments on commit 1cecb7b

Please sign in to comment.