Skip to content
Open
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
9 changes: 9 additions & 0 deletions oracledesk-stellar/agents/core/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Keypair, StrKey } from "@stellar/stellar-sdk";
import {
AgentConfigError,
describeConfig,
redactConfig,
TESTNET_PASSPHRASE,
loadAgentConfig,
MAINNET_OPT_IN,
NETWORKS,
Expand Down Expand Up @@ -316,3 +318,10 @@ test("parseTunables validates the same fields without a deployment", () => {
assert.equal(parseTunables({ SLIPPAGE_BPS: "100" }).trading.slippageBps, 100);
assert.throws(() => parseTunables({ SLIPPAGE_BPS: "1.0" }), AgentConfigError);
});

test("passphrase constants and redactConfig alias never expose secrets", async () => {
assert.equal(TESTNET_PASSPHRASE, NETWORKS.testnet.passphrase);
const cfg = await load(LIVE).run();
const redacted = JSON.stringify(redactConfig(cfg));
assert.ok(!redacted.includes(AGENT.secret()));
});
6 changes: 6 additions & 0 deletions oracledesk-stellar/agents/core/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,3 +542,9 @@ export function describeConfig(cfg: AgentConfig): Record<string, unknown> {
maker: { ...maker, defaultSeedStroops: maker.defaultSeedStroops.toString() },
};
}

export const TESTNET_PASSPHRASE = NETWORKS.testnet.passphrase;
export const FUTURENET_PASSPHRASE = NETWORKS.futurenet.passphrase;
export const LOCAL_PASSPHRASE = NETWORKS.local.passphrase;
export const MAINNET_PASSPHRASE = NETWORKS.mainnet.passphrase;
export const redactConfig = describeConfig;