openclaw / src /pairing /pairing-store-sqlite.test-helpers.ts
SaylorTwift's picture
SaylorTwift HF Staff
Add files using upload-large-folder tool
87dab07 verified
Raw History Blame Contribute Delete
854 Bytes
import { runOpenClawStateWriteTransaction } from "../state/openclaw-state-db.js";
import {
readChannelPairingState,
sqliteOptionsForEnv,
writeChannelPairingStateToDatabase,
} from "./pairing-store-sqlite.js";
import type { PairingChannel } from "./pairing-store.types.js";
type ChannelPairingState = ReturnType<typeof readChannelPairingState>;
export function readChannelPairingStateSnapshot(
channel: PairingChannel,
env: NodeJS.ProcessEnv = process.env,
): ChannelPairingState {
return readChannelPairingState(channel, env);
}
export function writeChannelPairingStateSnapshot(
channel: PairingChannel,
state: ChannelPairingState,
env: NodeJS.ProcessEnv = process.env,
): void {
runOpenClawStateWriteTransaction(
(database) => writeChannelPairingStateToDatabase(database, channel, state),
sqliteOptionsForEnv(env),
);
}