MCPcopy
hub / github.com/Doorman11991/smallcode / setAssertionState

Method setAssertionState

src/session/contract.js:202–212  ·  view source on GitHub ↗
(assertionId, state, opts = {})

Source from the content-addressed store, hash-verified

200 }
201
202 setAssertionState(assertionId, state, opts = {}) {
203 if (!Object.values(STATES).includes(state)) {
204 throw new Error(`invalid assertion state: ${state}`);
205 }
206 const a = this.assertions.find((x) => x.id === assertionId);
207 if (!a) throw new Error(`assertion not found: ${assertionId}`);
208 a.state = state;
209 if (opts.evidence !== undefined) a.evidence = opts.evidence || null;
210 if (opts.lastCheck !== undefined) a.last_check = opts.lastCheck || null;
211 return a;
212 }
213}
214
215// ─── Parsing ─────────────────────────────────────────────────────────────────

Callers 2

contract.test.jsFile · 0.80
markAssertionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected