mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 09:34:20 +00:00
refactor(analysis): remove fixed result quotas
This commit is contained in:
1 parent
0e2738ffb6
commit
20152a9872
105 files changed
+605
-1084
No files matched your search
@@ -84,12 +84,23 @@ export interface JavaScriptReplayRunner {
|
||||
) => Promise<ReplayExecutionResult>;
|
||||
}
|
||||
|
||||
const assertReplayManifestWithinProtocolLimit = (
|
||||
input: ControlledReplayInput,
|
||||
): void => {
|
||||
if (
|
||||
new TextEncoder().encode(JSON.stringify(input)).byteLength >
|
||||
input.limits.protocol_bytes
|
||||
)
|
||||
throw new RangeError("Replay plan input exceeds its protocol byte limit");
|
||||
};
|
||||
|
||||
/** Read, normalize, and content-address every input to one replay experiment. */
|
||||
export const prepareReplayPlan = async (
|
||||
input: ControlledReplayInput,
|
||||
policy: EnabledJavaScriptReplayPolicy,
|
||||
host: JavaScriptReplayHost,
|
||||
): Promise<PreparedReplayPlan> => {
|
||||
assertReplayManifestWithinProtocolLimit(input);
|
||||
const cases = replayCases(input).map((item) => ({
|
||||
...item,
|
||||
sha256: digestJson(item.arguments),
|
||||
|
||||
Reference in new issue
Block a user