fix: need to refactor verification stream logic further and check if the stream is done but wasm isn't
This commit is contained in:
parent
50a7c80358
commit
051f4b2da7
|
@ -83,16 +83,24 @@ export async function getVerifiableStream(
|
||||||
if (chunk.done || wasmDone) {
|
if (chunk.done || wasmDone) {
|
||||||
if (wasmDone) {
|
if (wasmDone) {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
controller.enqueue(chunk.value);
|
||||||
done(controller);
|
done(controller);
|
||||||
} else {
|
} else {
|
||||||
controller.error(getWasmProperty(wasmId, "error"));
|
controller.error(getWasmProperty(wasmId, "error"));
|
||||||
|
exit();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (!wasmDone) {
|
||||||
|
controller.error("stream is ended but verification not complete");
|
||||||
|
exit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
controller.enqueue(chunk.value);
|
||||||
done(controller);
|
done(controller);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
|
||||||
controller.enqueue(chunk.value);
|
controller.enqueue(chunk.value);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async cancel(reason: any) {
|
async cancel(reason: any) {
|
||||||
await reader.cancel(reason);
|
await reader.cancel(reason);
|
||||||
|
|
Loading…
Reference in New Issue