Functions
assertByteArrayHasEnoughBytesForCodec
assertByteArrayHasEnoughBytesForCodec(
codecDescription
,expected
,bytes
,offset?
):void
Asserts that a given byte array has enough bytes to decode (after the optional provided offset).
Returns void if the byte array has at least the expected number of bytes but throws a SolanaError otherwise.
Parameters
Parameter | Type | Description |
---|---|---|
codecDescription | string | A description of the codec used by the assertion error. |
expected | number | The minimum number of bytes expected in the byte array. |
bytes | Uint8Array <ArrayBufferLike > | ReadonlyUint8Array | The byte array to check. |
offset? | number | The offset from which to start checking the byte array. |
Returns
void