All checks were successful
deploy / deploy (push) Successful in 43s
Proof: active BTC/EURe tradeable loop on k3s must expose funding state cleanly, preserve durable history, and avoid inheriting dummy executor state. Assumptions: retained Kafka topics may contain legacy dummy records; those should be tolerated in history ingestion without weakening the current live command shape. Still fake: internal inventory is still unfunded, strategy and executor remain disarmed, and no live quote response has been submitted yet.
21 lines
669 B
JavaScript
21 lines
669 B
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
|
|
import { normalizeLiquidityState } from '../src/core/liquidity-state.mjs';
|
|
|
|
test('normalizeLiquidityState hydrates missing nested maps from persisted partial state', () => {
|
|
const state = normalizeLiquidityState(
|
|
{
|
|
last_refresh_at: null,
|
|
publish_count: 0,
|
|
},
|
|
{ withdrawalsFrozen: true },
|
|
);
|
|
|
|
assert.deepEqual(state.deposit_addresses, {});
|
|
assert.deepEqual(state.deposits, {});
|
|
assert.deepEqual(state.tracked_withdrawals, {});
|
|
assert.deepEqual(state.supported_tokens, {});
|
|
assert.equal(state.withdrawals_frozen, true);
|
|
assert.equal(state.paused, false);
|
|
});
|