diff --git a/test/packages/js-experimental/src/generated/programs/pubkeyTests.ts b/test/packages/js-experimental/src/generated/programs/pubkeyTests.ts index 1698c72e..15e071c0 100644 --- a/test/packages/js-experimental/src/generated/programs/pubkeyTests.ts +++ b/test/packages/js-experimental/src/generated/programs/pubkeyTests.ts @@ -7,17 +7,6 @@ */ import { Address } from '@solana/addresses'; -import { Program } from '@solana/programs'; export const PUBKEY_TESTS_PROGRAM_ADDRESS = 'PubkeyTests1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d' as Address<'PubkeyTests1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d'>; - -export type PubkeyTestsProgram = - Program<'PubkeyTests1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d'>; - -export function getPubkeyTestsProgram(): PubkeyTestsProgram { - return { - name: 'pubkeyTests', - address: PUBKEY_TESTS_PROGRAM_ADDRESS, - }; -} diff --git a/test/packages/js-experimental/src/generated/types/ruleSet.ts b/test/packages/js-experimental/src/generated/types/ruleSet.ts index 6e496f6f..a2746a3e 100644 --- a/test/packages/js-experimental/src/generated/types/ruleSet.ts +++ b/test/packages/js-experimental/src/generated/types/ruleSet.ts @@ -15,13 +15,13 @@ import { Codec, Decoder, Encoder, - GetDataEnumKind, - GetDataEnumKindContent, + GetDiscriminatedUnionVariant, + GetDiscriminatedUnionVariantContent, combineCodec, getArrayDecoder, getArrayEncoder, - getDataEnumDecoder, - getDataEnumEncoder, + getDiscriminatedUnionDecoder, + getDiscriminatedUnionEncoder, getStructDecoder, getStructEncoder, getTupleDecoder, @@ -32,14 +32,14 @@ import { export type RuleSet = | { __kind: 'None' } - | { __kind: 'Single'; fields: [Address] } - | { __kind: 'ProgramAllowList'; fields: [Array
] } - | { __kind: 'ProgramDenyList'; fields: [Array
] }; + | { __kind: 'Single'; fields: readonly [Address] } + | { __kind: 'ProgramAllowList'; fields: readonly [Array
] } + | { __kind: 'ProgramDenyList'; fields: readonly [Array
] }; export type RuleSetArgs = RuleSet; export function getRuleSetEncoder(): Encoder { - return getDataEnumEncoder([ + return getDiscriminatedUnionEncoder([ ['None', getUnitEncoder()], [ 'Single', @@ -61,7 +61,7 @@ export function getRuleSetEncoder(): Encoder { } export function getRuleSetDecoder(): Decoder { - return getDataEnumDecoder([ + return getDiscriminatedUnionDecoder([ ['None', getUnitDecoder()], [ 'Single', @@ -87,19 +87,33 @@ export function getRuleSetCodec(): Codec { } // Data Enum Helpers. -export function ruleSet(kind: 'None'): GetDataEnumKind; +export function ruleSet( + kind: 'None' +): GetDiscriminatedUnionVariant; export function ruleSet( kind: 'Single', - data: GetDataEnumKindContent['fields'] -): GetDataEnumKind; + data: GetDiscriminatedUnionVariantContent< + RuleSetArgs, + '__kind', + 'Single' + >['fields'] +): GetDiscriminatedUnionVariant; export function ruleSet( kind: 'ProgramAllowList', - data: GetDataEnumKindContent['fields'] -): GetDataEnumKind; + data: GetDiscriminatedUnionVariantContent< + RuleSetArgs, + '__kind', + 'ProgramAllowList' + >['fields'] +): GetDiscriminatedUnionVariant; export function ruleSet( kind: 'ProgramDenyList', - data: GetDataEnumKindContent['fields'] -): GetDataEnumKind; + data: GetDiscriminatedUnionVariantContent< + RuleSetArgs, + '__kind', + 'ProgramDenyList' + >['fields'] +): GetDiscriminatedUnionVariant; export function ruleSet( kind: K, data?: Data diff --git a/test/renderers/rust/instructionsPage.test.ts b/test/renderers/rust/instructionsPage.test.ts index 308ec2b2..b544d9aa 100644 --- a/test/renderers/rust/instructionsPage.test.ts +++ b/test/renderers/rust/instructionsPage.test.ts @@ -1,5 +1,11 @@ import test from 'ava'; -import { instructionArgumentNode, instructionNode, programNode, remainderSizeNode, stringTypeNode, visit } from '../../../src'; +import { + instructionArgumentNode, + instructionNode, + programNode, + stringTypeNode, + visit, +} from '../../../src'; import { getRenderMapVisitor } from '../../../src/renderers/rust/getRenderMapVisitor'; import { codeContains } from './_setup'; @@ -32,7 +38,7 @@ test('it renders an instruction with a remainder str', (t) => { arguments: [ instructionArgumentNode({ name: 'memo', - type: stringTypeNode({ size: remainderSizeNode() }), + type: stringTypeNode('utf8'), }), ], }),