Skip to content

Commit f31ca21

Browse files
committed
Always generate parsed instruction helpers
1 parent 4407367 commit f31ca21

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

packages/renderers-js/e2e/dummy/src/generated/instructions/instruction1.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,17 @@ export function getInstruction1Instruction<
3535

3636
return instruction;
3737
}
38+
39+
export type ParsedInstruction1Instruction<
40+
TProgram extends string = typeof DUMMY_PROGRAM_ADDRESS,
41+
> = {
42+
programAddress: Address<TProgram>;
43+
};
44+
45+
export function parseInstruction1Instruction<TProgram extends string>(
46+
instruction: IInstruction<TProgram>
47+
): ParsedInstruction1Instruction<TProgram> {
48+
return {
49+
programAddress: instruction.programAddress,
50+
};
51+
}

packages/renderers-js/e2e/dummy/src/generated/instructions/instruction2.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,17 @@ export function getInstruction2Instruction<
4848

4949
return instruction;
5050
}
51+
52+
export type ParsedInstruction2Instruction<
53+
TProgram extends string = typeof DUMMY_PROGRAM_ADDRESS,
54+
> = {
55+
programAddress: Address<TProgram>;
56+
};
57+
58+
export function parseInstruction2Instruction<TProgram extends string>(
59+
instruction: IInstruction<TProgram>
60+
): ParsedInstruction2Instruction<TProgram> {
61+
return {
62+
programAddress: instruction.programAddress,
63+
};
64+
}

packages/renderers-js/src/fragments/instructionParseFunction.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ export function getInstructionParseFunctionFragment(
2121
: instructionNode.accounts.length;
2222
const hasData = !!customData || instructionNode.arguments.length > 0;
2323

24-
if (!hasAccounts && !hasData) {
25-
return fragment('');
26-
}
27-
2824
const instructionDataName = nameApi.instructionDataType(instructionNode.name);
2925
const programAddressConstant = nameApi.programAddressConstant(programNode.name);
3026
const dataTypeFragment = fragment(

0 commit comments

Comments
 (0)