MCPcopy Create free account
hub / github.com/EvoMap/evolver / fetchImpl

Function fetchImpl

test/validatorDaemon.test.js:114–126  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

112 const fetchGate = new Promise((r) => { releaseFetch = r; });
113 let fetchCount = 0;
114 const fetchImpl = async (url) => {
115 if (url.endsWith('/a2a/validator/stake')) return mkRes({ stake: { stake_amount: 100 } });
116 if (url.endsWith('/a2a/fetch')) {
117 fetchCount += 1;
118 if (fetchCount === 1) {
119 // Signal that tick #1 is now awaiting and block until we poke.
120 inflightResolve();
121 await fetchGate;
122 }
123 return mkRes({ validation_tasks: [] });
124 }
125 return mkRes({});
126 };
127
128 await withFakeFetch(fetchImpl, async () => {
129 const v = freshRequire('../src/gep/validator');

Callers 1

postEnvelopeFunction · 0.85

Calls 1

mkResFunction · 0.85

Tested by

no test coverage detected