fix(testkit): macOS compat + fix test 8c ordering (#24)
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
import { makeLogger } from "./logger.js";
|
||||
|
||||
const logger = makeLogger("btc-oracle");
|
||||
|
||||
const COINGECKO_URL =
|
||||
"https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd";
|
||||
|
||||
@@ -42,7 +46,10 @@ export async function getBtcPriceUsd(): Promise<number> {
|
||||
return price;
|
||||
} catch (err) {
|
||||
const fb = fallbackPrice();
|
||||
console.warn(`[btc-oracle] Price fetch failed (using $${fb} fallback):`, err);
|
||||
logger.warn("price fetch failed — using fallback", {
|
||||
fallback_usd: fb,
|
||||
error: err instanceof Error ? err.message : String(err),
|
||||
});
|
||||
return fb;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user