Skip to content

Commit

Permalink
Generate client changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lorisleiva committed Jul 29, 2024
1 parent 2fb04bf commit 5ee972a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions clients/js/src/generated/programs/computeBudget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
* @see https://github.com/kinobi-so/kinobi
*/

import { containsBytes, getU8Encoder, type Address } from '@solana/web3.js';
import {
containsBytes,
getU8Encoder,
type Address,
type ReadonlyUint8Array,
} from '@solana/web3.js';
import {
type ParsedRequestHeapFrameInstruction,
type ParsedRequestUnitsInstruction,
Expand All @@ -27,10 +32,9 @@ export enum ComputeBudgetInstruction {
}

export function identifyComputeBudgetInstruction(
instruction: { data: Uint8Array } | Uint8Array
instruction: { data: ReadonlyUint8Array } | ReadonlyUint8Array
): ComputeBudgetInstruction {
const data =
instruction instanceof Uint8Array ? instruction : instruction.data;
const data = 'data' in instruction ? instruction.data : instruction;
if (containsBytes(data, getU8Encoder().encode(0), 0)) {
return ComputeBudgetInstruction.RequestUnits;
}
Expand Down

0 comments on commit 5ee972a

Please sign in to comment.