tamperEnvelope(
bytes,reason):Uint8Array
Defined in: packages/wire/src/envelope.ts:324
Copy a valid artifact and damage the copy so that decoding it fails for exactly reason.
Every reason but unsupported-payload-version is raised by deserializeEnvelope; that one yields a valid
envelope carrying another payload version, for the owning package’s gate to refuse.
Parameters
Section titled “Parameters”Uint8Array
reason
Section titled “reason”"invalid-magic" | "unsupported-envelope-version" | "unsupported-payload-version" | "invalid-section-geometry" | "nonzero-padding" | "misaligned-section" | "truncated-payload" | "unstable-buffer" | "integrity-mismatch"
Returns
Section titled “Returns”Uint8Array
Throws
Section titled “Throws”With INVALID_ARGUMENT when bytes is not a valid envelope, when it has no
section for invalid-section-geometry or misaligned-section to damage, or when unstable-buffer is asked of a
runtime that exposes no SharedArrayBuffer.