Skip to content

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.

Uint8Array

"invalid-magic" | "unsupported-envelope-version" | "unsupported-payload-version" | "invalid-section-geometry" | "nonzero-padding" | "misaligned-section" | "truncated-payload" | "unstable-buffer" | "integrity-mismatch"

Uint8Array

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.